What you will be able to do
- Explain why one Claude application needs several metrics, and name the failure each metric catches that the others miss
- Choose the accuracy metric that fits the output: exact match or F1 for fixed labels, cosine similarity for consistency, ROUGE-L for summaries checked against references
- Write a latency criterion that names its clock (time to first token, total response time or end-to-end task time) and uses a percentile rather than a mean
- Turn cost, safety and security goals into computed rates with pass/fail thresholds, including a checkable definition of a successful attack
Key concept
Multidimensional success criteria — A Claude application passes only when it meets a separate, computable threshold on each dimension it is judged on, such as accuracy, latency, cost, safety and security. A single score can't do this, because a system can do well on one dimension while failing another.
1.Why one metric never certifies a Claude system
An evaluation metric is a number computed from a model's outputs on a test set and compared against a threshold. It tells you whether a prompt, model or configuration is ready to ship. You need it because "the model should classify sentiments well" can't be checked. "F1 of at least 0.85 on 10,000 held-out posts" can. The success criteria themselves are agreed during discovery (Measurable success criteria). Here the job is the next step: turning each criterion into a formula that a script can compute on every run.
Each metric is blind to some kind of failure. A classifier can label every ticket correctly and still take too long for a live chat. It can be fast and correct but cost more per ticket than the process it replaces. It can be fast, correct and cheap but answer in toxic language now and then. Or it can pass on every ordinary input and still leak details it was told to keep private. That is why the reference example of a good criterion is several thresholds on one held-out set, not one number: an F1 of at least 0.85, 99.5% non-toxic outputs, 90% of errors being an inconvenience rather than egregious, and 95% of responses under 200ms.
| Dimension | Computable metric with threshold | Failure only this dimension catches |
|---|---|---|
| Accuracy | F1 score of at least 0.85 on a held-out test set; exact-match accuracy | Wrong answers delivered quickly, cheaply and politely |
| Latency | 95% of response times under 200ms | Correct answers that arrive too late for a real-time user |
| Cost | Cost per task or per classification against a budget or baseline | A configuration that is accurate and fast but too expensive to run at the expected volume |
| Safety | Less than 0.1% of 10,000 trials flagged for toxicity by the content filter | Correct content in harmful or inappropriate language |
| Security | Share of test inputs where the model uses or shares details it was told to keep private | An application that behaves on ordinary input but is turned against its own instructions |
For agents, the dimensions also stack inside a single task. Each check on an agent's work is a grader: logic that scores one aspect of its performance. A support agent's task can count as solved only if the ticket is resolved (a state check, which inspects the environment after the run), the conversation finished in under 10 turns (a transcript constraint, a limit on what the conversation log may contain, such as the number of turns), and the tone was appropriate (an LLM rubric, a model scoring the output against written criteria). You also choose how a task's grader scores combine. Weighted scoring passes when the combined score clears a threshold. Binary scoring requires every grader to pass. A hybrid mixes the two.
Checkpoint 1 of 9· Match them up
A support-ticket classifier has failed in production. Match each failure to the metric dimension that would have caught it before launch.
Tap a term, then the definition that fits it.
Each metric misses some kind of failure, so each of these systems would pass the other four checks. That is why a release needs its own computable threshold on every dimension, not one overall score.
“Most use cases need multidimensional evaluation along several success criteria.”Source: platform.claude.com
2.Matching the accuracy metric to the shape of the output
"Accuracy" is not one metric. The right one depends on what a correct output looks like, so start with the output's shape. When the answer comes from a fixed set of labels, such as five ticket categories or positive/negative/neutral/mixed sentiment, correctness is binary, and code can grade it without any judgement. Exact match compares the output with the labelled answer after normalising whitespace and case. Accuracy is the share of matches. When the classes are imbalanced or some errors matter more than others, precision, recall and F1 from the same comparisons tell you more than raw accuracy.
def evaluate_exact_match(model_output, correct_answer):
return model_output.strip().lower() == correct_answer.lower()
outputs = [
get_completion(
f"Classify this as 'positive', 'negative', 'neutral', or 'mixed': {tweet['text']}"
)
for tweet in tweets
]
accuracy = sum(
evaluate_exact_match(output, tweet["sentiment"])
for output, tweet in zip(outputs, tweets)
) / len(tweets)
print(f"Sentiment Analysis Accuracy: {accuracy * 100}%")Free-form text breaks exact match, because two good summaries almost never match character for character. For summarisation against reference summaries, use ROUGE-L. It measures the length of the longest common subsequence shared by the model's summary and the reference, so it rewards both overlapping content and the order in which ideas appear. A typical test set is a few hundred articles, each with a reference summary.
Consistency is a separate question from correctness. If a user asks the same thing twice in different words, they should get answers that mean the same thing. To measure this, encode the outputs for groups of paraphrased questions with a sentence-embedding model and compute cosine similarity. Values near 1 mean the answers agree. This metric says nothing about whether the answers are right: a model that gives the same wrong label to every paraphrase scores perfectly.
Some qualities, such as coherence, tone or translation quality, have no reference you can match against. For these, use a qualitative scale applied the same way every time: a Likert prompt such as "Rate coherence from 1 (nonsensical) to 5 (perfectly logical)", scored by an LLM grader or by experts with a rubric. Don't use one on a categorical task. Asking a second model to rate how well a label "matches" adds cost and non-determinism to a check that string comparison settles exactly.
| Output shape | Metric | What a high score means |
|---|---|---|
| One label from a fixed set | Exact-match accuracy; precision, recall, F1 | The predicted label equals the human label |
| Summary with a reference | ROUGE-L | Key information from the reference appears in a coherent order |
| Answers to paraphrased versions of one question | Cosine similarity of sentence embeddings | Answers are semantically consistent (not necessarily correct) |
| Open-ended quality with no reference | Likert scale or expert rubric | Graders consistently rate the output highly on the defined criterion |
Checkpoint 2 of 9· Check yourself
Your team ran 50 groups of paraphrased questions through a ticket classifier that picks one of five categories. The answers within each group have a mean cosine similarity of 0.98, and a teammate says this shows the classifier is accurate enough to ship. What is the right conclusion?
Cosine similarity across paraphrases measures whether the answers agree with each other. A classifier that gives the same wrong label to every paraphrase would still score near 1. Fixed-label output is graded with exact match or F1 against the labels, not with ROUGE-L or a Likert-scale LLM grader.
“It's ideal for evaluating consistency because similar questions should yield semantically similar answers, even if the wording varies.”Source: platform.claude.com
Checkpoint 3 of 9· Exam question
A fintech company built an automated support-ticket triage system that assigns each incoming ticket to exactly one of five fixed categories (billing, fraud, account access, technical issue, other). The team wants to measure how well the model performs this core categorization task using a labeled test set of 5,000 tickets, with automated, unambiguous grading. Which evaluation approach should the team use?
Correct answer: A — Score each output against the labeled category using exact-match accuracy or an F1 score computed from the confusion matrix
- A. Correct. For a task with fixed, categorical labels and a large labeled test set, exact-match accuracy or F1 gives simple, unambiguous, scalable automated grading with no false positives or negatives.
- B. Cosine similarity measures whether semantically similar inputs produce similar outputs; it does not check whether a categorization matches a ground-truth label.
- C. ROUGE-L measures overlap between generated and reference free text (e.g., summaries), not correctness of a discrete category assignment.
- D. Likert-scale grading is suited to subjective qualities like tone; a categorical task with ground-truth labels doesn't need subjective scoring and loses the precision of exact-match grading.
Checkpoint 4 of 9· Exam question
A documentation team built a tool that condenses long internal incident reports into short summaries. They have 200 incident reports paired with human-written reference summaries and want an automated metric that captures both the overlap of key information and the ordering of ideas between the model's summary and the reference. Which metric is best suited to this evaluation?
Correct answer: A — ROUGE-L score measuring the longest common subsequence between the model's summary and the reference summary
- A. Correct. ROUGE-L's longest-common-subsequence measure captures both information overlap and the relative ordering of key points between a generated summary and a reference.
- B. Exact-match scoring would mark nearly every valid summary as wrong, since free-text summaries rarely match a reference character-for-character.
- C. Cosine similarity across repeated generations measures consistency, not how well a single summary matches a human reference.
- D. A PII classifier is a safety/privacy check, not a measure of information overlap or ordering against a reference summary.
Sources1
3.Latency: name the clock and the percentile
A latency target means nothing until you say when the clock starts and when it stops. A Claude system has three clocks worth separating, and they can move independently:
- Time to first token (TTFT) runs from sending the prompt to receiving the first token of the response. It is what a user notices when responses are streamed, because text starts appearing even while generation continues.
- Total response time runs until the last token arrives. An agent eval records it as
time_to_last_token, alongsideoutput_tokens_per_sec. This is the clock that matters when nothing downstream can act until the full output has been parsed, such as a classifier whose label sits at the end of its reasoning. - End-to-end task time covers a whole agent run across many turns and tool calls. It grows with
n_turnsandn_toolcallseven when each individual call is fast.
tracked_metrics:
- type: transcript
metrics:
- n_turns
- n_toolcalls
- n_total_tokens
- type: latency
metrics:
- time_to_first_token
- output_tokens_per_sec
- time_to_last_tokenThe clocks pull against each other, so an SLA that names none of them can be met while users still complain. Streaming improves TTFT but leaves total response time unchanged. Telling an agent that time matters and showing it the elapsed time cut run time by 7% to 47% in Anthropic's tests, at the cost of a few points of score. That trade is visible only if task time and accuracy are both being measured.
Write the threshold as a percentile. "95% of responses under 200ms" puts the budget and the allowed exceptions in a single sentence: 5% of turns may run slow during a spike, and the rest may not. A mean can't express that. A month of 150ms average can hide a fifth of voice turns stalling, and one extreme outlier can push an otherwise healthy average over its target. Average output token count and requests per minute are not latency metrics at all. The first measures response size and the second measures capacity. Pick the percentile and the budget from the application's real-time requirements: a voice turn and an overnight batch job are not held to the same number.
Checkpoint 5 of 9· Fill the gap
A ticket classifier runs with stream=False, and its label comes at the end of its reasoning, so the router can't act until the whole response has arrived. The team wants its eval to track the latency clock that users of this router actually wait on. Which metric fills the blank?
tracked_metrics:
- type: transcript
metrics:
- n_turns
- n_toolcalls
- n_total_tokens
- type: latency
metrics:
- time_to_first_token
- output_tokens_per_sec
- ? This output isn't streamed, and nothing can use the label until the full output has been parsed. So the clock that matters is total response time, which the eval records as time_to_last_token. TTFT stops at the first token. n_turns describes the transcript and output_tokens_per_sec is a generation rate, so neither of those is the wait this router sees.
Source: www.anthropic.comCheckpoint 6 of 9· Exam question
A voice-based customer service agent needs to feel responsive in real time. The team defines a success criterion stating that the vast majority of user turns must receive a response within a strict time budget, while still tolerating occasional slower responses during traffic spikes. Which latency metric definition best matches this success criterion?
Correct answer: A — The 95th-percentile response time across production queries, with a target such as 95% of responses under 200ms
- A. Correct. A percentile-based target (e.g., p95) directly captures 'the vast majority of turns are fast' while explicitly tolerating a small tail of slower responses, matching the stated criterion.
- B. A monthly average can hide a large share of slow responses behind many fast ones, so it doesn't guarantee that most individual turns meet the time budget.
- C. Output token count relates to response length and indirectly to latency, but it is not itself a measurement of response time against a budget.
- D. Requests-per-minute measures throughput and capacity, not how quickly any individual user turn is answered.
4.Cost per task as a pass/fail metric
Cost should be an eval metric with a threshold, computed on the same runs as accuracy. Don't treat it as a bill you check afterwards. The unit is the task, not the token: a cheaper model that needs more turns or more retries can cost more for each problem it solves (Cost per solved task (not price per token)). The response's usage block reports input, output and cache token counts. Multiply them by the per-token prices, then divide total spend by the number of tasks in the run.
A cost threshold is relative to something. The ticket-routing example sets two thresholds side by side: 95% accuracy over 100 tests, and a 50% average reduction in cost per classification compared with the current routing method. In the insurance-claims cookbook, a baseline agent scored 10/10 at about $0.29 per task. Because a mislabelled claim costs more than the inference saved, the team kept the accuracy requirement at 10/10 and treated cost as the number to push down. A configuration that saves money but drops a case fails, however cheap it is.
Model outputs are non-deterministic, so the same configuration can produce a different pass rate and a different cost per task on the next run. Run many trials and judge the threshold against the distribution, not one sample.
Checkpoint 7 of 9· Check yourself
An insurance-claims agent's baseline scores 10/10 on its eval at about $0.29 per task. The team will not accept less than 10/10, and wants to lower cost. Three candidate configurations ran on the same eval. Which one passes?
Cost is compared per completed task, with the accuracy threshold held fixed. X has the cheapest tokens but costs more per task because it takes more turns. Y saves money but misses a case, so it fails however cheap it is. Z is the only one that keeps 10/10 and comes in under the baseline's cost per task.
“That means that as we optimize, we'll look to achieve less than ~$0.29/task while getting all 10 eval cases correct.”Source: platform.claude.com
5.Quantifying safety and security as checkable rates
"The assistant should be safe" is a hope, not a criterion. Even fuzzy goals like ethics and safety can be expressed as rates: the share of outputs, over a stated number of trials, that a stated detector flags. A good safety criterion names three things: the detector (a content filter), the sample size (10,000 trials) and the ceiling (fewer than 0.1% flagged). Severity needs the same treatment. "90% of errors would cause inconvenience, not egregious error" is computable only once you have written down what counts as inconvenient and what counts as egregious.
A security metric is computed the same way. The difference is that you first have to define what counts as a successful attack, specifically enough that code or a grader can decide it. Start from the threat model, because there are two. In jailbreaks and direct prompt injection, the user is the adversary and writes inputs meant to get around your guardrails. In indirect prompt injection, the user is trusted, but Claude reads third-party content (web pages, emails, documents, tool results) that contains adversarial instructions. Each one needs its own adversarial test set and its own success condition. The metric is then the attack success rate: the share of attack attempts that meet that condition.
Write success conditions as observable outcomes, never as "the model seemed manipulated":
- A harmlessness screen is a model call that labels incoming input as harmful or not before it reaches the main conversation. Structured outputs force it to return a fixed label, such as a boolean
is_harmful, so code can compare it with the known answer. An attack succeeds when a known-harmful input comes back labelled safe. - For data handling, an attack succeeds when the output uses or shares a detail the instructions said to withhold.
- For agents, an attack succeeds when the end state shows the forbidden effect, checked against environment state rather than the transcript's wording.
The authentication-bypass task below shows the agent version. Its graders spell out what "secure" means: deterministic tests that reject empty and null passwords, a static security scan with bandit, and a state check that the security log recorded an auth_blocked event. If any of them fails, the fix fails, however convincing the agent's explanation sounds.
task:
id: "fix-auth-bypass_1"
desc: "Fix authentication bypass when password field is empty and ..."
graders:
- type: deterministic_tests
required: [test_empty_pw_rejected.py, test_null_pw_rejected.py]
- type: llm_rubric
rubric: prompts/code_quality.md
- type: static_analysis
commands: [ruff, mypy, bandit]
- type: state_check
expect:
security_logs: {event_type: "auth_blocked"}Checkpoint 8 of 9· Fill the gap
An agent's auth-bypass fix should count as secure only if the environment shows the attack was actually blocked. A convincing explanation in the transcript must not be enough. Which grader type completes this task?
task:
id: "fix-auth-bypass_1"
desc: "Fix authentication bypass when password field is empty and ..."
graders:
- type: deterministic_tests
required: [test_empty_pw_rejected.py, test_null_pw_rejected.py]
- type: llm_rubric
rubric: prompts/code_quality.md
- type: static_analysis
commands: [ruff, mypy, bandit]
- type: ?
expect:
security_logs: {event_type: "auth_blocked"}For agents, a security success condition is checked against the environment's end state, not against what the transcript says. The state_check grader passes only if the security log actually recorded an auth_blocked event. An LLM rubric judges how the work reads, and transcript metrics count turns and tokens. Neither one shows that the attack was blocked.
Source: www.anthropic.comCheckpoint 9 of 9· Check yourself
Which of these safety criteria could an eval script check as pass/fail on every run?
A safety criterion becomes a checkable rate once it names the detector (the content filter), the sample size (10,000 trials) and the ceiling (0.1%). The first option is a hope rather than a criterion. The Likert rating sets no pass threshold. The last option has a ceiling but names neither a detector nor a sample size.
“Less than 0.1% of outputs out of 10,000 trials flagged for toxicity by the content filter”Source: platform.claude.com
Sources
(7)
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.
“achieve an F1 score of at least 0.85”
↩︎ Why one metric never certifies a Claude system“Most use cases need multidimensional evaluation along several success criteria.”
↩︎ Why one metric never certifies a Claude system“Can it follow instructions not to use or share certain details?”
↩︎ Why one metric never certifies a Claude system“Exact match evals measure whether the model's output matches a predefined correct answer, typically after normalizing whitespace and case.”
↩︎ Matching the accuracy metric to the shape of the output“Generic: Accuracy, precision, recall”
↩︎ Matching the accuracy metric to the shape of the output“It measures the length of the longest common subsequence between the candidate and reference summaries.”
↩︎ Matching the accuracy metric to the shape of the output“Rate coherence from 1 (nonsensical) to 5 (perfectly logical)”
↩︎ Matching the accuracy metric to the shape of the output“What is the acceptable response time for the model? This depends on your application's real-time requirements and user expectations.”
↩︎ Latency: name the clock and the percentile“Less than 0.1% of outputs out of 10,000 trials flagged for toxicity by the content filter.”
↩︎ Quantifying safety and security as checkable rates“90% of errors would cause inconvenience, not egregious error”
↩︎ Quantifying safety and security as checkable rates“Most use cases need multidimensional evaluation along several success criteria.”
↩︎ Key concept“It's ideal for evaluating consistency because similar questions should yield semantically similar answers, even if the wording varies.”
↩︎ Exam trap 1“95% response time < 200ms”
↩︎ Exam trap 3“Less than 0.1% of outputs out of 10,000 trials flagged for toxicity by the content filter.”
↩︎ Exam trap 5“High ROUGE-L scores indicate that the generated summary captures key information in a coherent order.”
↩︎ Prediction“It's ideal for evaluating consistency because similar questions should yield semantically similar answers, even if the wording varies.”
↩︎ Checkpoint“95% response time < 200ms”
↩︎ Prediction“Less than 0.1% of outputs out of 10,000 trials flagged for toxicity by the content filter”
↩︎ Checkpoint - 2.
“is the ticket resolved (state check), did it finish in <10 turns (transcript constraint), and was the tone appropriate (LLM rubric)?”
↩︎ Why one metric never certifies a Claude system“A grader is logic that scores some aspect of the agent’s performance.”
↩︎ Why one metric never certifies a Claude system“For each task, scoring can be weighted (combined grader scores must hit a threshold), binary (all graders must pass), or a hybrid.”
↩︎ Why one metric never certifies a Claude system“Consider a coding task where the agent must fix an authentication bypass vulnerability.”
↩︎ Quantifying safety and security as checkable rates - 3.https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-latencyOfficial docs
“It's particularly relevant when you're using streaming”
↩︎ Latency: name the clock and the percentile“This metric measures the time it takes for the model to generate the first token of the response, from when the prompt was sent.”
↩︎ Exam trap 2 - 4.https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligenceOfficial docs
“7% to 47% less time in Anthropic's tests, for a few points of score”
↩︎ Latency: name the clock and the percentile“Compare on cost per completed task, not per token”
↩︎ Exam trap 4 - 5.
“Cost per classification: 50% reduction on average (across 100 tests) from current routing method”
↩︎ Cost per task as a pass/fail metric“The method extracts usage statistics for the API call to calculate cost based on input and output tokens used.”
↩︎ Cost per task as a pass/fail metric - 6.
“we'll look to achieve less than ~$0.29/task while getting all 10 eval cases correct.”
↩︎ Cost per task as a pass/fail metric“be sure to run many parallel trials so you're making decisions based on a representative distribution rather than a single sample.”
↩︎ Cost per task as a pass/fail metric“That means that as we optimize, we'll look to achieve less than ~$0.29/task while getting all 10 eval cases correct.”
↩︎ Checkpoint - 7.https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/mitigate-jailbreaksOfficial docs
“Jailbreaks and direct prompt injection, where the user of your application is the adversary and crafts inputs intended to bypass your guardrails.”
↩︎ Quantifying safety and security as checkable rates“Indirect prompt injection, where the user is trusted but Claude processes third-party content (web pages, emails, documents, tool results) that contains adversarial instructions.”
↩︎ Quantifying safety and security as checkable rates“Use structured outputs to constrain the response to a simple classification.”
↩︎ Quantifying safety and security as checkable rates“Use a lightweight model like Claude Haiku 5.5 to pre-screen user input before it reaches your main conversation.”
↩︎ Quantifying safety and security as checkable rates