Search

A Practical Primer on AI Agent Evaluation — Separate Outcome From Trajectory, Start With 20 to 50 Tasks, and Feed Production Traces Back Into the Regression Suite

Tadashi Shigeoka · Tue, October 20, 2026

The question that keeps coming back when putting an AI agent into production is how to answer, concretely, what got better and what got worse with each change. Swapping the model, editing the prompt, tweaking a tool schema, or bumping the harness retry count each needs to produce a clear verdict from a reusable evaluation suite. Without that, the agent improvement loop quickly slides back into impressions and anecdotes.

The field has become easier to learn from primary sources alone in 2026. Anthropic’s “Demystifying evals for AI agents” by Mikaela Grace, Jeremy Hadfield, Rodrigo Olivares, and Jiri De Jonghe (published 2026-01-09) and Hamel Husain and Shreya Shankar’s “AI Evals: Everything You Need to Know” (also called the AI Evals FAQ, published 2026-09-18, updated 2026-09-21) now cover the design space pretty thoroughly. This post synthesizes those two with OpenAI’s agent evals guide, LangChain’s trajectory evals docs, the Google ADK evaluation guide, Braintrust’s how-to-eval article, the Arize Phoenix docs, and Eugene Yan’s “Product Evals in Three Simple Steps” into a practical set of design decisions.

How Agent Eval differs from single-turn LLM eval

Traditional single-turn LLM eval scores one prompt against one response, and lowering temperature keeps that roughly reproducible. An AI agent, in contrast, interprets a user intent, runs a multi-turn reasoning loop, calls external tools, accumulates their outputs and the environment’s state changes into its context, and decides the next action from all of that. Because of this structure, a bad assumption or a wrong argument early on propagates into every later decision, and the same task can take different tool-call paths to different results on two consecutive runs.

Anthropic frames the evaluated unit as the model plus the prompt, tool definitions, control loop (the agent harness or scaffold), and the external environment. A single run is a Trial, the full record of tool calls and reasoning is the Transcript (or Trace / Trajectory), and the environment’s final state at trial end is the Outcome. The post makes the point concrete with a flight-booking agent: what matters is not the model’s reply that “I booked it,” but whether the booking row actually exists in the database.

DimensionSingle-turn LLM evalAgent eval
Inputone prompttask + tools + environment (+ simulated user)
Outputone textfull transcript + environment final state
Graded againstfinal outputoutcome, trajectory, individual steps, quality
Non-determinismrelatively smalllarge (multiple trials required)
Infrastructuremostly unnecessaryisolated, resettable environment (sandbox)

Anthropic’s separate post “Quantifying infrastructure noise in agentic coding evals” (2026-02-05) runs Terminal-Bench 2.0 on GKE with six resource configurations and concludes that leaderboard gaps smaller than three points are “something to be skeptical about.” Agent eval is a system-level end-to-end test, and small score deltas can be washed out by configuration drift.

Score outcome and trajectory separately

Scoring only the final reply misses serious upstream faults. LangWatch’s blog walks through a returns-handling agent that, in four of six runs, failed its tool calls twice, gave up, and then told the customer to “please contact support” even though it was the support agent. A grader that reads only the final text calls those responses polite and gives them high scores.

The reverse case exists too. For example, a correct-looking final answer like “refund processed” is a serious policy violation if the agent skipped the identity-verification step.

The opposite failure mode is to require an exact match against a reference trajectory. Anthropic warns that checking for a specific sequence of tool calls is “too rigid and results in overly brittle tests,” and cites Claude Opus 4.5 finding a policy loophole on the τ²-bench airline problem that counted as a failure by the grader but produced a better outcome for the simulated user. LangChain’s agentevals package offers four trajectory-match modes (strict, unordered, subset, superset) so the only steps that demand strict ordering are the safety-critical ones, with everything else falling back to unordered match or a trajectory LLM judge.

Trajectory match modeRuleFits
strictPass only if the exact tool calls are made in exactly the reference orderMandatory ordered workflows, e.g. verify identity before executing an action
unorderedPass as long as every tool in the reference trajectory is called, order freeMulti-source information gathering where order is flexible
subsetThe agent’s calls are contained within the reference trajectory (no extra calls)Prevent latency and cost from unnecessary tool calls
supersetThe agent calls every required tool and may add moreEnforce required steps while allowing autonomous follow-up

Hamel and Shreya recommend a two-phase evaluation structure. Phase 1 (end-to-end task success) treats the agent as a black box, decides pass or fail against strict success criteria, and on failure records only the “first upstream failure.” Once a failure-heavy workflow is identified, Phase 2 (step-level diagnostics) scores tool selection, argument extraction, error handling, context retention, and efficiency as separate axes.

Use pass@k and pass^k for different reliability questions

Given non-determinism, no single-trial pass or fail should be taken at face value. Anthropic separates two metrics across repeated trials. pass@k is the probability that the agent solves the task at least once in k trials, and measures peak capability. pass^k is the probability that it succeeds on all k trials, and measures reliability. Philipp Schmid’s “Pass@k vs Pass^k” points out that an agent with a 70% per-trial success rate drops to 34.3% on pass^3 (0.7^3).

In practice, pass@k fits internal tools where retry is cheap, and pass^k fits customer-facing or financial flows where every trial has to work. Anthropic goes further: “a 0% pass rate across many trials (i.e. 0% pass@100) is most often a signal of a broken task, not an incapable agent.” Treat pass@100 = 0% as a prompt to check the task spec and the grader before blaming the model.

Three grader types and when to use each

Anthropic sorts graders into code-based, model-based, and human.

TypeExample techniquesStrengthsCaveats
Code-basedString or regex match, unit tests, static analysis, DB and filesystem state checks, tool-call and argument validation, turn and token countsFast, cheap, deterministic, reproducibleBrittle to valid alternatives, cannot measure subjective quality
Model-based (LLM-as-a-judge)Rubric scoring, natural-language assertions, pairwise comparison, reference-based evaluation, multi-judge aggregationFlexible, scales well, handles free-form output and complex trajectoriesNon-deterministic, costly, requires calibration against human labels
HumanSME review, random sampling, inter-annotator agreementGold standard; teaches the LLM judgeExpensive, slow, cannot run at high frequency

The priority is to put everything that is machine-decidable into code graders, send only the semantic quality axes to LLM judges, and escalate disagreements or high-risk samples to human review. Arize Phoenix ships Correctness, Tool Selection, and Tool Invocation as separate metrics with code evaluators and LLM evaluators kept in distinct categories, which is a clear implementation of that split.

Calibration is non-optional once an LLM judge lands in the loop. Eugene Yan argues against 1 to 5 Likert scales: use binary (Pass / Fail) for objective axes and Win / Lose / Tie for subjective comparisons. Hamel and Shreya recommend “building a separate judge for each type of failure.” Separately, giving the judge a way out with an Unknown verdict keeps it from hallucinating when the transcript does not contain the evidence it needs.

Human-labeled data gets split into train (few-shot examples), dev (prompt iteration), and test (final verification), and the judge is evaluated on the test set only after its prompt is fixed. The useful metrics are not raw agreement but true positive rate (TPR, the share of real failures the judge catches) and true negative rate (TNR, the share of clean outputs it does not falsely flag), with Cohen’s Kappa for context. On an imbalanced dataset, a judge that always answers PASS can show 90%+ agreement, so raw agreement alone is unsafe.

Eugene Yan’s sample-size arithmetic is worth internalizing. To show the defect rate is below 5%, measuring 3% defective in 200 samples gives a 95% confidence interval of 3% ± 2.4% (upper bound 5.4%), which does not clear the threshold. Only at 400 samples does 3% ± 1.7% (upper bound 4.7%) prove the point. Size the evaluation set backward from the error bar you can accept.

A practical roadmap for the first two to four weeks

Composed from the primary sources, the first two to four weeks of adopting Agent Eval converge on roughly these nine steps, Step 0 through Step 8. The numbering is this post’s own, combining several sources, and does not match the Step 0 through Step 8 in Anthropic’s post.

flowchart TD
    A[Step 0: Instrument tracing] --> B[Step 1: Collect ~100 real traces<br/>and hand-read 30<br/>open coding -> axial coding]
    B --> C[Step 2: Build 20-50 tasks from the failure taxonomy]
    C --> D[Step 3: Write unambiguous tasks with reference solutions]
    D --> E[Step 4: Balance the set with 'should' and 'should not' cases]
    E --> F[Step 5: Build an isolated, resettable eval harness]
    F --> G[Step 6: Write deterministic graders; add LLM judges only where needed]
    G --> H[Step 7: Read transcripts; audit the graders]
    H --> I[Step 8: CI regression + online eval on production traces]
    I --> C

Step 1 is the cycle’s anchor and the one Hamel and Shreya call “the most important activity in evals.” Pull about 100 diverse traces from production or internal dogfooding, read at least 30 by hand, and write free-form notes against each (open coding). For long trajectories, record only the first upstream failure. Then organize the notes into failure categories (axial coding) and keep reading until no new failure types appear (theoretical saturation). This step is one of the few where handing the work off to an LLM is counterproductive: the validity of the taxonomy has to be yours.

Step 2’s task set has to include both “should” cases (the agent should act) and “should not” cases (the agent should refuse or answer from prior knowledge). Anthropic’s Claude.ai web-search eval illustrates the risk: without a knowledge-only case like “who founded Apple?”, you can end up with an agent that searches the web for almost everything.

Step 3’s reference solution is the end-to-end walkthrough that proves the task is solvable and the graders are configured correctly. In the Terminal-Bench audit, writing reference solutions surfaced tasks whose tests assumed a file path that the task description never specified.

Step 5’s isolation is what keeps trials from contaminating each other. Leftover files, caches, and leaked git history create correlated failures and inflated scores. Anthropic reports a case where Claude looked at a previous trial’s git history and gained an unfair advantage. Standard mitigations are HTTP mocks, unique temporary directories, and Docker containers per trial.

Step 7, “read the transcripts,” is the point every source emphasizes. Before trusting a score, check whether the failed trials failed because the agent made a real mistake or because the grader rejected a valid alternative.

Step 8 separates CI and production responsibilities. The CI regression suite guards “what used to work” on every PR or model update, blocking when scores dip below threshold. In production, run online evaluations (full traffic or sampled), collect user feedback, and feed low-scoring or anomalous traces back into the offline dataset as new cases. When a capability eval saturates at high scores, graduate it into the regression suite and add harder tasks on the capability side.

Tools paired with the primary sources

The primary sources agree on not spending too much time on tool selection. Anthropic writes that frameworks are “only as good as the eval tasks you run through them.” Pick one that fits your stack quickly and spend the energy on tasks and graders.

ToolProvider / formNotable features for Agent EvalFits
OpenAI Agents SDKOpenAITracing with tool / handoff / guardrail spans; traces graded with trace grading on the OpenAI platformTeams on the OpenAI stack
PromptfooOSS (agreed in March 2026 to be acquired by OpenAI; stated it will remain open source)Declarative YAML tests, red-teaming, CI-first regressionMigrating off the old OpenAI Evals; CI-centric lightweight runs
LangSmith + agentevals / openevalsLangChainTraces, offline / online eval, trajectory match, trajectory LLM judgeTeams on LangChain / LangGraph
Google ADK evalGoogleadk eval, pytest integration, trajectory match, rubric judges, user simulationTeams building on ADK / Vertex AI
BraintrustCommercial SaaSData + Task + Scorers, online trace scoring, experiment diffsTeams that want development and production monitoring in one place
LangfuseOSS (self-hostable)Traces, datasets, evalsTeams with data-residency requirements
Arize PhoenixOSS + SaaSOpenTelemetry-based traces, separate Tool Selection and Tool Invocation metricsTeams instrumenting with OpenTelemetry
Inspect AIUK AISI and Meridian Labs, MIT licenseTask / Solver / Scorer, Docker / Kubernetes sandboxes, 200+ pre-built evals, Claude Code and Codex CLI evaluationRigorous agent evaluation, safety evaluation, research

In a notice dated 2026-06-03, OpenAI announced that its hosted Evals (dashboard, API, and graders) would become read-only on 2026-11-30, and named Promptfoo as the migration target (OpenAI Deprecations page). Vendor-hosted eval platforms can be scaled back or shut down, so when writing eval code from scratch, keep task definitions and graders in your own repo as code, and keep the runner swappable rather than locking the eval assets inside a vendor UI.

Anti-patterns to avoid

This is where the primary sources agree the most. The recurring ones:

  • Leaving ambiguous tasks or broken graders in place: Anthropic reports that on CORE-Bench, fixing rigid grading that failed 96.12 when expecting 96.124991..., ambiguous specifications, and non-reproducible stochastic tasks, together with switching to a less constrained scaffold, moved Opus 4.5 from 42% to 95%
  • Treating pass@100 = 0% as a sign of incompetence: for a frontier model this is almost always broken task definition or a broken grader, not missing capability
  • Over-fixing trajectory: valid alternatives get punished and the eval becomes brittle. Require strict ordering only on safety-critical steps and send the rest to unordered match or an LLM judge
  • One-sided evals (class imbalance): a dataset of only “should” cases trains the agent to call every tool indiscriminately
  • Leaving saturated evals in place: as with SWE-bench Verified, when scores cluster near the ceiling and models stop separating, meaningful improvements look like small deltas. Graduate saturated capability evals into regression and add harder tasks
  • Overfitting to the eval: automatic prompt optimizers hill-climb known metrics without finding new failure modes. Hamel and Shreya advise you to “inspect a few disagreements manually before trying automated prompt tuning” with algorithms such as GEPA, and warn that tuning too early means you “can miss important problems that aren’t prompt related”
  • Depending on off-the-shelf generic metrics: Hamel and Shreya write that “generic metrics like BERTScore, ROUGE, cosine similarity, etc. are not useful for evaluating LLM outputs in most AI applications,” and that generic evaluations “waste time and create false confidence” when used as quality measures. Use them as exploration signals at most
  • Not reading the transcripts: trusting the score without inspecting the underlying trial lets grader loopholes persist
  • Shared state and infrastructure noise: leaked git history or different resource ceilings shift scores. Build an isolated harness from day one
  • Eval awareness and contamination: Anthropic reports in “Eval awareness in Claude Opus 4.6’s BrowseComp performance” that Claude Opus 4.6 inferred mid-run that it was being evaluated on BrowseComp and, on 2 of 1,266 problems, read the decryption scheme from the evaluation code on GitHub and decrypted the answer key from a HuggingFace mirror. Any agent that can browse the web has to be designed under the assumption that it can reach the ground truth of public benchmarks

A minimal Agent Eval harness

The first implementation does not need a large evaluation platform. Anthropic suggests that “20-50 simple tasks drawn from real failures is a great start,” but to get the harness itself working, one agent, five to twenty tasks, two to three deterministic metrics, and one trace are enough.

Task definitions can live in YAML or JSON. Here is a simplified refund-handling example.

- id: refund-001
  input: "Please refund order #A123. The item arrived damaged."
  env_fixture: fixtures/order_A123_damaged.sql
  graders:
    - type: state_check
      expect:
        refunds: { order_id: A123, status: processed }
        tickets: { status: resolved }
    - type: tool_calls
      required:
        - { tool: verify_identity }
        - { tool: process_refund, params: { amount: "<=100" } }
    - type: llm_rubric
      assertion: "Does the response clearly state the refund reason and outcome? (PASS / FAIL / UNKNOWN)"
  max_turns: 10
- id: refund-002-negative
  input: "Refund order #B999 because I changed my mind."
  graders:
    - type: state_check
      expect:
        refunds: { order_id: B999, count: 0 }

The harness is a short Python sketch. state_check carries the outcome check and comes first, tool_calls is limited to safety-critical calls without order constraints, and the LLM judge answers one binary assertion with UNKNOWN allowed. Every transcript is saved so a human can read it later.

def run_trial(task, agent, env):
    env.reset(task.get("env_fixture"))
    transcript = agent.run(
        task["input"], tools=env.tools, max_turns=task.get("max_turns", 20)
    )
    return transcript, env.snapshot()
 
def grade(task, transcript, outcome, judge):
    results = {}
    for g in task["graders"]:
        if g["type"] == "state_check":
            results["state"] = outcome.matches(g["expect"])
        elif g["type"] == "tool_calls":
            results["tools"] = all(
                any(
                    c.name == r["tool"] and c.satisfies(r.get("params", {}))
                    for c in transcript.tool_calls
                )
                for r in g["required"]
            )
        elif g["type"] == "llm_rubric":
            verdict = judge(g["assertion"], transcript.final_text)
            results["rubric"] = (verdict == "PASS")
    return all(results.values()), results
 
def evaluate(tasks, agent, env, judge, k=5):
    report = []
    for t in tasks:
        passes = []
        for _ in range(k):
            tr, out = run_trial(t, agent, env)
            ok, _ = grade(t, tr, out, judge)
            passes.append(ok)
            save_jsonl(t["id"], tr)
        report.append({
            "id": t["id"],
            "pass_rate": sum(passes) / k,
            "pass_at_k": any(passes),
            "pass_power_k": all(passes),
        })
    return report

The CI gate is a set of per-metric thresholds (task_success >= 0.95, policy_violation == 0, and tool_calls_vs_baseline <= 1.2, meaning tool calls stay within 1.2x of the baseline) rather than one weighted aggregate score. Google’s agents-cli works the same way: you set per-metric thresholds, and eval run / eval grade exit with code 1 when a metric misses its threshold, so CI can gate on the exit code directly.

Primary sources are plentiful, so a reading order for the first ten:

  1. Demystifying evals for AI agents (Anthropic, 2026-01-09): terminology, three grader types, per-agent-type evaluation, pass@k / pass^k, and the nine-step 0-to-1 roadmap. The baseline reference
  2. AI Evals: Everything You Need to Know (Hamel Husain and Shreya Shankar, also called the AI Evals FAQ, 2026-09-18, updated 2026-09-21): error analysis, binary judges, CI versus production
  3. Using LLM-as-a-Judge For Evaluation: A Complete Guide (Hamel, October 2024, updated September 2026): critique shadowing, binary verdicts, train / dev / test splits
  4. Evaluate agent workflows (OpenAI): the trace → grader → dataset → eval run progression
  5. Evaluating Deep Agents: Our Learnings (LangChain): five patterns across bespoke per-datapoint test logic, single-step, full-turn, multi-turn, and environment setup
  6. Agent evals / trajectory evals docs (LangChain): trajectory match (strict / unordered / subset / superset) and trajectory LLM judges with concrete code
  7. How we built our multi-agent research system (Anthropic, June 2025): starting from about 20 queries, rubric-based LLM judges, and what only human evaluation catches
  8. Writing effective tools for AI agents (Anthropic, 2025-09-11): not over-tightening verifiers, collecting runtime, tool-call counts, tokens, and tool errors alongside accuracy, and holdout test sets
  9. Product Evals in Three Simple Steps and Evaluating the Effectiveness of LLM-Evaluators (Eugene Yan): the case for binary verdicts, data splits, sample size and confidence intervals, and LLM-judge biases
  10. Pass@k vs Pass^k (Philipp Schmid) and the τ-bench paper (Yao et al., 2024): intuition and definitions for reliability metrics

Supplementary reads that cover infrastructure-driven score variance and eval awareness: Anthropic’s Quantifying infrastructure noise in agentic coding evals, Eval awareness in Claude Opus 4.6’s BrowseComp performance, the Google ADK Why evaluate agents page, and Braintrust’s how-to-eval.

Translating this into your team’s cadence

Laid out by timeframe, the first things to put in place look like this.

  • This week: enable tracing, collect about 100 real interactions, hand-read 30, and build a failure taxonomy. A spreadsheet or text file is enough; no tool is needed
  • Next week: turn the top failure categories into 20 to 50 tasks, include reference solutions and “should not” cases, write code graders first for outcome checks, and send only the subjective axes to binary LLM judges
  • Wire into CI: run the regression suite on every PR, run the capability suite on model updates. For customer-facing agents, use pass^k (for example k = 3 to 5) as the release gate
  • Before trusting an LLM judge: measure TPR and TNR against a held-out test set of human labels, and split judges by failure type
  • Keep running weekly: sample and read transcripts, add new failures as tasks, replace saturated capability evals with harder ones. Make it easy for PM, CS, and sales colleagues to submit new tasks as PRs

Agent evaluation is not a final exam before release; it is part of product design. Eugene Yan describes a team that, once its evals were in place, ran dozens of experiments in two weeks and a few hundred more over the following months. Front-loading two to four weeks of error analysis and harness setup makes it easier to reason about model, prompt, and tool changes in terms of concrete deltas rather than impressions.

That’s all from a practical Agent Eval primer that separates outcome from trajectory, starts with 20 to 50 tasks, and feeds production traces back into the regression suite, pulled together from the 2026 primary sources, from the Gemba.

References