What you will be able to do
- Distinguish baseline latency from time to first token and set a percentile response-time target
- Measure cost per call from API usage data and compare options on cost per completed task
- Write quantified safety criteria and define security checks for jailbreaks, prompt injection and sensitive data
1.Latency: which clock are you measuring?
Latency is the time the model takes to process a prompt and produce an output. It depends on model size, prompt complexity and the infrastructure in between. Saying 'it should be fast' isn't enough, because the latency guide distinguishes two different measurements. Baseline latency is the time to process the prompt and generate the response, without considering input and output tokens per second, so it gives a general sense of the model's speed. Time to first token (TTFT) is the time from sending the prompt until the first token of the response appears. TTFT matters most when you stream responses and want users to see output quickly.
Checkpoint 1 of 7· Check yourself
A chat product streams Claude's replies to users, and the team wants a metric for how responsive the interface feels. Which latency measure fits best?
With streaming, users see output as soon as the first token arrives, so TTFT is the measure tied to perceived responsiveness.
“This metric measures the time it takes for the model to generate the first token of the response, from when the prompt was sent.”Source: platform.claude.com
The acceptable value depends on your application's real-time requirements and on what users expect, so write the target as a distribution rather than an average. The guide's multidimensional example requires 95% of responses in under 200ms. For agent evaluations, Anthropic's agent post tracks latency next to transcript metrics such as turns, tool calls and total tokens, so a single evaluation run records them all.
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_token2.Cost: per call, per task, against a threshold
The testing guidance asks what your budget is for running the model, and points to three factors: the cost of each API call, the size of the model, and how often it's used. To turn that into a metric, record token usage on every call. The ticket-routing evaluation does this by reading the usage statistics the API returns with each response, then calculating cost from the input and output tokens.
Checkpoint 2 of 7· Fill the gap
Which attribute of the response gives you the input and output token counts needed to calculate cost per classification?
message = client.messages.create(
model=DEFAULT_MODEL,
max_tokens=500,
messages=[{"role": "user", "content": classification_prompt}],
)
usage = message. ? # Get the usage statistics for the API call for how many input and output tokens were used.message.usage holds the input and output token counts for the call, which the guide uses to calculate the cost of each classification.
Source: platform.claude.comLike accuracy, cost needs a threshold. The routing guide's target is relative: a 50% average reduction in cost per classification, across 100 tests, compared with the current routing method.
Per-token price is an input to the metric, not the metric itself. Anthropic's cost guidance says to compare models on cost per completed task, and its agent-evaluation post notes that once you have an evaluation, cost per task can be tracked over a fixed set of tasks together with latency, token usage and error rates. That gives you regression baselines without extra work.
Checkpoint 3 of 7· Check yourself
You're choosing between two models for an agent. Which comparison does Anthropic's cost guidance recommend?
Cost per completed task includes tokens, turns and failed attempts, so it reflects what a successful result actually costs.
“Compare on cost per completed task, not per token”Source: platform.claude.com
Checkpoint 4 of 7· 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.
3.Safety: quantify the 'hazy' criteria
Safety can seem too subjective to measure, but the testing guidance treats it like any other criterion: give it a rate, a sample size and a measuring instrument. Its bad example is simply 'Safe outputs'. Its good example is: less than 0.1% of outputs, out of 10,000 trials, flagged for toxicity by the content filter. That criterion names the rate, the sample size and the tool that decides what counts as toxic.
The multidimensional criterion from the guide adds a second, severity-weighted safety target: 90% of errors should cause inconvenience rather than egregious error. The guide notes that you would also have to define 'inconvenience' and 'egregious' for your own application. Safety can also cover knowing when to stop: the customer-support guide measures whether the model escalates conversations that need a human, aiming for 95% escalation accuracy or higher.
Checkpoint 5 of 7· Check yourself
Which of these is a well-formed safety success criterion according to the testing guidance?
Only this option gives a rate, a sample size and a measuring instrument. 'Safe outputs' is the guide's own bad example.
“Less than 0.1% of outputs out of 10,000 trials flagged for toxicity by the content filter”Source: platform.claude.com
4.Security: define what an attack looks like, then check for it
These sources give no numeric security target to copy. They do provide two things you need to write one: the threats to measure against, and the kinds of checks that can detect them. The resulting criterion should follow the same specific, measurable approach as safety.
Start with the threat model. Anthropic's guardrail documentation describes jailbreaking and prompt injection as attempts to make Claude ignore its guidelines or your instructions, and splits them into two categories. In jailbreaks and direct prompt injection, the user is the adversary and crafts inputs to bypass your guardrails. In indirect prompt injection, the user is trusted, but Claude processes third-party content, such as web pages, emails, documents or tool results, that contains adversarial instructions. A security evaluation that only includes malicious user inputs misses the second category.
The testing guidance adds a data-protection dimension. Decide what a successful metric looks like for how the model handles personal or sensitive information, including whether it follows instructions not to use or share certain details.
For agents, the agent-evaluation post lists security among the static-analysis checks a code-based grader can run. Its illustrative authentication-bypass task combines a static_analysis grader running bandit with a state_check that expects an auth_blocked event in security_logs. In other words, it checks the security outcome in the environment, not only the agent's claim that it fixed the problem.
Checkpoint 6 of 7· Match them up
Match each security concept to what it means or checks
Tap a term, then the definition that fits it.
The two threat models differ in who the adversary is. The two graders check generated code and the resulting environment state.
“Indirect prompt injection, where the user is trusted but Claude processes third-party content (web pages, emails, documents, tool results) that contains adversarial instructions.”Source: platform.claude.com
Checkpoint 7 of 7· 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.
Exam traps
Each one states something that sounds right. Open it to see what is actually true.
1.Time to first token and overall response latency are the same measurement.Why is that wrong?
TTFT measures only the wait until the first token arrives, which matters most for streaming. Baseline latency covers processing the prompt and generating the response.
Covered in Latency: which clock are you measuring?
2.The model with the lowest per-token price is the cheapest choice.Why is that wrong?
Compare models on cost per completed task. A cheaper token can still cost more overall if the model needs more turns or retries to succeed.
3.Prompt-injection testing only needs adversarial inputs from users.Why is that wrong?
Indirect prompt injection comes from third-party content such as web pages, emails, documents and tool results, even when the user is trusted.
Covered in Security: define what an attack looks like, then check for it
Sources
Every claim above is drawn from one of these pages, quoted as it was written on the date shown.
- 1.https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/reduce-latencyOfficial docs
“Latency refers to the time it takes for the model to process a prompt and generate an output.”
↩︎ Latency: which clock are you measuring?“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 1“This metric measures the time it takes for the model to generate the first token of the response, from when the prompt was sent.”
↩︎ Checkpoint - 2.
“This depends on your application's real-time requirements and user expectations.”
↩︎ Latency: which clock are you measuring?“95% response time < 200ms”
↩︎ Latency: which clock are you measuring?“Consider factors like the cost for each API call, the size of the model, and the frequency of usage.”
↩︎ Cost: per call, per task, against a threshold“99.5% of outputs are non-toxic”
↩︎ Safety: quantify the 'hazy' criteria“90% of errors would cause inconvenience, not egregious error”
↩︎ Safety: quantify the 'hazy' criteria“What is a successful metric for how the model handles personal or sensitive information?”
↩︎ Security: define what an attack looks like, then check for it“Less than 0.1% of outputs out of 10,000 trials flagged for toxicity by the content filter”
↩︎ Checkpoint - 3.
“Cost per classification: 50% reduction on average (across 100 tests) from current routing method”
↩︎ Cost: per call, per task, against a threshold - 4.
“latency, token usage, cost per task, and error rates can be tracked on a static bank of tasks.”
↩︎ Cost: per call, per task, against a threshold“Static analysis (lint, type, security)”
↩︎ Security: define what an attack looks like, then check for it - 5.
“Aim for an escalation accuracy of 95% or higher.”
↩︎ Safety: quantify the 'hazy' criteria - 6.https://platform.claude.com/docs/en/test-and-evaluate/strengthen-guardrails/mitigate-jailbreaksOfficial docs
“Jailbreaking and prompt injection are attempts to make Claude ignore its guidelines or your instructions.”
↩︎ Security: define what an attack looks like, then check for it“Jailbreaks and direct prompt injection, where the user of your application is the adversary and crafts inputs intended to bypass your guardrails.”
↩︎ Security: define what an attack looks like, then check for it“Indirect prompt injection, where the user is trusted but Claude processes third-party content (web pages, emails, documents, tool results) that contains adversarial instructions.”
↩︎ Exam trap 3“Indirect prompt injection, where the user is trusted but Claude processes third-party content (web pages, emails, documents, tool results) that contains adversarial instructions.”
↩︎ Checkpoint
Also cited
- https://platform.claude.com/docs/en/about-claude/models/optimizing-for-cost-and-intelligenceOfficial docs
“Compare on cost per completed task, not per token”
↩︎ Exam trap 2“Compare on cost per completed task, not per token”
↩︎ Prediction