🎓 Claude Certification Prep

Home › CCDV-P › M05

Evaluation Engineering and Quality Assurance

Domain 5 12% of exam 48 practice questions ~18 min read

Design offline evaluation systems that gate releases, keep suites valid over time, engineer calibrated LLM-as-judge evaluators, and measure quality on live production traffic.

Skills measured in this domain:
  • Evaluation System Design: golden sets, regression suites, behavioral checks, CI/CD gates, retrieval precision and groundedness, release criteria; contamination and saturation
  • LLM-as-Judge Engineering: calibration against human labels, rubrics, bias and position effects, inter-rater reliability, judge drift
  • Online Quality Measurement: live-traffic sampling, A/B testing, feedback loops, metrics by task type

Domain overview

Domain 5 "Evaluation Engineering and Quality Assurance" accounts for 12% of the score (about 7 of the 60 scored items). The Exam Guide groups three skill areas:

  • Offline evaluation: golden sets, regression suites, behavioral checks, CI/CD evaluation gates, retrieval precision and groundedness metrics, release criteria for prompt, model, and agent changes, and maintaining suite validity against contamination, saturation, and coverage gaps.
  • LLM-as-judge: calibration against human labels, rubric design, bias and position effects, inter-rater reliability, and judge drift across model versions.
  • Online measurement: live-traffic sampling, A/B testing, feedback loops, and metric selection matched to task type (extraction, generation, agentic, retrieval-grounded).

Items usually present evidence (agreement rates, pass rates, CI logs) and ask for the correct next step. The correct answer is almost always to re-measure and fix the root cause, not to lower the threshold or switch to a larger model.

Offline evaluation system design

Core vocabulary

From the article "Demystifying evals for AI agents":

  • Task (test case): an input plus success criteria.
  • Trial: one run of a task. Outputs vary, so you need multiple trials.
  • Grader: scores one aspect using assertions ("checks"). A task can have several graders.
  • Transcript (trace): the full record of tool calls, reasoning, and intermediate results.
  • Outcome: the final state of the environment. The agent saying "booking confirmed" is not enough; the booking record must actually exist in the database.
  • Agent harness (scaffold): when you evaluate an agent, you measure the harness + model together.

Three types of grader

Grader type Examples Strengths Weaknesses
Code-based string match, fail-to-pass/pass-to-pass unit tests, static analysis, outcome checks, tool-call checks Fast, cheap, objective, reproducible Brittle against valid variations
Model-based (LLM-as-judge) rubric, natural-language assertions, pairwise comparison, reference-based, multi-judge consensus Flexible, can grade free-form text Non-deterministic, more expensive, must be calibrated against human graders
Human subject matter expert (SME) review, spot-checks, A/B testing, inter-annotator agreement Gold standard Expensive, slow

Principle: choose the fastest method that is still reliable and scalable: code for exact fields, a judge where two different answers can both be correct, and humans where judgment is required. Scores can be combined by weighting (threshold), binary (every grader must pass), or hybrid.

Golden sets, regression suites, behavioral checks

A golden set is a set of cases with human-written answers. For example, Meridian stores golden.json, where each record has an id, a category, and the expected value for each field. Rules:

  • Write the answers before any model runs, so the answers are not "anchored" to model output.
  • Start with 20–50 cases drawn from real failures (bug tracker, support queue), prioritized by user impact.
  • Stratify edge cases by production share: if scanned reports are 5% of traffic, they should be about 5% of the cases.
  • Unambiguous tasks: two independent experts reach the same verdict, and a reference solution exists. 0% pass@100 usually signals a broken task, not a weak agent.

A behavioral check measures behavior and needs a balanced case set covering both situations where the agent should act and where it should not. For web search, for example, you must measure both unnecessary calls (overtriggering) and missed calls (undertriggering) to avoid class imbalance. The sample YAML in the Demystifying article for a coding task combines deterministic_tests, llm_rubric, static_analysis, state_check, and tool_calls. A regression suite must stay close to a 100% pass rate.

Retrieval and groundedness metrics

  • Retrieval recall. The Contextual Retrieval article uses 1 − recall@20, the share of relevant documents that do not make it into the top-20 chunks. Contextual Embeddings + Contextual BM25 cut this rate from 5.7% to 2.9%; adding reranking brings it to 1.9%.
  • Answer precision/recall/F1. The agentic search cookbook uses a model-as-judge F1 grader: the grader lists which gold items were found and which extra items appeared.
  • Groundedness check. Every claim must be supported by the retrieved sources. It is paired with a coverage check (all key facts present) and a source quality check.

Exam trap

"Grade the entire response" sounds more thorough but is wrong. Grade the final answer (for example, the <result> tag). Feeding the planning portion into the grader increases both false positives and false negatives. Likewise, grade the outcome, not the path: a valid solution that differs from the reference solution must still count as correct.

CI/CD evaluation gates and release criteria

The Introduction to evals course (lesson 04) splits gating into three tiers:

  1. Smoke eval on every PR. For example, 10 of 50 cases covering every category, run on Claude Haiku 4.5, about 1 minute, threshold 88% (9/10). The pipeline runs, grades, comments, then fails the check. The check must be required in branch protection: "without it a red X is just a warning".
  2. Full suite when the prompt or model changes. Run through the Message Batches API with a custom_id such as r041_claude-haiku-4-5, and read request_counts.
  3. Nightly grading of live traffic (see the online section).

The AI-native SDLC playbook (lesson 09) adds three points. First, run evals on a schedule and whenever CLAUDE.md, a Skill, or a hook changes, because configuration changes must also pass the gate. Second, every production incident produces an eval. Third, the workflow runs claude -p, deletes evals/ from the checkout, and grades from a copy made before the run, so the agent cannot modify the checks.

Release criteria must be written down as numbers before you compare:

  • The accuracy floor follows from the cost of a wrong answer. If you can only afford to hand-check 5 of 50 reports a month (10%), the floor is 90%; if one error costs $1,000, the floor is 100%.
  • Keep cases and prompts fixed so that only one variable changes.
  • Anthropic's April 23 postmortem shows what happens when a suite is too narrow. A system prompt line limiting length went through "multiple weeks of internal testing and no regressions in the set of evaluations we ran". A later ablation (removing prompt lines one at a time) on a broader eval set revealed a 3% drop on Opus 4.6 and 4.7. The new measures: a broad per-model suite for every system prompt change, gating changes against the exact target model, and soak periods and gradual rollout for changes that may trade off intelligence.

Key point

A gate is only a gate if it can block a merge (a required check). A smoke eval covering every case category runs on each PR; the full suite runs when the prompt, model, or agent configuration changes. Every incident must become a new case.

Maintaining suite validity: contamination, saturation, coverage gaps

Saturation

An eval at 100% still catches regressions but no longer signals improvement. Near saturation, large improvements show up only as small score gains. SWE-bench Verified went from 40% to over 80% in about a year. Qodo was initially unimpressed by Opus 4.5 because its one-shot evals could not measure the gains on long tasks, so it built a new agentic eval. The article's rule: "do not take eval scores at face value until someone digs into the details", and read the transcripts.

Contamination

Contamination is when answer information or state from elsewhere leaks into the run being measured. The source names three forms:

  • Shared state between trials. Claude once read the git history of a previous trial and gained an unfair advantage. Each trial needs a clean, isolated environment; shared resources also break trial independence.
  • The agent can read the checks. This is why the playbook deletes evals/ from the checkout.
  • Overfitting while hill-climbing a prompt. /claude-api hillclimb keeps a held-out split and repeats the baseline to get a noise bar.

Coverage gaps and grader bugs

A suite measures only what it contains; the postmortem case above is a textbook coverage gap. Add cases from incidents and from responses graded as failing on live traffic. Graders have bugs too: on CORE-Bench, Opus 4.5's score rose from 42% to 95% just from fixing the grader (it had marked "96.12" wrong against "96.124991…"). Graders must also resist being "hacked" by the agent.

Exam trap

A pass rate that jumps, or every candidate passing, does not mean "the model got better". Suspect saturation, state leakage, or a grader bug, and read the transcripts before acting. Conversely, 0% across many trials usually means a broken task or grader.

Capability evals, regression evals, and variance

Criterion Capability eval Regression eval
Question How well does the agent do this? Can it still do everything it used to do?
Expected pass rate Low at first, a "hill to climb" Close to 100%
Used for Feature development, model comparison Every change, in CI
Lifecycle Cases that pass reliably "graduate" to regression Add cases from incidents

pass@k and pass^k

  • pass@k: the probability of at least one success in k attempts; it rises with k. It fits when one correct solution is enough, although for coding pass@1 still matters most.
  • pass^k: the probability that all k attempts succeed; it falls with k. It fits customer-facing agents, where consistent behavior is required.
  • Example: with a 75% per-trial success rate, pass^3 = 0.75³ ≈ 42%. At k = 1 the two metrics are equal. By k = 10, pass@k approaches 100% while pass^k approaches 0%.

Sample size and variance

  • Early on, changes have large effects, so a few cases are enough; a mature agent needs larger evals to detect small effects.
  • Run each configuration multiple times. The evals course runs every setup at least twice: a schedule_status failure that passed on rerun was due to non-determinism. The cost optimization cookbook recommends about 50 cases and at least 5 trials per configuration.
  • Infrastructure noise (the Infrastructure noise article). On Terminal-Bench 2.0, resource configuration produced a 6-percentage-point spread; the binomial confidence interval alone is 1–2 points wide. Differences under 3 points therefore deserve skepticism until configurations are documented and matched.

Key point

The metric must match the product expectation: "one correct attempt is enough" means pass@k; "it must be right every time" means pass^k. A number without the trial count and a noise bar is not a sufficient basis for a release.

LLM-as-judge engineering

Rubric design

  • Separate inputs with XML tags. The document, the answer, and the rubric each get their own tag. The rubric must be detailed and state clearly what counts as correct and what counts as incorrect.
  • Force the verdict into a countable form. Use structured outputs with a {explanation, verdict} schema, where verdict ∈ correct | incorrect | unknown. unknown is the "escape hatch"; without it, the judge is forced to guess.
  • Require reasoning before the score. The Building with the Claude API course asks for strengths, weaknesses, and reasoning before the score; otherwise the model will "tend to default to middling scores around 6".
  • One isolated judge per dimension. Use a rubric structured by dimension, with a separate judge per dimension, instead of one judge grading everything.

Calibration against human labels and inter-rater reliability

  1. Test the judge on cases that code can also grade. Meridian tested on 30 answers whose expected value is null; the judge agreed with code 10/10 for each model.
  2. Hand-grade a sample and compare it with the verdicts. Where they disagree, clarify the rubric and rerun.
  3. Reconcile disagreements between human raters. Humans also disagree with each other (inter-rater disagreement), so you must reconcile before treating the labels as ground truth. You can measure inter-annotator agreement.
  4. Recalibrate periodically. Descript uses an LLM grader with periodic human calibration.

Agreement rates must be read against chance level. For a two-choice pairwise verdict, a judge guessing at random already agrees about half the time, so "slightly more than 50%" is nearly worthless. Chance-corrected agreement statistics (such as Cohen's kappa) serve exactly this purpose; the sources in this repo do not set a specific threshold.

Judge bias

  • Position bias: a pairwise judge picks the response shown first far more often than humans do. Fix: swap or randomize the order (grade both A-B and B-A), re-measure agreement against human labels, and withdraw gating authority until agreement is acceptable.
  • Verbosity: models tend to write long by default. The rubric must define what earns points so that length does not "score" on its own, and only the extracted answer should be graded.
  • Self-preference: grade with a different model from the one that wrote the output. The agentic search cookbook pins GRADER_MODEL regardless of the model being measured, because "Grading with the model under test makes scores incomparable across models".

Pairwise or single-score

Criterion Pairwise (A vs B) Single-score / absolute verdict
Question Which response is better? Does this response meet the rubric, and what score does it get?
Fits Comparing two prompts/models when there is no absolute answer Threshold-based gating, trend tracking
Risks Position bias; you do not know whether either response meets the bar Drifts to middle scores without reasoning; scale drift
Controls Swap order, measure agreement with humans Detailed rubric, unknown, reasoning before the score

Judge drift across model versions

A judge is a model, so changing the judge version changes the measuring instrument. Pin the judge model when comparing candidates. When you must upgrade the judge, recalibrate it against human labels before giving it gating authority. Do not compare the new judge's scores with a baseline graded by the old judge.

Key point

Before a judge gets gating authority you need all three: a rubric with an unknown escape hatch, agreement with human labels well above chance, and a pinned judge version that differs from the model being measured.

Scenario example

A pairwise judge gates prompt changes. For three months every candidate "wins", but CSAT does not move. Logs show the judge agrees with expert labels on about 55% of pairs and picks the response shown first in over 70% of pairs; humans pick it about 50% of the time. The right move: grade each pair in both orders, re-measure agreement on the labeled set, fix the rubric, and suspend the judge's gating authority until it reaches the threshold. Switching to an absolute scale, using a larger judge, or lowering the threshold does not address the evidence about ordering and agreement.

Exam trap

"Use a more capable judge model" is a common distractor. A stronger but uncalibrated judge can still be biased, and changing the judge also makes previous scores non-comparable.

Online quality measurement

Live-traffic sampling and drift alerts

Lesson 04 of the evals course describes a nightly grading process:

  • Sample 1–5% of traffic.
  • Grade with an LLM judge that needs no expected answer, because live traffic has no labels; read a portion of the responses yourself as well.
  • Alert when the score falls below the trailing baseline − 2 standard deviations.
  • Turn every response graded as failing into a new case.

Drift is accuracy declining gradually as inputs change while CI stays green. The playbook (lesson 13) uses a mean ± σ control band on an hourly 30-day baseline, plus Western Electric rules: 4 of 5 points above 1σ, or 8 consecutive points above the mean.

The Swiss Cheese Model: no single layer is enough

Method Strengths Weaknesses
Automated eval Fast, reproducible, runs on every commit Creates false confidence if it does not match real usage
Production monitoring Real behavior at scale Reactive, noisy, lacks ground truth
A/B testing Measures real outcomes (retention, task completion) Slow (days to weeks), needs traffic, only tests deployed changes
User feedback (thumbs-down) Surfaces unanticipated problems Sparse, self-selected, skewed toward severe failures
Transcript review Explains the "why" Does not scale
Systematic human studies Gold standard, used to calibrate LLM graders Expensive, disagreements must be reconciled

How to combine them: automated evals before launch and on every change or model upgrade; monitoring after launch to catch drift; A/B tests for major changes when traffic allows; weekly transcript sampling. Before fully switching to a new configuration, run it in shadow on a slice of traffic.

Feedback loops

User feedback is sparse and skewed, but valuable for finding failures. In the postmortem, it was /feedback reports with reproducible examples that helped locate the bug, while internal evals initially could not reproduce it. The standard loop is: signal → reproduce → add a case → fix → gate. Two metrics worth tracking are "time from incident to eval" (leading) and "regressions caught in CI vs. regressions that reached production" (lagging).

Metric selection by task type

Task type Primary grader Suggested metrics
Extraction Code matching each field (including null) Accuracy by field and case category, cost per completed task
Generation Calibrated per-dimension LLM rubric; pairwise when comparing two versions Rubric pass rate, position-bias-corrected win rate
Agentic Outcome/state checks, tool calls, transcripts; an LLM simulating the user for conversations pass@k / pass^k, n_turns, n_toolcalls, tokens, latency
Retrieval-grounded Retrieval metrics + groundedness/coverage judge recall@k, precision/recall/F1, share of claims with a source

Scenario example

A customer-support agent's regression suite passes at 98% in CI for two months. Meanwhile the thumbs-down rate climbs slowly, and the nightly score on 2% of traffic sits below the trailing baseline − 2σ for three nights in a row. This is drift: real inputs have diverged from the case set. The right move: read the responses graded as failing, group them by failure type, add them to the suite in production proportions, fix the prompt, and rerun. Upgrading the model or silencing the alert because "CI is still green" both ignore the cause.

Exam tip

"Evals pass but users see no improvement" points to judge bias or a coverage gap. "CI is green but production keeps getting worse" points to drift and live-traffic sampling.

(Sources: CCDV-P Exam Guide, Domain 5, Sample Question 2; Anthropic Engineering: Demystifying evals for AI agents; Anthropic Engineering: Infrastructure noise in agentic coding evals; Anthropic Engineering: An update on Claude Code quality reports; Anthropic Engineering: Contextual retrieval in AI systems; Anthropic Academy: Introduction to evals; Anthropic Academy: The AI-native SDLC playbook — Continuous evals in CI, Closing the loop on metrics; Claude Cookbooks: Reproducing Claude's Agentic Search Benchmark Scores)

Quick summary

  • Three grader types: code (fast, objective, brittle), model (flexible, needs calibration), human (gold standard, expensive).
  • Golden set: write answers before any model runs, 20–50 cases from real failures, stratify edge cases by production share.
  • Capability evals start low and "graduate" into the regression suite; regression stays near 100%.
  • pass@k rises with k, pass^k falls with k; 0.75³ ≈ 42%.
  • Run multiple trials per configuration; differences under 3 points on agentic evals deserve skepticism.
  • A CI gate only works when it is a required check.
  • Prevent contamination: isolated trials, delete evals/ from the checkout, keep a held-out split when hill-climbing.
  • Saturation: an eval at 100% no longer signals improvement; you need harder tasks and transcript review.
  • Judge rubric: XML tags, structured output with unknown, reasoning before the score, one judge per dimension.
  • Judge calibration: test on code-gradable cases, hand-grade a sample, compare agreement against chance.
  • Position bias: swap order, re-measure agreement, withdraw gating authority until agreement is acceptable.
  • The judge must differ from the model that wrote the output and be version-pinned; changing the judge requires recalibration.
  • Online: sample 1–5% of traffic, alert below trailing baseline − 2σ, turn responses graded as failing into new cases.
  • Retrieval-grounded: recall@k, precision/recall/F1, groundedness; grade only the final answer.