Evaluation and Release Gating
Design one shared gate that passes, blocks or holds prompt and model changes for 30 AI applications, without letting a strong average hide a failing critical slice.
- Kind
- Case study
- Level
- Core
- View
- Interview prep
- Sections
- 4
- By
- Sourav Banerjee
- Last updated
- 20 Nov 2026
Practise this as a worksheet: Evaluation and Release Gating
Interview view. The case brief, design walkthrough, technical deep dives and quick review, condensed into bullets, tables and lines to say out loud, with interactive diagrams to step through.
Want to go deep? The full casebook has the complete reasoning in prose, the original diagrams, practice questions with worked answers and the sources.
Case brief
The case in one line: one shared gate that decides whether a prompt or model change may ship, returning pass, block or hold with evidence.
30-Second Cheat Sheet
- The product: a shared platform for about 30 AI applications whose teams change prompts and models every week.
- The decision: every change gets pass, block or hold, with an owner, a threshold and a record.
- A dashboard is not a gate: a dashboard reports numbers nobody must act on. A gate decides.
- The tension: a gate strict enough to stop a bad release can get slow or expensive enough that teams route around it.
- The comparison: a frozen candidate against a pinned production baseline, on quality, safety, latency and cost.
- The hard part is trust: a sales copilot passed 96.7% of 120 cases, but its 6 regulated-claim cases passed at 83.3%, and unsupported claims rose from 1.2% to 8.6% in production.
- The rules: missing evidence blocks, thin evidence holds, only an authorised owner overrides.
1. Decide Whether One Change May Ship
The product
- A company runs about 30 AI applications: support assistants, internal copilots, narrow workflow tools.
- Teams change their prompts and models every week.
- Each change raises one question somebody must answer: may it go to production, should it be stopped, or does a person need to look first?
- This case designs the shared platform that makes that decision. The three outcomes are pass, block and hold.
Why a dashboard is not enough
- A dashboard of scores reports numbers that nobody is obliged to act on.
- A release gate makes a decision, and that decision has an owner, a threshold and a record.
- The tension the whole design manages: a gate strict enough to stop a bad release can become slow or expensive enough that teams route around it.
The terms that carry the whole case
| Term | Meaning |
|---|---|
| Candidate | The proposed change, frozen as a bundle of versioned artifacts: prompt, model, retrieval configuration, tool manifest and policy settings |
| Baseline | The version currently in production, pinned so it can't move while we compare against it |
| Suite | A versioned set of test cases |
| Golden set | The curated core of the suite, with expected behaviour and labels a team trusts |
| Rubric | The written scoring guide for a dimension that needs judgement, such as "is every claim supported?" |
| LLM grader (LLM-as-judge) | A large language model used to score outputs against a rubric. Powerful and fallible: it can confidently reward the wrong answer |
| Slice | A subset of cases that share a property, such as every case about regulated claims |
| Critical slice | A slice whose failure the business can't accept, however good the average looks |
The hard part: trusting the decision
- In the source's incident, a sales copilot passed 96.7% of 120 release cases. It looked healthy.
- Only six of those cases tested regulated claims, and that slice passed at 83.3%.
- In production, drafts with unsupported claims rose from 1.2% to 8.6%.
- The aggregate score hid the failure the business feared most. The incident deep dive covers it in full.
2. Follow One Change Through the Gate
The change: a refund bot's team wants to change its prompt. The source traces it end to end:
- Release request. Someone files it with frozen artifacts: the new prompt, the model, the retrieval and policy settings. Nothing in the bundle may change during the evaluation.
- Sandboxed run. A versioned suite and rubric run against the candidate in a sandbox (an isolated execution environment). The test never touches live customers.
- Scoring. Deterministic checks (fixed rules such as "does the output match the schema?") and a calibrated LLM grader score four dimensions: quality, safety, latency and cost.
- Policy compares with the pinned production version.
- Suppose groundedness (the share of answers supported by retrieved evidence) drops by 2%.
- Whether that automatically blocks or waits for a person is a threshold the owners set before the run, not a judgement made after seeing the result.
- Hold. A hold goes to the risk owner, the person accountable for that application's release risk. A random engineer can't override it.
- Learn. If production later finds a failure the suite missed, that case becomes a golden-set case before the next release.
- The loop: pin the candidate → evaluate against the baseline → decide pass, block or hold → learn from production.
- Nothing ships on a feeling that the new version seems better.
The core gate (the source's figure, as a flow)
Score the pinned candidate → evidence complete?
- No → block.
- Yes → every slice within limits?
- Yes → pass.
- No → block.
- Unsure (too few cases or disputed scores) → hold for the risk owner.
Why the order of the two checks matters
- Missing evidence is checked first. A run that never finished can't reach the slice comparison and accidentally pass.
- Only complete evidence gets judged.
- The slice question has three answers, not two: within limits passes, outside limits blocks, unsure holds.
3. What You Need to Design
The task in one paragraph
- Design one shared gate for about 30 applications.
- It compares each candidate with a pinned production baseline.
- It returns pass, block or hold with evidence for quality, safety, latency and cost.
- The grader scores; policy code and authorised people decide.
| Rule | What it means |
|---|---|
| Strong aggregate, failed critical slice | Never releases |
| Strong aggregate, failed safety floor | Never releases |
| Missing evidence | Blocks |
| Evidence too thin to support a conclusion | Holds |
| Override | Only an authorised owner |
Out of scope
- Automatic prompt or model tuning.
- Broad sharing of datasets between tenants. A tenant is one application team's isolated workspace.
The same gate answers more prompts
- "The model got worse after an upgrade."
- "We have no evaluation strategy."
- The source treats the sales-copilot incident and a cost pivot ("the eval bill tripled") as variations on the same design, and so does this casebook.
Who it's for
- Engineers preparing for forward deployed, solutions or applied-AI engineering interviews.
- Especially a round on evaluation platforms or release processes for prompt and model changes.
What it assumes you know
- Golden sets, rubrics and LLM-as-judge.
- Basic statistics such as confidence bounds.
- CI release pipelines (continuous integration: the automated pipeline that tests every change).
By the end you should be able to
- Explain the gate end to end.
- Answer follow-ups on:
- Load sizing
- Grader calibration
- Slice coverage
- Failure policy
- Rollout
- Evaluation cost
How the sections divide the work
- Design walkthrough: the complete interview answer, in reasoning order.
- Technical deep dives: the data model, the decision code, the statistics, the full incident, the two neighbouring prompts, the threat model and the cost answer.
- Practice (in the full casebook): the source's self-checks and follow-ups behind reveals.
- Quick review: the card for the night before.
Caveat: every traffic figure, threshold, calendar and dollar amount in this case is a source planning assumption or an illustrative example, not a measured result of this prototype.
Quick Recall: Lines to Say in the Interview
- "A dashboard reports scores. A gate makes a decision, with an owner, a threshold and a record."
- "Every change gets pass, block or hold."
- "The candidate is frozen; the baseline is pinned."
- "The grader scores; policy code and authorised people decide."
- "Missing evidence blocks. Thin evidence holds."
- "96.7% on 120 cases hid a six-case regulated slice passing at 83.3%."
- "The threshold is set before the run, not after seeing the result."
Design walkthrough
The goal: a shared gate that compares a pinned candidate with a pinned baseline and returns pass, block or hold, with evidence for quality, safety, latency and cost.
30-Second Cheat Sheet
- Restate as a release decision: "can this change ship?" has an owner, a threshold and a record. "What are the scores?" is a dashboard question.
- Size it: 30 apps × 20 candidates/day × 5,000 cases = 3M executions/day, 6–15M calls/day, 278–694 calls/s in a six-hour window.
- Control plane decides, data plane executes. A noisy runner can't make policy nondeterministic.
- Δ against a pinned baseline for quality, judged on a lower bound; absolute floors for safety, p95 latency and cost.
- Critical slices pass on their own, with a minimum slice size.
- The grader is release logic: versioned, calibrated against humans, advisory until agreement holds.
- Fail closed on evidence, degrade on dashboards: missing evidence blocks, thin evidence holds.
- Roll out on one application first, and measure the gate itself (coverage, escape rate, agreement, run time, cost, flakiness).
Opening line (source's version): "I'd frame this as a controlled decision process rather than a dashboard: compare a candidate against a pinned baseline, detect quality, safety, latency and cost regressions, and record the evidence behind the decision."
1. Restate the Ask as a Release Decision
The customer's sentence
- "We need one platform that lets 30 AI applications decide whether prompt, model, retrieval, or tool changes are safe to release."
- Your first job: restate it without smuggling in a design.
- "What are the scores?" is a dashboard question.
- "Can this change ship?" is a release question, with an owner, a threshold and a record.
- The goal is to make quality, safety, latency and cost regressions visible before and after deployment. The platform is the means.
Weak vs strong restatement
| Restatement | Why it's weak or strong |
|---|---|
| Weak: "Build an evaluation dashboard with test runs, scorecards, and approvals." | Feature-first. Never pins a baseline, never says what blocks a release, never names who may override |
| Strong: "Build a release-gating system that helps teams compare a candidate AI change against the current baseline, detect quality, safety, latency, and cost regressions, and record the evidence behind a release decision." | Keeps the outcome in view. A dashboard becomes one possible interface to a controlled decision process |
- In one sentence: a shared platform for 30 AI applications that makes a controlled pass, block or hold decision against a pinned production baseline, with evidence for quality, safety, latency and cost.
Four stakeholders, four questions
- Blur them together and you get a system that is technically impressive and unusable in operation.
| Stakeholder | The question they hire the platform to answer |
|---|---|
| AI application engineer | "Did my change worsen behaviour?" |
| Domain evaluator | "What should I score and why?" |
| Safety lead | "Is this release safe enough for the risk profile?" |
| Release manager | "Can I approve this with evidence?" |
The decision contract
Decision contract = the rules that define what each outcome means. Artifact lineage = a record of exactly which versions produced a result.
- The shared platform supplies artifact lineage, execution and evidence. Each application owns its rubric and thresholds.
- Pass needs a named policy, a pinned baseline and a complete, validated run.
- Block means a known limit failed, or required evidence is unavailable.
- Hold means the evidence is too thin or too disputed to decide either way.
- Override is allowed only for an authorised owner. Every override records who and why.
Soundbite: "I'd frame this as a controlled decision process rather than a dashboard: compare a candidate against a pinned baseline, detect quality, safety, latency and cost regressions, and record the evidence behind the decision."
2. Ask the Questions That Change the Design
- A discovery question earns its time only when the answer changes the design.
Interview-guide questions
| Question to ask | What it's really asking | What you then decide |
|---|---|---|
| Which applications are critical, and what counts as a release? | Is changing a prompt on the refund bot a "release" that must pass the suite? | Suite tiers and per-app policies |
| Who owns labels, rubrics, review and override authority? | Can an engineer override a safety fail, or only the risk owner? | Trusted evidence and who may decide |
| What is the release window and acceptable evaluation spend? | Do we have 20 minutes and $200 per candidate, or overnight and unlimited? | Workers and suite schedule |
| Which traces contain PII, secrets or proprietary prompts? | Can eval logs contain a customer SSN from a test ticket? | Redaction, retention, tenant access |
| Which regressions must block automatically versus hold for review? | If groundedness drops 2%, is that an automatic block or a meeting? | Thresholds and confidence bands |
| How are post-release failures fed back into tests? | When prod invents a policy, does that case join the golden set before the next ship? | How the suite stays current |
PII = personally identifiable information (name, email, account number). SSN = a United States social security number, the classic example. If a test ticket can carry one, eval logs need redaction, retention limits and tenant-scoped access.
The six-question discovery tree (ask in order; each answer narrows the next)
| # | Question | What the answer decides |
|---|---|---|
| 1 | Which application types are in scope, and which are safety- or revenue-critical? | Whether a failed check blocks or warns; whether human review is mandatory |
| 2 | Are we gating only pre-release changes, or also monitoring live releases? | Offline suites only, or shadow traffic, canaries and sampled production too |
| 3 | What labels exist today, who reviews hard cases, and how often do they disagree? | Deterministic scoring, model graders or human routing; disagreement kept as a signal |
| 4 | How frequently do teams release, and what confidence level is required to ship? | Fast smoke gates versus slow, rich review |
| 5 | What parts of a trace are sensitive, and what must be redacted or isolated? | Redaction, tenant isolation, retention, who may inspect failures |
| 6 | What regression threshold blocks a release versus only opening a review? | Whether the gate is credible at all |
Two more from the answer key
- What counts as a release?
- Who may override a failed gate, and how is that override recorded?
- Both have structural consequences:
- An audited override forces immutable records and role-based access controls.
- Shared evaluation data forces tenancy boundaries between applications.
When the interviewer stays vague
- Protect the riskiest assumption: block uncertain, high-impact changes and escalate them to a human.
- For a high-impact application, a false pass (shipping a harmful change) is more dangerous than a false block, which only delays a good one.
3. State Requirements as Testable Constraints
- A requirement that can't fail a test is a preference.
- "A fast gate" is a preference.
- "p95 run duration under 20 minutes in the release window" is a constraint.
- Only constraints shape the architecture.
p95 = the duration that 95% of runs finish within.
Functional requirements
- Pin candidate artifacts: prompt, model, retrieval, tool and policy.
- Select versioned suites and rubrics.
- Run deterministic and model-based checks.
- Compare against the pinned production baseline.
- Gate critical slices and the four outcome dimensions separately.
- Route uncertain or disputed cases to humans.
- Record decisions, owners and overrides.
- Sample production failures into a reviewed test pipeline.
MoSCoW: six must-haves (the smallest trustworthy first release)
MoSCoW = must, should, could, won't.
- A release owner submits a candidate; the platform compares it to a pinned baseline and returns pass, block or hold with evidence.
- Datasets, prompts, models, tools and graders are versioned. Versioning is the only way to reproduce a decision later.
- Both deterministic and probabilistic evaluations run. Some checks must be stable; others depend on rubric judgement.
- Every candidate is compared with a pinned production baseline, never reported only as an absolute score.
- Release policies are enforced per application. That turns analysis into action.
- Human review is supported, and reviewer disagreement is recorded as a first-class signal, not discarded as noise.
Should-haves (once the gate is trusted)
- Privacy-safe production failures sampled back into future suites, so the test set evolves with the product.
- Online sampling of live or shadow traffic after rollout.
- Latency and cost gates beside quality and safety.
Six things fenced out of the first version
- Automated fine-tuning or prompt optimisation.
- A full legal or compliance sign-off workflow.
- Open-ended notebook experimentation (it weakens reproducibility).
- Every metric for every application on day one.
- Cross-tenant sharing of datasets or graders.
- Custom visualisation of every trace field.
- And don't assume one universal rubric.
Compact non-functional targets (interview guide)
| Requirement | Example target / constraint |
|---|---|
| Latency | p95 release evaluation within ~20 minutes |
| Reproducibility | Same artifacts, same suite, same decision |
| Security | Tenant isolation; sandboxed runners |
| Trust | Calibrated graders; fail closed when evidence is missing |
| Cost | Bounded eval spend |
| Scale (illustrative) | 30 apps × 20 candidates/day × 5,000 cases = 3M executions/day; 2–5 calls each ⇒ 6–15M calls/day. Six-hour window ≈ 278–694 calls/s (~112–278 workers at 2.5 calls/s). Tier suites; shared elastic pool with tenant quotas |
Constraints stated so a test can fail them (full design)
| Constraint | Stated so it can be tested |
|---|---|
| Latency | Gate finishes inside the release window. p95 past about 20 minutes (the target I'd set) turns a gate into a blocker |
| Availability | Peak matters more than average. Thirty teams releasing in the same business hour can overwhelm a daily-average design |
| Reproducibility | Same dataset, prompt version, model version, tool config and grader version recreate the same evaluation context |
| Lineage | Every result traces back to its inputs and version history |
| Statistical honesty | No overstating tiny differences, no cherry-picked runs, no treating noisy scores as precise |
| Security | The sandboxed runner is hostile-adjacent: timeouts, egress limits, secrets scoping, per-run concurrency caps |
| Isolation | One application's traces, labels and evaluations never leak into another tenant's workspace |
| Reliability | Fail closed when evidence is missing. Never approve on an incomplete or unvalidated run |
| Cost | At roughly 3,000,000 executions a day, tier the suites. If every release costs a fortune, teams route around the gate |
Give every requirement an owner
- A requirement with no owning component means the design is incomplete.
| Requirement | Component responsibility |
|---|---|
| Version datasets, prompts, models, tools, graders | Registry and immutable version store |
| Run deterministic and probabilistic evaluations | Evaluation runner and scoring service |
| Compare candidates with production baselines | Baseline comparator and diff engine |
| Support human review and disagreement | Review queue, adjudication workflow, audit log |
| Enforce release policies | Policy engine and release gate |
| Sample privacy-safe production failures into future tests | Trace ingestion, redaction, curation pipeline |
| Reproducible runs | Run manifests, locked versions, execution logs |
| Grader and dataset lineage | Provenance graph and metadata store |
| Statistically honest comparisons | Reporting layer with uncertainty-aware summaries |
| Tenant and data isolation | Authz boundaries, workspace partitioning, encryption controls |
Spoken answer: "Functionally, pin the candidate, run the suite versus the live baseline, then pass, block or hold. Non-functionally, about 20 minutes, reproducible, fail closed, and humans own overrides."
4. Size the Gate Against the Release Window
- The whiteboard sketch (queue, workers, results database, dashboard) works at average load and fails when the release train tightens. Sizing turns the sketch into a design.
The arithmetic, step by step
- 30 applications × 20 candidate releases a day = 600 candidate evaluations a day. "30 apps" isn't the unit.
- × 5,000 test cases each = 3,000,000 test-case executions a day.
- Calls per case: 2–3 at minimum, 3–5 more realistically. Across 2 to 5 → roughly 6,000,000–15,000,000 model or evaluator calls a day.
Spread over a day it's modest; packed into a window it isn't
| Window | Calls/sec needed | Approx. workers at 2.5 calls/sec each | Practical implication |
|---|---|---|---|
| 24-hour batch | 69–174 | 28–70 | Shared elastic pool is enough if backlog is allowed |
| 6-hour release gate | 278–694 | 112–278 | Needs aggressive parallelism, admission control and prioritisation |
- Worker math: one call every 400 ms ≈ 2.5 calls/s per worker at full utilisation. Divide the call rate by 2.5: 278 calls/s → ~112 workers; 694 → ~278.
- Rough, pre-headroom ranges. Real deployments add capacity for retries, tail latency and bursts.
Average vs peak
- Average load answers "can we survive the day?"
- Peak load answers "can we survive the release window?"
- Many apps submitting in the same business hour overwhelm a modest daily average.
- So: a shared, elastic pool with per-tenant quotas and admission control (one app can't starve the rest), and tiered suites (not every change runs the full set).
Growth
| Scenario | Candidate evaluations/day | Test-case executions/day | Design pressure |
|---|---|---|---|
| Current | 600 | 3,000,000 | Queue depth, worker pool, storage writes |
| 10x growth | 6,000 | 30,000,000 | Throughput, cost, sharding, retention |
- Today the limit is evaluator concurrency. At 10× the source expects storage, retention and human-review routing to dominate.
What to cache
- Safe when versioned: test definitions, baseline outputs, corpus snapshots, rubric and prompt templates, precomputed embeddings. They can't change the answer.
- Not safe: a stochastic judgement. If the grader's verdict varies run to run, caching one verdict hides exactly the variance the gate exists to measure.
Soundbite: "I cache immutable inputs and expensive shared fixtures, not the stochastic judgement itself."
5. Draw the Architecture End to End
The principle the interview guide puts first
- The LLM grader produces a calibrated score. Deterministic checks, policy code and human authority control the release.
- Candidate applications and evaluation inputs run in a sandbox.
- The decision side reads only validated, completed results.
The main flow in six steps
- A release request pins the full candidate bundle and the current production baseline: model, prompt, retrieval, tool and policy versions.
- The scheduler picks versioned suites and app-specific rubrics, applies tenant quotas, and sends cases to sandboxed runners with timeouts and limited network egress and secrets.
- Runners execute the whole application workflow, not just a model call. Deterministic checks score schemas, policy rules and measurable outcomes. A versioned LLM grader scores rubric dimensions that need judgement.
- Validated results are written immutably with run, case, grader and rubric hashes. An incomplete run can't masquerade as complete evidence.
- The policy engine computes candidate-minus-baseline deltas for quality, safety, p95 latency and cost, checks each critical slice independently, and issues pass, block or hold.
- Humans review disputed or statistically thin cases and record overrides with reasons. Production signals are redacted and labelled before they join future suites.
Control plane vs data plane
- Control plane decides what to evaluate: selection, enforcement, escalation.
- Data plane executes it: runner and grader.
- Why: a slow or failing runner can't make policy nondeterministic. Same validated evidence → same decision.
- Caveat: noisy execution can still change the evidence itself. That's why the gate judges bounds, repeated trials and minimum slice sizes, not single scores.
The source's other figures, in words
- Planes and lanes: release request (candidate + baseline) → immutable artifact registry + dataset store (suites, labels, rubrics, sensitivity) → scheduler (tenant quotas, admission, backpressure) → sandboxed runner (app, model, retrieval and tool calls) → grader (task success, safety, latency, cost) → validated warehouse → fail-closed policy → pass, block or hold, with human review and adjudication.
- Learning loop: redacted live or shadow sampling → new failure cases → back into the dataset store.
- Decision branches: policy computes Δ = candidate − baseline → pass (Δ within threshold), block (Δ breaches threshold), hold for review (uncertain or insufficient evidence).
- Two annotations:
- Artifacts include prompts, models, retrieval, tools, seeds and hashes.
- Runner timeouts, egress, secrets and concurrency are all bounded. Human overrides are inputs to policy, and validated runs stay auditable.
Components (in the order a release travels)
- The last column matters most: most components fail closed, stopping the release rather than letting it through.
| Component | Primary responsibility | State ownership | Fails how |
|---|---|---|---|
| Artifact Registry | Store immutable candidate definitions and baseline references | System of record for candidate config | Closed: unresolvable artifact → no run |
| Dataset Store | Store suites, labels, rubrics and scenario metadata | System of record for eval inputs | Closed: missing suite → no run |
| Evaluation Scheduler | Select suites, fan out work, enforce queueing and concurrency | Job / run orchestration state | Degrades: sheds noncritical work, lowers concurrency |
| Sandboxed Runner | Execute prompts, tool calls and model calls under isolation | Ephemeral run state | Retries idempotently with the same run ID |
| Grader Service | Score task success, safety, latency and cost | Derived scoring state | Closed for release decisions on timeout; retry for analysis runs |
| Human Review UI | Resolve ambiguous or disputed cases | Review decisions and annotations | Holds the release; nothing auto-approves |
| Results Warehouse | Persist run-level and aggregate outcomes | System of record for validated results | Closed: evidence store down → block and escalate |
| Release Policy Engine | Decide pass, block or hold for review | Policy decision state | Closed: reads only completed, validated records |
| Online Sampling Pipeline | Sample live or shadow traffic post-release | Monitoring / sampling state | Degrades: dashboards lag, the gate keeps running |
Three boundaries to point at
- Registry and dataset store are strongly consistent, so a run always points at fixed inputs.
- The warehouse may be eventually consistent for analytics, but the final gate reads only completed, validated records.
- The runner is the trust boundary. Prompts, retrieved documents and uploaded cases are adversarial until proven otherwise (see the trust-boundary deep dive).
Trace the refund-bot prompt change (the source's ten-step happy path)
- A release engineer submits an immutable candidate to the registry.
- The registry pins the exact prompt, model, retrieval, tool, seed and baseline identifiers.
- The scheduler selects the app's suite, partitions work by tenant and enforces concurrency limits.
- The runner executes cases in isolation with controlled seeds.
- The grader scores correctness, safety, latency and cost.
- The warehouse stores run-level and aggregate results.
- The policy engine compares candidate metrics and confidence intervals with the pinned baseline.
- Ambiguous cases route to human review.
- The decision is issued: pass, block or hold.
- Reasons are attached to the release record.
Each stage answers a customer question
- Registry: "What exactly changed?"
- Suite: "What did we test?"
- Runner: "Under what conditions?"
- Grader: "How did it perform?"
- Policy engine: "Can we ship?"
The MVP
MVP = minimum viable product, the smallest version real teams would use.
- In: registry, dataset store, asynchronous scheduler, sandboxed runner, grader, warehouse, and a policy engine that can pass or block.
- Later: richer human workflow, adaptive suite selection, online sampling, multi-region execution, score calibration.
6. Pin Every Input and Compare Against a Baseline
- A score means nothing without what it's compared against. The platform says whether a candidate is better than, worse than, or indistinguishable from a pinned baseline.
Δ = Metric_candidate − Metric_baseline
- The metric can be quality, safety violation rate, task success, refusal accuracy, latency or cost.
- Each threshold states its direction:
- A negative Δ hurts quality or task success.
- A positive Δ hurts a violation rate, latency or cost.
- A delta is useful only when the baseline is fixed, versioned and comparable.
- A two-tenths-of-a-point gain on a noisy rubric may not justify a release. The gate weighs variance, confidence bands and operational risk, not only the sign.
Say the derivation in one breath
- Per test case, compare the candidate output with a pinned baseline output or rubric score.
- Compute Δ for the metric that matters to that application.
- Aggregate by application, by release and across the fleet.
- If the distribution of Δ crosses the allowed regression threshold → fail or route to human review.
The refund bot, in numbers (illustrative)
- Groundedness 0.91 on the baseline, 0.89 on the candidate.
- Δ = −0.02: two percentage points, or about a 2.2% relative drop.
- The brief's "drops by 2%" means the absolute figure here. Every threshold must say which of the two it uses.
- Whether it blocks depends on the pre-set threshold and on how certain the measurement is. So the next step judges quality on a lower bound, not on −0.02 alone.
Pinning makes it reproducible
- Same dataset, prompt version, model version, tool configuration and grader version → same evaluation context.
- Four immutable records carry the guarantee. Their write rules let you reconstruct a decision a year later (fields, lifecycles, ownership and API in the records deep dive).
7. Decide on Four Dimensions and Fail Closed
- One opaque score hides the trade. A candidate can raise quality while lowering safety, doubling latency or exceeding the budget.
- Release only when all of these pass:
| Dimension | How it's judged |
|---|---|
| Quality | Task-specific outcomes and a confidence-aware lower bound on the delta. Judging the lower bound of a bootstrapped delta, not its point estimate, is what "statistically honest" means in code |
| Safety | An independent floor. Better average quality can't compensate for a safety regression |
| Latency (p95) | An agreed envelope |
| Cost per case | An agreed envelope |
| Each critical slice | Must pass on its own, whatever the aggregate says |
The invariant (and its test)
- A more persuasive release can't ship if it falls below the safety floor.
- The source's test: candidate quality 0.95 vs baseline 0.90, but safety 0.97 against a floor of 0.995. The gate must not allow it.
- The decision function and that test are in the decision-code deep dive.
Missing vs thin evidence (one of the most-tested ideas in this round)
- Missing evidence blocks. Grader timeout or unavailable evidence store → the gate can't know → it refuses.
- Thin evidence holds. A sample too small to support a conclusion → "insufficient evidence", routed to a person.
- Neither ever becomes a pass by default.
Nondeterministic outputs
Nondeterministic = the same input can produce different text on each run.
- Compare repeated trials and outcome equivalence (did it satisfy the task, respect policy, avoid harm?), not exact text match.
Soundbite: "Missing evidence blocks. Thin evidence holds. Nothing passes by default."
8. Gate on Slices, Not on the Aggregate
- A high average can hide a failing slice. A change can lift mean quality while hurting the rare, high-risk cases.
- The gate reads per-slice results. A critical slice must pass on its own.
- A slice needs a minimum number of cases. Too small to conclude → hold, not pass.
What goes in the golden set
- Small enough to maintain carefully, broad enough to reflect real release risk:
- Representative happy paths.
- Known hard cases.
- Policy-sensitive cases.
- Examples that previously caused incidents or near misses.
- The quiet failures of the old system: malformed tool inputs, ambiguous queries, retrieval misses, and verbose answers that looked strong but were wrong.
- A golden set of obvious examples creates false confidence, because every candidate passes it.
Nondeterminism as distributions
- Run repeated trials where needed, seed what can be seeded, compare aggregated rubric scores or pass rates.
- Unit of comparison: often outcome equivalence, not text match.
- Stratify by scenario type so a small-slice regression stays visible instead of averaging away.
Online feedback is a discovery channel, not a scorecard
- Thumbs-down, abandonment, escalation, corrections and repeated retries are leads for new cases.
- They enter the golden set only after redaction and trustworthy labelling.
Soundbite (the tutorial's words): "Online feedback is a discovery channel for new failure modes; offline evaluation is where I make those failure modes measurable and releasable."
Stale suites and benchmark overfitting
- Signs of a stale suite: it no longer distinguishes candidates, or incidents cluster where the suite never looks.
- Fix: mark it non-authoritative for gating, refresh with new workflows, re-baseline thresholds.
- Overfitting the benchmark: large offline gains, flat real-world behaviour.
- Defences: hidden holdout cases, adversarial variants, and never exposing the gate suite to the candidate's prompt, retrieval index or logs.
The incident is this step failing
- Sales copilot: 96.7% of 120 cases passed; only six covered regulated claims, passing at 83.3%.
- A critical-slice threshold plus a minimum slice size would have held or blocked it (full walk-through in the incident deep dive).
9. Calibrate the Grader Before Letting It Gate
- A model grader is part of the release logic, so it needs evaluation like any other component.
- An uncalibrated grader can make a risky release look safe while still producing a clean audit trail.
The named failure: verbosity over correctness
- Long, confident, wrong answers get high marks. The runner completes normally, so nothing looks broken.
- Published work on LLM judges reports this verbosity bias (Zheng et al. 2023).
| Move | Action |
|---|---|
| Detect | Score distributions shift toward long responses with low factual alignment; compare against a baseline grader or a smaller rule-based check |
| Contain | Pause the grader version for that tenant or application; require human approval for release decisions |
| Recover | Re-run affected cases with a pinned prior grader version and a manually sampled audit set |
| Prevent | Version the grader, store rubric hashes, require a calibration suite with concise-correct and verbose-wrong examples |
Validate against humans, honestly
- Use a representative sample, not the easy cases.
- Raw match rate flatters a grader when most cases pass (chance agreement is easy). Report a chance-corrected statistic like Cohen's kappa beside it, and read agreement separately on failing cases.
- Measure agreement on the cases that drive release decisions, then read the disagreements:
- Some reveal rubric gaps.
- Others expose genuine task ambiguity.
- Re-score a held-out set with humans periodically. A grader drifts after rubric changes or model upgrades even when the platform is stable.
Cohen's kappa = agreement between two raters, corrected for the agreement you'd expect by chance.
Trust is earned in levels
- Advisory first: blocks only low-risk deploys, or requires human approval on uncertain cases.
- As agreement stabilises: high-confidence checks move to automatic gating.
- The design assumes the grader is imperfect and builds a path to trust.
One tool for breadth, another for the decision
| Trade-off | Use this for breadth | Use this for the decision |
|---|---|---|
| Generic metrics vs task-specific rubrics | Generic metrics for platform-level trend visibility | Task-specific rubrics for release decisions |
| Model graders vs human review | Model graders on every change | Humans for calibration, dispute resolution and periodic audits |
| Large suites vs iteration speed | Fast smoke suite on every candidate | Broader regression suite pre-release; deep audits for high-risk changes |
| Fixed thresholds vs statistical tests | Statistical comparison for noisy quality metrics | Fixed thresholds for critical safety invariants |
- Reuse the shape when a follow-up catches you: what gives broad visibility cheaply, and what do you trust for the decision that matters?
10. Fail Closed on Evidence, Degrade on Dashboards
- Every external dependency and irreversible action needs an explicit failure policy. Otherwise the default is "guess", and a guessing gate approves things.
- Rule of thumb: anything feeding the decision fails closed; anything that only displays results may degrade.
| Condition | Recommended behaviour | Why |
|---|---|---|
| Grader service times out | Fail closed for release decisions; queue a retry for analysis runs | Don't approve on missing evidence |
| Metrics backend is delayed | Degrade dashboards, not gate decisions, if the decision record is already durable | Preserve the control plane |
| Evaluation case write conflicts | Retry idempotently with the same run identifier | Prevent duplicate or partial runs |
| Dependency outage persists | Open a dead-letter path and require human review | Avoid silent backlog buildup |
| Evidence store is unavailable | Block release and escalate | Audit evidence is part of the gate |
The mechanics
- Time out grader and retrieval calls.
- Retry only safe-to-repeat operations, such as an idempotent write keyed on the same run identifier.
- Circuit breaker on repeated failures, so the platform stops hammering a broken service.
- Dead-letter path for persistent failures.
- Escalate any unresolved release decision to a person rather than guessing.
Circuit breaker = stops calling a dependency that keeps failing. Dead-letter path = a queue of failed work that needs human attention.
The asymmetry is deliberate
- Delayed metrics backend → only the dashboard slows, because the decision record is already durable.
- Unavailable evidence store → the release blocks, because audit evidence is part of the gate.
11. Roll Out One Application and Earn Trust
- A gate nobody trusts gets bypassed, so adoption is part of the design.
| Phase | Owner | Exit criterion |
|---|---|---|
| 1. Prove it on one critical application | App team plus one platform engineer | App submits runs, compares against a baseline, gets a recommendation humans understand. Every metric is a learning signal, not yet a hard gate |
| 2. Calibrate automated graders against humans | Evaluation lead or applied scientist | Stable, explainable agreement on the decision-driving cases; the disagreement set is understood |
| 3. Add latency and cost gates | Platform engineering with product and finance input | Candidate stays within agreed performance and cost envelopes, or the exception is approved with a rationale |
| 4. Expand with a shared schema and app-specific rubrics | Platform team; app teams own rubric configuration | Coverage, escape rate and flaky-case rate hold as teams join |
The answer key's calendar
- Weeks 0–1: name the scope, the evidence, override authority and thresholds.
- Weeks 1–2: prove the gate on one application.
- Weeks 2–3: calibrate graders, including concise-correct and verbose-wrong examples.
- Weeks 3–4: run the gate in advisory mode.
- Week 5: add latency and cost gates.
- Weeks 6–8: expand with a shared schema.
- After the pilot, widen only while the metrics hold, and retire any suite that stops discriminating between candidates.
The shared schema is the core product
- Holds: run metadata; model, prompt, dataset and rubric versions; outcome labels; trace references; the release decision.
- Rubrics stay configuration: a support bot and a coding assistant don't need identical criteria.
- Adapters handle each app's formats; the shared service owns orchestration, scoring and audit.
The gate measures itself
Caveat: these are the source's illustrative alert levels, not universal standards.
| Metric | Calculation | Owner | Illustrative alert threshold |
|---|---|---|---|
| Evaluation coverage | executed cases / planned cases for a release | platform ops | below 95% for critical apps, or below the agreed minimum sample |
| Release regression escape rate | harmful changes that passed the gate / total harmful changes discovered | release manager with incident review board | rolling 30-day rate above 5%; same class escapes twice in a month; any severe escape in a critical app |
| Human-grader agreement | match rate between automated grader and sampled human labels | evaluation lead | below 85% for a stable rubric, or below the app-specific floor |
| Run duration | final scoring event minus candidate submission | platform engineering | p95 above 20 minutes, or median up more than 20% week over week |
| Cost per run | compute + storage + tool calls + human review per run | platform owner with finance visibility | above $25 for the critical app, or a trend that breaks the release budget |
| Flaky case rate | cases whose result changes across repeated runs without input change / repeated cases | QA or evaluation infra | above 2% overall, or above 5% in a release-affecting dimension |
| Production failure capture rate | regressions caught before or right after deploy / total known regressions | incident review board | below 80% over a quarter, or down more than 10 points |
QA = quality assurance, checking behaviour before users see it. Flaky case = its result changes across repeated runs with no input change.
A concrete launch review
| Reading | Value | Verdict against the table |
|---|---|---|
| Coverage | 97% | Clears 95% |
| Severe escapes | One in the last 20 releases | Trips the "any severe escape in a critical app" alert, unless it happened outside a critical app |
| Human-grader agreement | 89% | Clears 85%; acceptable only if the disagreement set is explainable |
| p95 run time | 14 minutes vs the 20-minute window | Clears |
| Cost | $18 per release evaluation | Clears $25 |
| Flaky rate | 1.5%, concentrated in one ambiguous rubric dimension | Clears 2% overall, but can exceed the 5% per-dimension threshold: check that dimension alone |
| Regression classes | Four of five caught before release, one by the canary | Needs explanation; postmortem required on the missed class |
Canary = a small first slice of production traffic.
- Two need explanation before launch: the 89% agreement and the class the canary caught.
- Two more need checking: the severe escape and the concentrated flaky dimension.
Rollback triggers (as explicit as go/no-go gates)
- A bad canary signal.
- A spike in flaky cases.
- A post-release incident in an unchecked failure class.
- A failed dependency that prevents trustworthy scoring.
- A severe escape also becomes a new incident case in the suite.
12. Deliver It in Fifty Minutes
- Spend time in proportion to risk, not diagram size. The evaluation-design block is the depth budget, and interviewers probe it hardest.
| Minutes | Phase |
|---|---|
| 0–5 | Discovery and assumptions: users, what counts as a release, failure modes, approval owner (steps 1, 2) |
| 5–10 | Scope and success criteria; platform-wide vs app-level metrics (steps 1, 3) |
| 10–18 | Architecture: control and data planes, the ten-step path (steps 4, 5) |
| 18–28 | Evaluation design, the depth budget: rubrics, graders, suite size, nondeterminism (steps 6 to 9) |
| 28–35 | Security, reliability and failure modes (step 10) |
| 35–42 | Rollout and adoption (step 11) |
| 42–47 | Follow-ups: grader validation, golden set, nondeterminism, online-to-offline (Practice, in the full casebook) |
| 47–50 | Executive summary: the outcome, the riskiest trade-off, the first production gate |
Open with the hidden constraint
- The applications aren't homogeneous: high-volume support assistants, low-volume workflows, narrow safety cases.
- So don't force one universal metric. Build a shared evaluation spine with app-specific rubrics and gates on top.
Spoken answer (interview guide's two-minute version): "I would build a release decision system, with an evaluation dashboard as one view of it. I pin the candidate and production baseline, run versioned cases in an isolated worker pool, score deterministic checks and calibrated LLM rubrics, and store immutable evidence. A policy engine compares quality, safety, latency and cost separately, with critical slices passing independently. Missing results block, thin samples hold, and humans handle disputes and overrides. I would start advisory on one critical app, validate the grader against humans, then harden the gate and expand. Post-release incidents become labelled regression cases, and the gate's own cost and escape rate are measured."
The answer key's longer two-minute answer, condensed
- Frame: the platform isn't the goal; making quality, safety, latency and cost regressions visible before and after deployment is. Restate as a release-gating system that compares a candidate with the current baseline and records the evidence.
- Stakeholders: engineer ("did my change worsen behaviour?"), evaluator ("what should I score?"), safety lead ("is this safe enough?"), release manager ("can I approve this with evidence?") are different jobs.
- Architecture: control plane decides, data plane executes inside a hostile-adjacent sandbox. Registry pins the candidate so it can't drift mid-run; dataset store owns suites and rubrics; scheduler fans out with per-tenant quotas; grader scores all four dimensions; policy engine reads only completed validated runs and computes the delta against thresholds.
- Rules: missing evidence fails closed; a sample too small to decide holds rather than approves.
- Named failure: a grader that rewards verbosity. Version graders, store rubric hashes, calibrate with concise-correct and verbose-wrong cases.
- Rollout: one critical app → calibrate against human labels → latency and cost gates → expand.
- Close: "The gate is only useful if teams trust it enough not to route around it."
Eight lines that carry the round
- "A dashboard reports scores. A gate makes a decision, with an owner, a threshold and a record."
- "Thirty apps, twenty releases, five thousand cases: three million executions a day."
- "Δ against a pinned baseline for quality, and absolute floors where a regression is never acceptable."
- "Missing evidence blocks. Thin evidence holds. Nothing passes by default."
- "Quality cannot buy its way past the safety floor."
- "The grader is part of the release logic, so it is versioned and calibrated like code."
- "An aggregate pass rate can hide a failing slice. Critical slices pass on their own."
- "Model quality is not the same as application quality."
Quick Recall: Lines to Say in the Interview
- "Can this change ship? That question has an owner, a threshold and a record."
- "600 candidate evaluations a day, 3 million executions, 278 to 694 calls a second in a six-hour window."
- "The control plane decides and the data plane executes, so a noisy runner can't make policy nondeterministic."
- "I cache immutable inputs, not the stochastic judgement."
- "Quality is judged on the lower bound of the delta; safety, latency and cost on absolute envelopes."
- "A critical slice too small to decide holds instead of passing."
- "The grader is advisory until it agrees with humans on the cases that drive decisions."
- "Anything feeding the decision fails closed; dashboards may degrade."
- "A gate nobody trusts gets bypassed, so I prove it on one app first."
Technical deep dives
The goal: the mechanisms behind the follow-ups: records and writes, the decision code, the lower bound, the incident, the neighbouring prompts, the threat model and the eval bill.
30-Second Cheat Sheet
- Four immutable records:
EvalArtifact,EvalCase,EvalRun,EvalResult. Status only moves forward; results are written once; corrections supersede. - Write contract: idempotency keys, explicit contract versions, and ETags with
If-Match→412 Precondition Failed, not 409. - Decision function: four checks (quality lower bound, safety, p95 latency, cost),
allowonly when all pass; a quality win can't hide a safety regression. - Lower bound: paired bootstrap with 2,000 resamples; judge the 5th percentile, not the point estimate. Small slices make the bound wide.
- Incident: 96.7% on 120 cases, 6 regulated-claim cases at 83.3%, unsupported claims 8.6% vs 1.2% online, verifier on warn-only.
- Neighbouring prompts: an upgrade regression is the gate run retroactively; an eval strategy is the gate built from nothing.
- Threat model: the runner is the trust boundary. Tenant separation, redaction at ingestion, grader versioning, leakage prevention.
- Eval bill: tier judges, sample the easy majority, cache only unchanged pairs, never thin the critical slices.
1. Records, Lineage and the Write Contract
- Four immutable records carry the design. Their lifecycles let an auditor reconstruct a decision a year later: which versions ran, against which baseline, under which policy, with which scores.
| Record | Purpose | Lifecycle |
|---|---|---|
EvalArtifact(id, type, version, hash) |
Names a model, prompt bundle, retrieval config, tool manifest or policy snapshot | Never mutated in place; a new version gets a new ID |
EvalCase(id, input_ref, expected, rubric, sensitivity) |
One case: input reference, expected behaviour, scoring rubric, sensitivity class | Updated by creating a new version; retired when obsolete |
EvalRun(id, candidate, baseline, status) |
One comparison of a candidate against a baseline under a policy snapshot | Status only moves forward: submitted → queued → running → one terminal state (completed, failed or blocked) |
EvalResult(run_id, case_id, scores, trace_ref) |
One case-level outcome with multidimensional scores and a trace pointer | Written once; changed only by an explicit superseding correction |
Why each rule exists
- Artifact hashes cover model, prompt, retrieval, tools and policy, so two runs claiming the same candidate can prove it.
- Case and rubric versions prevent silent benchmark drift. An edited case becomes a new version, not a quiet change to what last month's score meant.
- Each result carries: grader version, raw trace reference, score, deterministic outcomes and tenant scope.
Ownership is split on purpose
| Record | Owner |
|---|---|
EvalCase |
The evaluation program |
EvalRun |
The control plane |
EvalResult |
Written by the execution path, read by reviewers and auditors |
- The split keeps the gate from silently rewriting evidence after the fact.
- The decision record and the redacted score summary outlive the raw trace, so a shorter trace-retention policy never destroys auditability.
- A superseding record is always safer than mutating an old result.
The API surface: four endpoints
POST /v1/eval-runs: create a run.GET /v1/eval-runs/{id}: read its status and results.POST /v1/reviews: record a human review.POST /v1/release-decisions: record the decision or an override.
Three ideas that do the reliability work (trace a retried submission)
- Idempotency key. Every retryable write carries one. A client times out and resends → the platform returns the original
run_123, notrun_124. One candidate never gets two competing runs. - Explicit contract versions. A run created under policy v7 is never read under v8 semantics. A policy change creates new runs; it doesn't reinterpret old ones.
- ETag on reviews and decisions. A writer sends the ETag back in an
If-Matchheader. Two actors finalise the same run → the first succeeds, the second gets412 Precondition Failedand must re-read. RFC 9110 specifies 412, not 409, for a failedIf-Match.
Idempotency key = a key that makes a repeated request return the original result instead of doing the work twice. ETag = a version tag returned with a record.
- An override is always a new superseding record, never an invisible overwrite.
2. The Decision Function in Code
- The smallest code path that proves the design. It:
- Validates typed input at the boundary.
- Injects the statistical comparison as a seam (a replaceable component, so the bootstrap can be tested or swapped).
- Returns every individual check with the verdict, not just a boolean.
def release_decision(candidate: Mapping[str, Any], baseline: Mapping[str, Any], policy: Mapping[str, Any], comparator: Comparator) -> Decision:
candidate_metrics = _parse_candidate(candidate)
_ = _parse_candidate(baseline)
policy_obj = _parse_policy(policy)
delta = comparator.compare(candidate, baseline, bootstrap_samples=2000)
checks = {
"quality": delta.quality_lower_bound >= -policy_obj.max_quality_drop,
"safety": candidate_metrics.safety_rate >= policy_obj.min_safety_rate,
"latency": candidate_metrics.p95_latency_ms <= policy_obj.max_p95_ms,
"cost": candidate_metrics.cost_per_case <= policy_obj.max_cost,
}
return Decision(allow=all(checks.values()), checks=checks, delta=delta)
Read it line by line
- Both candidate and baseline are parsed. A malformed metric such as
"safety_rate": "high"raisesValidationErrorbefore any policy logic runs. - The baseline's parsed value is discarded (
_): only its validity matters here; the comparator reads both raw inputs. - Quality is the only relative check: the lower bound of the delta vs the allowed drop.
- Safety, latency and cost are absolute envelopes on the candidate.
allowis true only when all four pass. Thechecksmap tells a reviewer which one failed.
The test policy and the invariant
policy-7 field |
Value |
|---|---|
max_quality_drop |
0.01 |
min_safety_rate |
0.95 |
max_p95_ms |
250 |
max_cost |
0.20 |
baseline = Score(quality=0.90, safety_rate=0.999)
def test_quality_win_cannot_hide_safety_regression():
candidate = scores(quality=0.95, safety_rate=0.97)
assert not release_decision(candidate, baseline, policy(min_safety_rate=0.995)).allow
- Caveat: the test is an excerpt. It omits the
comparatorargument the signature requires, so a runnable version passes a stub comparator. - The candidate is five points better on quality (0.95 vs 0.90).
- Its safety rate 0.97 is below the 0.995 floor this test sets →
checks["safety"]is false → refused.
Soundbite: "A more persuasive release cannot ship below the safety floor."
What wraps it in production
- A missing result returns block before this function runs.
- Each critical slice is evaluated with its own thresholds and minimum size.
3. Statistical Honesty: Judging Quality on a Lower Bound
Caveat: the source asks for "a bootstrapped lower confidence bound for the delta" without spelling out the procedure. This section explains the standard technique; its numbers are illustrative.
Why a bound
- A rubric score on 5,000 cases has noise: rerun the suite or draw slightly different cases and the mean moves.
- The bootstrap estimates that noise from the data itself.
Bootstrap = resample your own data with replacement many times to see how much a statistic wobbles.
The procedure
- Take the per-case deltas. Candidate and baseline must be scored on the same cases, so each pair cancels case difficulty.
- 2,000 times (the
bootstrap_samples=2000in the code), draw a new sample of the same size with replacement and compute its mean delta. - The spread of those 2,000 means shows how far the true delta could plausibly sit from the observed one.
- A low percentile, for example the 5th, is the lower bound.
- Repeated trials: resample whole cases with all their trials together. Trials of one case are correlated; resampling them separately makes the bound look narrower than it is.
Same point estimate, different decision
| Rubric | Observed Δ | 5th-percentile bound | vs max_quality_drop 0.01 |
Decision |
|---|---|---|---|---|
| Noisy | +0.004 | −0.015 | Below −0.01 | Fails quality: the gain is indistinguishable from noise |
| Stable | +0.004 | −0.002 | Above −0.01 | Passes |
- The certainty differs, so the decision differs. That's what "no overstating tiny differences" means in practice.
Small slices make the bound wide
- Six regulated-claim cases can't produce a tight bound on anything.
- A percentile bootstrap on six cases is itself unreliable.
- That's one reason the gate needs a minimum slice size and holds when a critical slice is too small to decide.
4. Incident: Aggregate Success, Slice Failure
- The sales-copilot incident proves an aggregate pass rate can hide a critical slice. It's the slice step failing in production.
What happened
- A sales copilot drafts account-specific outreach emails from CRM notes, product documentation and approved messaging.
- Its model route was upgraded to improve fluency and personalisation.
- After the upgrade, emails sounded polished but included unsupported claims:
- "SOC 2 Type II renewal completed in June 2026": not yet approved for external use.
- "average 34% support cost reduction": an ROI claim from an internal pilot only.
CRM = customer relationship management, the sales system of record (such as Salesforce). ROI = return on investment.
- Workflow: CRM account context → approved claims retriever → prompt template → LLM gateway → policy evaluator → offline eval suite → online quality monitor.
- The gate checked grammar, tone and general groundedness on 120 examples. Only 6 were about regulated claims.
The six signals
| Signal | Value | What it means |
|---|---|---|
| Online unsupported-claim rate | 8.6% vs a 1.2% baseline, sample size 430 | Production regressed badly |
| External claim policy failures | 37, severity high | The failures are the dangerous kind |
Release gate, eval_v14 |
120 cases, 96.7% pass, release_gate=pass |
The aggregate looked healthy |
| Regulated-claim slice | 6 cases, 83.3% pass | The critical slice was tiny and already failing |
| Missing cases | security_cert_pending, roi_internal_only, customer_logo_permission |
The suite never tested the real risk |
| Claim verifier | policy_action=should_block actual_action=warn_only |
The runtime backstop was switched off |
The arithmetic (how small the warning was)
- 37 / 430 ≈ 8.6%.
- 96.7% of 120 = 116 passing cases.
- 83.3% of 6 = five passing: a single failure in the slice that mattered.
- Averaged over 120, that one failure barely moved the aggregate.
Two changes landed together: 2026-07-08 at 09:00
- The router moved drafting from
llm_standard_v2tollm_premium_v3after an offline eval showed better fluency. - The policy evaluator moved from block mode to warn-only during the experiment, to reduce false positives.
Root cause
- An evaluation and launch-gate failure, not a model outage. "The model is creative" doesn't explain it.
- The suite over-measured writing quality and under-measured unsupported business claims.
- The upgrade increased persuasive extrapolation, and warn-only let the risky drafts through.
Debug it
- Compare offline pass rates with online failure modes.
- Inspect failing drafts.
- Retrieve the claims each draft used.
- Verify those claims' approval metadata.
- Segment failures by model route and policy mode.
- Name the gate flaw aloud: a high aggregate pass rate can hide failure on a small but critical slice.
Fixes
| Horizon | Fix |
|---|---|
| Immediate | Roll back to llm_standard_v2; restore policy-evaluator block mode for external claims; add review banners to drafts generated during the experiment |
| Long term | Claim-level eval suite with labelled approval status; slice-based release gates; zero critical failures required for regulated claims; unsupported-claim rate monitored online; negative examples where the model must refuse internal-only claims |
- The stakes: legal exposure, customer trust damage and compliance issues. A careless or malicious rep could prompt the assistant to exaggerate ROI or security status and send the draft externally.
Where the anchor gate would have caught it
- A per-application threshold on the regulated-claim slice fails at 83.3%.
- The coverage metric flags a critical slice with 6 cases as below the minimum sample → the gate holds.
- A policy change from block to warn-only is itself a versioned artifact, so it goes through the gate, not around it.
Weak vs strong answer
- Weak: "The model is too creative. I would make the prompt stricter and ask sales reps to review the output."
Spoken answer (strong): "The failure is an eval and launch-gate problem. The suite passed at 96.7%, but it had only six regulated-claim cases and the online unsupported-claim rate jumped to 8.6%. I would roll back the model route, restore blocking for external claims, add claim-level evals for security, ROI, and customer-logo claims, and require critical slices to pass independently before release."
5. Two Neighbouring Prompts, One Gate
- Two common practice prompts (the source labels them OpenAI-style) are the anchor seen from a different moment:
- Upgrade regression = the gate applied after the fact.
- Evaluation strategy = the gate built from nothing.
5.1 The Model Got Worse After an Upgrade
- A customer says quality declined after switching to a newer model. Treat it as the release decision that never happened, and run it retroactively.
The nine-step diagnostic plan:
- Collect before-and-after production examples.
- Replay a fixed evaluation set.
- Segment by task, language, customer and input size.
- Compare structured-output compliance.
- Check prompt compatibility and retrieval changes.
- Compare latency and token usage.
- Run human evaluation, calibrating any LLM-as-judge first.
- Roll back or pin the model version.
- A/B test future upgrades.
How each step maps onto the anchor:
| Diagnostic step | Anchor component |
|---|---|
| Pin the version | Artifact registry |
| Replay a fixed set against the old model | Δ against a pinned baseline |
| Segment | Slice-based gating |
| Calibrate the judge | Grader calibration |
| A/B test future upgrades | Online sampling pipeline plus a randomised traffic split, so both versions see comparable users |
- The permanent fix: model upgrades become candidates that pass through the gate.
Follow-up: "the offline benchmark improved, but the customer still says quality declined." Seven explanations, each a gate weakness:
| Explanation | The gate weakness it points at |
|---|---|
| The benchmark doesn't represent production traffic | Stale or unrepresentative golden set |
| A specific customer segment regressed | Aggregate gate, no slices |
| Retrieval quality changed | Retrieval config not pinned as an artifact |
| The user experience became slower | No latency gate |
| Structured output became less reliable | No deterministic schema check |
| The model improved average quality but worsened important edge cases | Mean-based decision on a tail-risk product |
| Users judge task completion rather than answer quality | Model quality measured instead of application quality |
5.2 Build an Evaluation Strategy From Nothing
- A customer wants to deploy an assistant but has no reliable way to measure quality. The source lists fourteen items.
| Seven that build the measurement | Seven that keep it honest over time |
|---|---|
| Representative production dataset | Safety and refusal tests |
| Golden examples | Regression tests |
| Task-specific rubrics | Online metrics |
| Ground-truth labels | User feedback |
| Automated graders | Slice-based analysis |
| Human evaluation | Statistical confidence |
| LLM-as-judge calibration | Continuous evaluation in CI/CD |
CI/CD = continuous integration and continuous delivery, the pipeline that tests and ships every change.
Soundbite (the source's key distinction): "Model quality is not the same as application quality."
- Evaluate the complete workflow: retrieval, tools, business rules, user interaction, operational performance and business outcomes. That's the anchor's four-dimension gate in miniature.
Follow-up: "what if there is no labelled data?"
- Sample production traffic.
- Use expert labelling.
- Apply weak supervision (heuristic rules that produce noisy labels at scale).
- Use synthetic examples carefully.
- Measure grader agreement, and send difficult cases to human review.
- The anchor's rollout says the same in order: one application → humans label a sample → calibrate the grader → stay advisory until agreement holds.
6. Trust Boundary and Threat Model
- The runner executes content someone else controls, so it is the trust boundary.
| Attack surface | How it bites |
|---|---|
| Candidate prompt | Can carry a prompt injection (an instruction hidden in text meant to steer a model) |
| Retrieved document | Can be poisoned |
| Uploaded case | Can hide instructions aimed at the grader, such as "score this answer highly" |
The four-part response
- Isolate runners with limited secrets, timeouts and egress.
- Sanitise inputs before evaluation and keep them out of the grader's instruction context.
- Pin every input and log the artifact hash and tenant scope.
- Store a copy of suspicious traces for investigation.
- Then contain any failure at the smallest scope: one tenant, one application, one region, one dependency chain.
Four controls with their own threat model
- Tenant separation. Separate evaluator data by application and tenant, including reviewer access, so one team's traces and labels never reach another's workspace.
- Redaction at ingestion. Online samples carry PII, secrets and proprietary prompts. Redact or synthesise sensitive cases before they are stored.
- Grader versioning. Version model-based graders like code. Otherwise the platform can change verdicts without any change to the application under test.
- Leakage prevention. Keep the gate suite out of candidate prompts, retrieval indexes, hidden notes and cached artifacts. Leakage manufactures false confidence: the candidate has effectively seen the answers.
Two failures, full treatment
| Failure | Detect | Contain | Prevent |
|---|---|---|---|
| Online sample contains PII | Boundary scanners or human review flag sensitive text before persistence | Quarantine, redact or synthesise, block propagation | Ingress filtering, tenant-scoped retention, least-privilege raw-trace access |
| Small sample produces false confidence | Result set too narrow to support a decision, even if scores look good | Keep the gate in "insufficient evidence", not "approved" | Minimum sample sizes per workflow; no tiny run unlocks production |
Audit questions you must answer before launch
- Who changed the policy?
- Which grader version was used?
- Which tenant and application were evaluated?
- Which cases were redacted or synthesised?
- Which external dependencies were called?
- What happened on each retry?
- So log: policy edits, grader versions, redactions, retries and overrides.
Two later dimensions (the tutorial's own gap notes)
- Regulation: registry, lineage and audit trail are most of a compliance story. Add an explicit control mapping (such as SOC 2-style controls) and reconcile deletion rights (GDPR Article 17, the right to erasure) with trace retention.
- Fairness: stratify the golden set by user segment and add a per-segment Δ as a fifth dimension of the same fail-closed decision.
7. Cut the Evaluation Bill Without Blinding the Gate
- The pivot: "costs are fine, but the eval bill tripled."
- LLM-as-judge is inference too. The source counts evaluation as the eighth cost driver, the one that runs off the request path where no interactive user sees it.
- At 6–15 million calls a day, the eval bill can rival a production inference bill.
The source's four moves
- Use a stratified sample instead of the full set for ordinary changes.
- Use a cheaper judge, with a periodic strong-judge audit.
- Run deltas only on changed prompts or models.
- Cache judge calls on unchanged pairs.
Tiering ties them together
| Tier | When it runs | Judge |
|---|---|---|
| Smoke sample | Ordinary changes | Cheap judge on easy cases |
| Full release-relevant suite | Gate time | Failures and disagreements escalate |
| Deep audit | High-risk changes | Strong judge or a human |
The self-drill card
| Card field | Answer |
|---|---|
| Dominant driver | Batch and evaluation pipeline spend: LLM-as-judge over the full suite on every change |
| Cheapest lever first | Sample the suite for smoke tests; cheap judge first, strong judge only on failures and disagreements; cache judged pairs by prompt version; full suite only at the release gate |
| Metric that proves it | Eval cost per release; judge agreement rate; time to gate; regressions caught per dollar |
| Do not | Run the full strong-judge suite on every commit |
| 60-second line | A gate nobody can afford gets bypassed. Tier the judges, sample on every change, run the full suite only where a release decision is made. |
The risk the source names alongside the fix
- Weak coverage misses regressions, as the sales-copilot incident shows.
- Cut cost by sampling the easy majority, never by thinning the critical slices. The regulated-claim slice runs in full on every release; the smoke tier samples the rest.
Two levers that connect cost back to the design
- Human review is almost certainly the most expensive unit cost (the tutorial's gap note), and its load often dominates marginal cost. Better grader agreement shrinks the human-review tail, so calibration lowers spend without weakening the gate.
- The judge cache is safe only on unchanged pairs. Key it on every input that could change the verdict:
- The case.
- The hash of the exact output being judged.
- The grader model and its version.
- The rubric hash.
- Repeated trials and calibration runs never read from the cache. Reusing a verdict is a decision to stop re-measuring that pair (the stochastic-judgement caveat from sizing).
Prove the savings
- Measure cost per release, decision time, grader agreement, escape rate, flaky-case rate and override rate.
- A cheaper gate that lets more regressions escape isn't cheaper.
Four verbs, in order
- Measure eval spend per release and per tier first.
- Route cases to a cheap judge; escalate only disagreements.
- Bound the full suite to the release gate.
- Cache safely, keyed on every version that could change the verdict.
8. References
- Supporting: Miller 2024, Adding Error Bars to Evals (paired comparisons, clustered errors); SciPy bootstrap documentation (percentile intervals, paired resampling); scikit-learn Cohen's kappa (chance-corrected agreement).
- Fact-check sources, checked on 27 September 2026:
| Source | Supports |
|---|---|
| RFC 9110 HTTP Semantics, sections 13.1.1 (If-Match) and 15.5.13 (412) | A failed If-Match returns 412 Precondition Failed, not 409 |
| Zheng et al. 2023, Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena | LLM judges show verbosity bias |
| AICPA & CIMA: SOC 2 | SOC 2 control mapping |
| GDPR Article 17: Right to erasure | Deletion rights that trace retention must respect |
| V2 chapter 9 tutorial, "My Perspective on the Gaps" | Human review as the most expensive unit cost (internal course source, no public link) |
Quick Recall: Lines to Say in the Interview
- "Results are written once; an override is a new superseding record, never an overwrite."
- "A resend with the same idempotency key returns run_123, not run_124."
- "A failed If-Match is 412, not 409."
- "Quality is the only relative check; safety, latency and cost are absolute envelopes."
- "Same +0.004, different bound, different decision."
- "One failure in six regulated cases barely moved a 120-case aggregate."
- "Switching the verifier to warn-only is a versioned change, so it goes through the gate."
- "An upgrade regression is the release decision that never happened, run retroactively."
- "Sample the easy majority, never the critical slices."
Quick review
One sentence: build a decision record around pinned evidence. Sandbox the run, score it with calibrated graders and deterministic checks, gate four independent dimensions plus critical slices, and hold or block when evidence is untrustworthy.
30-Second Cheat Sheet
- Ask first: critical apps and slices, release window, label and rubric owners, sensitive traces, block vs hold, who may override.
- Size: 30 × 20 × 5,000 = 3M executions/day, 6–15M calls/day, 278–694 calls/s in six hours.
- Pin everything and compare with the current production baseline on quality, safety, p95 latency and cost.
- Safety floor and critical slices pass independently of the aggregate.
- Missing evidence blocks; thin or disputed evidence holds.
- Grader: versioned, calibrated against humans before it becomes a hard gate.
- Incident: 96.7% on 120 cases hid six regulated cases at 83.3%.
- Cost: tier the judges and sample the easy majority. Never thin the highest-risk slice.
1. Ask, Draw and Size
Ask first
- Which apps and slices are critical?
- What is the release window?
- Who owns labels and rubrics?
- Which traces are sensitive?
- What blocks versus holds?
- Who may override?
Whiteboard path
Release request → pinned artifact + baseline → versioned suites → sandbox runners → deterministic checks + calibrated LLM grader → validated results → policy delta → pass / block / hold → online feedback
- LLM graders score; deterministic policy and authorised humans decide.
Numbers
| Item | Value |
|---|---|
| Executions | 30 apps × 20 candidates/day × 5,000 cases = 3M/day |
| Calls | 2–5 per case → 6–15M/day |
| Six-hour window | ≈ 278–694 calls/s |
| Workers | 112–278 at 2.5 calls/s, before headroom |
| Controls | Tier suites; quota the shared worker pool |
| At 10x | Storage, retention and human-review routing dominate |
2. Gate Rules, Incident and Cost
Gate rules
- Pin model, prompt, retrieval, tool, policy, dataset and rubric versions.
- Compare the candidate with the current production baseline on quality, safety, p95 latency and cost.
- Safety floor and every critical slice pass independently of the aggregate.
- Missing evidence blocks; thin or disputed evidence holds.
- Calibrate the versioned LLM grader against humans before making it a hard gate.
Failure policy
| Condition | Response |
|---|---|
| Grader timeout or evidence-store outage | Block |
| Delayed dashboard | Degrade, if the decision record is durable |
| Write conflict | Retry idempotent writes |
| Persistent failure | Dead-letter to human review |
| Bad canary, unchecked severe incident, untrustworthy scoring | Roll back |
Incident to cite: the sales copilot
- 96.7% pass on 120 cases.
- Only six regulated-claim cases, passing at 83.3%.
- Unsupported claims 8.6% online versus 1.2% baseline.
- Claim policy switched to warn-only.
- Fix: roll back the route, restore blocking, add claim-level critical-slice coverage, and version the policy mode.
Cost close
- Sample easy cases for smoke.
- Cheap judge first, then strong-judge or human escalation.
- Run full critical suites at release.
- Cache only unchanged pairs.
- Don't thin the highest-risk slice.
Sixty-second close: "I build a decision record around pinned evidence. The runner executes the application in a sandbox, calibrated graders and deterministic checks score it, and policy compares four independent dimensions with critical-slice gates. The platform holds or blocks when evidence is untrustworthy, then learns from production escapes."
3. Key Takeaways
| Topic | Takeaway |
|---|---|
| The ask | A controlled release decision for four stakeholders with four different questions, not a dashboard of scores |
| Requirements | Stated so a test can fail them, each owned by a component, and six things fenced out of the first version |
| Sizing | Thirty apps, twenty releases and five thousand cases make three million executions a day; the peak release window, not the daily average, sizes the pool |
| Planes | The control plane decides and the data plane executes, so a noisy runner can never make the policy nondeterministic |
| Baseline | Every input pinned, every result a delta against a pinned baseline, records immutable, monotonic and write-once |
| Decision | Quality, safety, latency and cost checked separately; quality judged on a lower bound; quality never hides a safety drop |
| Grader | Release logic: versioned, calibrated against humans, advisory until agreement holds |
| Slices | Critical slices pass on their own, because an aggregate pass rate can hide the failure the business fears |
| Incident | Passed at 96.7% with six regulated-claim cases while production ran 8.6% unsupported claims |
| Neighbours | A post-upgrade regression is the gate run retroactively; an evaluation strategy is the gate built from nothing |
| Failure policy | Missing evidence blocks, thin evidence holds, dashboards degrade while the gate keeps its record |
| Rollout | Trust earned on one application first, then graders, then latency and cost gates, then a shared schema |
| Delivery | The fifty minutes go mostly to evaluation design, closed by the two-minute answer |
| Cost | The eval bill falls by tiering judges and sampling the easy majority, never by thinning the critical slices |
Flashcard Drill
Quick Recall: Lines to Say in the Interview
- "Who may override, and how is that recorded?"
- "LLM graders score; deterministic policy and authorised humans decide."
- "Three million executions a day, 278 to 694 calls a second in a six-hour window."
- "The safety floor and every critical slice pass on their own."
- "Missing evidence blocks; thin or disputed evidence holds."
- "96.7% on 120 cases, six regulated cases at 83.3%, 8.6% unsupported claims in production."
- "Version the policy mode, so warn-only can't bypass the gate."
- "Sample the easy majority; never thin the highest-risk slice."
Where next
- Practise this as a worksheet
- Evaluation and Release Gating
- Revise the concepts