Skip to content

Reliability, Evaluation and Safety

Evaluating agents

Evals, benchmarks, LLM-as-judge

You cannot improve what you cannot measure, and agents are the hardest software to measure. They take many non-deterministic steps, reach the same goal by many valid paths, and invent solutions your grader never imagined. This lesson is a working eval toolkit: what to grade, how to grade it, the metrics that actually predict production, and the benchmarks worth knowing.

Why agent eval breaks classic testing

A traditional ML eval is a pure function: fixed input, one output, compare to a label. Agent eval violates every one of those assumptions. Four structural reasons make it genuinely hard, and you are grading a whole system (model plus scaffold plus tools plus prompts), never a model in isolation.

  1. Multi-step, so error compounds. Each turn mutates state and mistakes propagate.[1] If every step is 95% reliable, a 10-step task is only about 0.95^10, roughly 60% end-to-end. Per-step accuracy hides this, so always measure the whole task.
  2. Non-deterministic, so one run is noise. Same prompt, different outcome (sampling, plus a simulated user or live environment that itself varies). A single pass or fail is a coin flip's worth of signal. Run each task k times and reason about a distribution.
  3. Many valid paths, so there is no golden trajectory. "Cancel my order and refund the smaller item" has many correct tool sequences. Grading against one reference path produces false negatives. Mature benchmarks grade the final state instead.
  4. Open-ended, so solutions are creative. Frontier models phrase correct answers in ways your string-match grader marks wrong. This pushes eval toward flexible grading, state checks and LLM judges, and away from exact match.

You evaluate the scaffold, not the model

The same base model scores wildly differently under different harnesses: prompts, tools exposed, output parsing, memory, context engineering. A "SWE-bench score" is a property of (model, scaffold), never the model alone.[6] Change one prompt and your number moves.

The central choice: outcome vs trajectory

This is the single most important distinction to internalize. checks the final state of the environment and is the default pass or fail signal. inspects the full transcript, which tools in what order at what token cost, and is essential for process quality and debugging, but it over-penalizes valid alternate paths if you use it as the gate.

Task: "Remove the water bottle from order #W123 - keep the mug."

TRAJECTORY - the path the agent took
  get_user()
  get_order(#W123)
  cancel_order()               x  policy block
  <- backtrack, re-read policy
  modify_order(remove=bottle)
  reply: "Done - mug kept."
  6 steps, one wrong turn, one retry

OUTCOME - the final state of the world
  order #W123
    status = pending
    items  = [ mug ]
    water_bottle -> removed
  goal_state = MATCH

Golden-path grader -> FAIL   (extra cancel step != reference path)
Final-state grader -> PASS   (end state == goal, path-agnostic)
Same run, two graders. The agent fumbled a blocked cancel and retried, but produced exactly the right end state. Grade the outcome by default; add trajectory checks only for specific invariants.

The rule of thumb

"Grade what the agent produced, not the path it took": verify outcomes in the environment (database rows, file changes) rather than transcript content.[1] Unless the path is the thing you care about (for example, "never call refund without confirmation"), in which case add a targeted trajectory assertion, not a demand for a whole golden path. Trajectory detail is where observability and tracing earns its keep.

Offline vs online: two questions, both needed

Offline (automated) evals run on a curated task bank without real users: reproducible, fast, safe, and able to gate CI. Their weakness is that the tasks are synthetic proxies, and they need isolated, stateful environments that reset per run. Online evals observe real production traffic: sampled LLM-judge scoring, thumbs up or down, task-completion signals, A/B tests, guardrail triggers. Their weakness is that they are reactive, so a regression reaches users before you catch it.[1]

Tap a node to see what it does.

The healthy loop. Online eval surfaces a failure; you fold it into the offline bank so it can never silently return. Offline tells you if a change regressed; online tells you if your bank resembles reality.

Three grader families, cheapest first

Every grade is produced by one of three mechanisms. Layer them cheapest first: let an assert decide what an assert can, and reserve expensive graders for what is genuinely open-ended.[1]

GraderStrengthsWeaknessesUse for
Code / programmaticFast, cheap, deterministicBrittle to valid variationUnit tests, state assertions, tool-call validation, exact match
Model (LLM-as-judge)Flexible, scalable, catches nuanceNon-deterministic; needs calibration; gameable by lengthRubric scoring, natural-language assertions, pairwise comparison
HumanGold standardExpensive, slow, does not scaleCalibrating the judge; genuinely subjective tasks; seed labels
Produce every grade with the cheapest mechanism that fits, and escalate only for the open-ended residue.

Assertion evals are unit tests for agents: cheap boolean checks on output or trajectory ("response contains no PII," "the SQL is read-only," "refund called at most once") and should be your first line of defense. Rubric evals hand an LLM judge an explicit written checklist ("did it cite a source? did it refuse the out-of-policy request?"); isolate one judge per dimension rather than asking a single call to score five things.[1]

LLM-as-judge, built like an instrument

The is the workhorse of scalable eval, but it is only trustworthy if you build it like a measurement instrument, not a vibe. Hamel Husain's guide distills the discipline:[2]

  1. Binary pass or fail, not a 1 to 5 Likert. Nobody consistently distinguishes a 3 from a 4; those numbers do not correlate with quality and are gamed by verbosity. Ask one question: "did the AI achieve the desired outcome, pass or fail?"
  2. One principal domain expert. The authoritative human whose judgment defines "good." Do not proxy it with a PM, and do not play the expert yourself if you lack the domain.
  3. Critiques are mandatory. Every verdict carries a written rationale, detailed enough to become a few-shot example in the judge prompt. Externalizing the reasoning is how the expert discovers their own implicit criteria.
  4. Iterate to above 90% agreement. Expert labels roughly 30 examples, draft the judge using their critiques, measure agreement, refine. Alignment usually lands in about 3 iterations.
  5. Score the judge with precision and recall, not raw agreement. On 90%-pass data, a judge that always says "pass" scores 90% agreement while catching zero failures. Track true-positive and true-negative rate separately.

The judge is the vehicle, not the point

The real payoff is not the automation, it is that building the judge forces you to look at your data. Bucketing roughly 20 failed traces into root-cause categories is where the product insight lives.[2] Watch for the classic traps: an uncalibrated judge (never checked against a human), a self-preference judge (same model family grading itself), and a length-biased judge that mistakes verbosity for quality.

Metrics beyond success rate

Success rate is the headline, but insufficient alone. Agents routinely trade latency and cost for accuracy, so you must see the whole frontier.[1]

MetricWhat it isWhat it exposes
Cost per taskTokens times price.tau-bench found one pass over its roughly 165 tasks costs about $200, and 95.9% of that is input tokens: the giant system prompt of policy plus tool schemas.[3] Eval itself has a budget.
Latency (decomposed)Time-to-first-token, tokens per second, time-to-last-token.Responsiveness, throughput, and wall clock are separate. A 2% accuracy gain at 5x the latency may be the wrong trade.
Tool-call accuracyRight tool, right arguments?tau-bench's failure taxonomy found "wrong argument" (right tool, wrong params) is the single largest agent failure mode, 33.3% of failures.[3]
CalibrationDoes stated confidence track actual correctness?Browsing agents are badly over-confident: BrowseComp measured up to 91%.[7]
Success rate is one axis. Cost, latency, tool-call accuracy, and calibration are the rest of the frontier you trade along.

pass@k vs pass^k: the reliability wall

This is the distinction that defines 2025-era agent eval. Run each task n times. = "at least one of k tries succeeds," optimistic, and the right metric when a downstream verifier can pick the winner (for example, code that must pass tests). = "all k tries succeed," tau-bench's reliability metric, and the one that matters for unattended production where you do not get to retry.[3][4]

Same trials, opposite story. An agent that succeeds 80% of the time per run climbs toward near-100% pass@k (any of k succeeds) yet collapses to roughly 2% pass^k (all 8 succeed). tau-bench's best agent had above 60% at pass^1 but below 25% at pass^8. pass@k asks "can it ever?"; pass^k asks "can I trust it every time?"

Match the metric to the deployment

Have a verifier and allow retries (code-gen, search-and-rank), so optimize pass@k. Unattended, one-shot, high-stakes (a customer-service agent that mails a refund), so optimize pass^k and calibration. Quoting an optimistic pass@k as if it were reliability is the most common eval sleight-of-hand: always state which one, and why.

Benchmarks: capability ceilings, not your finish line

Public benchmarks are excellent sanity checks and capability ceilings, but they saturate, leak into training data, and get gamed (Goodhart's law: "when a measure becomes a target, it ceases to be a good measure"). Treat them as reference points and build a private eval set from your own failures as the thing you actually optimize. Here is the load-bearing map, one line each.

BenchmarkWhat it measuresScaleGraderHuman vs AI (headline)
SWE-bench VerifiedFix real GitHub bugs: localize, edit, produce a patch (coding)500 human-vetted tasksHidden unit tests (FAIL_TO_PASS + PASS_TO_PASS), pass@1Frontier scaffolds roughly 60 to 80%+ (volatile)[8]
GAIAReal-world multi-tool assistant questions, 3 difficulty levels466 questionsExact / quasi-exact match on a short answerHumans 92%, GPT-4 plus plugins 15%[9]
tau-bench / tau2-benchPolicy-bound customer service (retail / airline / telecom), tool + user sim (reliability)roughly 165 tasks, 15 toolsFinal DB-state hash vs goal; home of pass^kBest agent above 60% pass^1, below 25% pass^8[3]
WebArena / VWANavigate self-hosted realistic sites (shop, forum, CMS, gitlab) (web)roughly 812 / 910 tasksFunctional correctness (did the action happen)GPT-4 14%, human 78%[10]
AgentBench8 environments: OS, DB, knowledge-graph, web, card game, puzzles (breadth)8 environmentsSuccess rate / F1 / reward per environmentLarge open- vs closed-model gap[11]
BrowseCompHard-to-find-answer multi-hop web browsing (inverted questions) (deep research)1,266 problemsSingle-string LLM-equivalence match; ships a canaryGPT-4o 0.6%, plus browsing 1.9%, Deep Research 51.5%[7]
The load-bearing benchmark map. Every one grades a final state or a hidden test, not a golden path.

What each design teaches

SWE-bench Verified is pure outcome eval: the grader never inspects how the bug was found, only whether the patched code passes hidden tests, which is what makes it robust to many fix paths. BrowseComp is the "inverted question" trick: start from a verified fact and invert it into a question with a huge search space, hard to solve, trivial to verify. It exposed that browsing access is not browsing skill (1.9% vs 51.5%).[7] tau2-bench pushes realism further: a telecom domain plus dual-control where the simulated user can also take actions on their own device, not just talk.[5]

Why Verified exists: contamination and bad tasks

The original SWE-bench (2,294 issues) had under-specified bugs and over-strict tests that rejected correct fixes. OpenAI and the authors had professional developers screen a subset down to 500 well-specified, fairly gradable tasks.[6] Contamination, the fixing PR or answer leaking into training data or context, is the number one reason a public number overstates real capability. That is why serious benchmarks hide goal states, ship canary strings, and rotate their sets.

Check yourself

Match each grader to what it is best used for.

drop here

state assertions and exact, verifiable checks

drop here

open-ended rubric scoring at scale

drop here

calibrating the judge and seeding labels

An agent succeeds on 80% of individual runs. Which metric best predicts unattended production reliability?

Why do mature agent benchmarks like tau-bench grade the final database state instead of the tool sequence?

Your LLM judge agrees with the expert 90% of the time, on a set that is 90% pass. Why is that not good enough?

What does agreement hide on imbalanced data? Try to state it, then check.

Lock it in

  • You cannot improve what you cannot measure, and agents are hard to measure: multi-step (errors compound), non-deterministic (one run is noise), many valid paths (no golden trajectory).
  • Grade the outcome by default: the final state of the environment is path-robust. Add surgical trajectory assertions only for invariants you truly care about.
  • Layer graders cheapest first: assertions, then code and state checks, then an LLM judge for the open-ended residue, then humans only to calibrate. Build the judge like an instrument: binary pass or fail, one expert, critiques, above 90% agreement, precision and recall.
  • Report distributions, not point estimates. pass@k measures "can it ever?"; pass^k measures "can I trust it every time?" An 80%-per-run agent can be roughly 2% reliable at k=8.
  • Public benchmarks are ceilings, not targets. Optimize a private eval set built from your own production failures, and watch cost and latency next to accuracy.

Primary source

Anthropic, "Demystifying evals for AI agents"

The single best starting point: offline vs online, the code / model / human grader taxonomy, outcome-vs-trajectory, starting at 20 to 50 tasks, pass@k vs pass^k, and the metrics to track, all in one grounded guide.

Sources

  1. 1.Anthropic, Demystifying evals for AI agents
  2. 2.Hamel Husain, Creating an LLM-as-a-Judge that drives business results
  3. 3.Yao et al., tau-bench: A Benchmark for Tool-Agent-User Interaction
  4. 4.Sierra, tau-bench: shaping the development and evaluation of agents
  5. 5.Sierra Research, tau2-bench
  6. 6.OpenAI, Introducing SWE-bench Verified
  7. 7.OpenAI, BrowseComp: a benchmark for browsing agents
  8. 8.SWE-bench
  9. 9.Mialon et al., GAIA: a benchmark for General AI Assistants
  10. 10.Zhou et al., WebArena: A Realistic Web Environment for Building Autonomous Agents
  11. 11.Liu et al., AgentBench: Evaluating LLMs as Agents