Evals & Observability·Question 25 of 83Intermediate

How do you wire evals into CI so that prompt or model changes can't silently regress quality?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Treat prompts, rubrics, and eval datasets as code: versioned in the repo, changed via PR, tested on every change. The pipeline:

  1. Trigger: any change to a prompt template, model/version pin, decoding params, retrieval config, or tool schemas kicks off an eval run - same trigger discipline as unit tests. Also trigger on the provider's schedule: a scheduled (e.g., nightly) run against production config catches upstream model changes you didn't make.
  2. Tiered suites for speed/cost: a PR-blocking suite of ~50-200 curated cases (guardrail assertions + key quality metrics) that finishes in minutes and modest dollars; the full suite (thousands of cases, k repeats, expensive judges) runs nightly or pre-release. Cache results keyed on (input, config hash) so unchanged paths don't re-run.
  3. Gating logic: guardrail metrics gate hard - any jailbreak-suite failure, PII leak, or schema-validity regression blocks merge, no discussion. Quality metrics gate statistically - compare against the baseline run on the same dataset version, and block only if the drop exceeds a noise threshold you've established (paired comparison across cases; with judge-graded metrics, account for judge variance too, e.g., verdict flips on repeated judging). Otherwise you'll either rubber-stamp real regressions or cry wolf on noise until people ignore the gate.
  4. Reporting in the PR: not just the aggregate score - the per-case diff (which cases flipped fail→pass and pass→fail) with links to transcripts. A reviewer can eyeball five flipped transcripts in two minutes; that's where bad changes actually get caught.
  5. Versioning discipline: every result records prompt version, model version, dataset version, judge version. Change the dataset or judge → re-baseline; never compare scores across those boundaries.
Full worked answer with diagram

Treat prompts, rubrics, and eval datasets as code: versioned in the repo, changed via PR, tested on every change. The pipeline:

  1. Trigger: any change to a prompt template, model/version pin, decoding params, retrieval config, or tool schemas kicks off an eval run - same trigger discipline as unit tests. Also trigger on the provider's schedule: a scheduled (e.g., nightly) run against production config catches upstream model changes you didn't make.
  2. Tiered suites for speed/cost: a PR-blocking suite of ~50-200 curated cases (guardrail assertions + key quality metrics) that finishes in minutes and modest dollars; the full suite (thousands of cases, k repeats, expensive judges) runs nightly or pre-release. Cache results keyed on (input, config hash) so unchanged paths don't re-run.
  3. Gating logic: guardrail metrics gate hard - any jailbreak-suite failure, PII leak, or schema-validity regression blocks merge, no discussion. Quality metrics gate statistically - compare against the baseline run on the same dataset version, and block only if the drop exceeds a noise threshold you've established (paired comparison across cases; with judge-graded metrics, account for judge variance too, e.g., verdict flips on repeated judging). Otherwise you'll either rubber-stamp real regressions or cry wolf on noise until people ignore the gate.
  4. Reporting in the PR: not just the aggregate score - the per-case diff (which cases flipped fail→pass and pass→fail) with links to transcripts. A reviewer can eyeball five flipped transcripts in two minutes; that's where bad changes actually get caught.
  5. Versioning discipline: every result records prompt version, model version, dataset version, judge version. Change the dataset or judge → re-baseline; never compare scores across those boundaries.

The failure mode to avoid: an advisory eval job whose red X everyone merges past. Gates must block, and to keep blocking politically survivable, keep the blocking suite small, fast, stable, and visibly correlated with real quality.

Worth sketching. Two different gates on one run: draw it and the hard-versus-statistical distinction stops needing explanation.

flowchart TD
    PR["PR touches prompt,<br/>model pin or retrieval config"] --> S["Blocking suite:<br/>50-200 cases, minutes"]
    N["Nightly run on production config,<br/>catches upstream changes"] --> S
    S --> G{"Guardrail<br/>failure?"}
    G -->|"yes"| B["Block the merge"]
    G -->|"no"| Q{"Quality drop beyond<br/>the noise threshold?"}
    Q -->|"yes"| B
    Q -->|"no"| M["Merge, with the per-case<br/>flip diff in the PR"]

What a good answer covers

  • Treat prompts, rubrics, and eval datasets as code
  • Trigger: any change to a prompt template, model/version pin, decoding params, retrieval config, or tool…
  • Tiered suites for speed/cost
  • Gating logic: guardrail metrics gate hard - any jailbreak-suite failure, PII leak, or schema-validity…
  • Reporting in the PR: not just the aggregate score - the per-case diff (which cases flipped fail→pass and…

Key terms: Trigger · Tiered suites for speed/cost · Gating logic · Reporting in the PR · Versioning discipline

Interviewer follow-ups to expect

  1. A PR improves the target task but flips two unrelated cases to failing - what's your process?

  2. How do you keep judge-based CI costs sane as the team's PR volume grows?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep