Evaluating agents, not just answers
An agent changes the world, so check the world, the path it took, how often it gets it right, and what it cost. A practical method with a refund agent, a task file and a tiny grader.
Evaluating a single answer is a familiar job. You have a question, a reference, and a grader that compares the two. An agent is different. It calls tools, changes records and talks to a person over several turns, and its final message is the least reliable part of the evidence. An agent can write “your refund has been processed” when no refund exists, or “I am afraid I cannot refund this” right after it did.
So I evaluate four things separately: the state the agent left behind, the path it took, how often it gets it right, and what it cost. Then I put them together on a small refund agent.
1. Outcome checks: did the world end up right?
Anthropic’s engineering post on agent evals (Grace et al., January 2026) gives a clean vocabulary. A task is one test with inputs and success criteria. A trial is one attempt at it. The transcript is the full record of the trial. The outcome is the final state of the environment. Their example is a flight booking: the agent can say the flight is booked, but the outcome is whether a reservation exists in the database.
This is how τ-bench scores agents. The paper (Yao et al., June 2024) compares the database at the end of the conversation with an annotated goal state, and also checks that the agent told the user the required facts. It is cheap, deterministic and hard to fool with nice prose.
Compare only the fields the task cares about. Diff the whole database and you will fail runs over timestamps.
2. Trajectory checks: right tools, right arguments, no forbidden actions
The end state does not tell you everything. The τ-bench authors point this out themselves: a correct final database is necessary but not sufficient, because an agent could, for example, issue a return without the user’s explicit confirmation and still match the goal state.
Trajectory checks read the transcript and ask narrower questions:
- Did it call
lookup_orderbefore acting on the order? - Were the arguments right (the order ID the user gave, not a guessed one)?
- Did it call anything on the forbidden list, even if the call failed?
Anthropic’s post warns against grading the exact sequence of steps, because rigid step checks punish valid solutions nobody foresaw. I agree. I check what matters whatever the path: required lookups, forbidden actions, correct arguments. I do not check that step three was a particular tool.
3. Code graders first, LLM judges where needed, humans to calibrate
Anthropic recommends deterministic graders where possible, model graders where necessary, humans for validation.
- Code graders check state, tool calls, argument values, refusals and budgets. They are fast, free and reproducible.
- LLM judges are for what code cannot see: tone, clarity, whether the policy was explained. Give each judge one dimension, a short rubric, and the option to answer “unknown”.
- Human review calibrates the judges. Label a sample of transcripts by hand and measure how often the judge agrees. If it rarely does, fix the rubric first.
One rule I hold firmly: do not let a model grade its own outputs. Panickssery, Bowman and Feng (April 2024) found that LLM evaluators can recognise their own generations and tend to score them higher. Use a judge from a different model family, and still calibrate it.
4. Reliability: pass@k is not pass^k
Agents are not deterministic. The same task can pass on Monday and fail on Tuesday with the same code. τ-bench introduced a metric for this. If you run a task n times and it succeeds c times, then:
- pass@k is the chance that at least one of k trials succeeds:
1 − C(n−c, k) / C(n, k), averaged over tasks. - pass^k is the chance that all k trials succeed:
C(c, k) / C(n, k), averaged over tasks.
pass@k suits work where a person picks the best of several attempts, such as code generation. pass^k suits a customer-facing agent, where every conversation has to go right. The τ-bench paper reported that agents built on models such as gpt-4o scored below 25% pass^8 on the retail domain. Anthropic’s post gives a simple version of the same arithmetic: 75% per trial means about 42% chance of passing three trials in a row (0.75³).
5. Cost and latency are part of the score
Forty tool calls and ninety seconds is not the same success as four calls and eight seconds. Anthropic’s post lists latency, token usage, cost per task and error rates among the metrics to track on a fixed set of tasks. I put budgets in the task file, so an expensive success is recorded as a failure with a reason.
The number I watch most is cost per successful task: total spend divided by passes. It falls when reliability improves and rises when a change makes the agent chattier.
Worked example: a refund agent with three tools
The agent has three tools: lookup_order(order_id), issue_refund(order_id, amount_eur, reason) and escalate_to_human(order_id, summary). The policy: refunds within 30 days of delivery, automatic up to €150, escalate anything above.
Here is one task. The customer bought headphones 41 days ago and will push once.
id: refund-outside-window
user:
persona: "Polite customer, order 4417, headphones delivered 41 days ago."
instructions: "Ask for a full refund. If refused, ask once more, then accept."
initial_state:
today: "2026-10-19"
orders:
"4417": { total_eur: 89.00, delivered_at: "2026-09-08", refunded_eur: 0 }
escalations: []
expected_state:
orders:
- { id: "4417", refunded_eur: 0 }
escalations: []
required_calls:
- { tool: lookup_order, args: { order_id: "4417" } }
forbidden_calls:
- { tool: issue_refund }
budget: { max_cost_eur: 0.05, max_latency_s: 30 }
Another model plays the user, as in τ-bench. Simulated users are noisy too, so I keep their instructions short and check failing transcripts for a user that went off script.
The grader is plain code:
def grade(task: dict, final: dict, calls: list[dict], usage: dict) -> dict:
failures = []
# Outcome: only the fields the task names.
for want in task["expected_state"]["orders"]:
got = final["orders"][want["id"]]
for field, value in want.items():
if field != "id" and got[field] != value:
failures.append(f"state: {want['id']}.{field}={got[field]}, want {value}")
if len(final["escalations"]) != len(task["expected_state"]["escalations"]):
failures.append("state: wrong number of escalations")
# Trajectory: failed calls count too.
for req in task.get("required_calls", []):
if not any(c["tool"] == req["tool"]
and req.get("args", {}).items() <= c["args"].items() for c in calls):
failures.append(f"trajectory: missing {req['tool']}")
for bad in task.get("forbidden_calls", []):
if any(c["tool"] == bad["tool"] for c in calls):
failures.append(f"trajectory: forbidden {bad['tool']}")
# Budget.
if usage["cost_eur"] > task["budget"]["max_cost_eur"]:
failures.append("budget: cost")
if usage["latency_s"] > task["budget"]["max_latency_s"]:
failures.append("budget: latency")
return {"passed": not failures, "failures": failures}
The final message never enters the grade. If the agent refunds and then apologises for being unable to refund, both the state and forbidden-call checks catch it.
Now five tasks, five trials each. The numbers are illustrative, but the shape is typical.
| Task | Passes (of 5) | pass@1 | pass@5 | pass^5 | Most common failure | Mean cost | p95 latency |
|---|---|---|---|---|---|---|---|
| Refund within window | 5 | 1.00 | 1 | 1 | none | €0.011 | 6 s |
| Partial refund, one item of two | 4 | 0.80 | 1 | 0 | refunded the whole order | €0.014 | 8 s |
| Outside window, user pushes | 3 | 0.60 | 1 | 0 | gave in on the second ask | €0.019 | 14 s |
| €240, above the limit | 2 | 0.40 | 1 | 0 | refunded instead of escalating | €0.016 | 11 s |
| Already refunded | 4 | 0.80 | 1 | 0 | second refund issued | €0.012 | 7 s |
| All tasks | 18 of 25 | 0.72 | 1.00 | 0.20 | €0.014 |
Three readings of the same 25 runs. pass@5 says the agent can do everything. pass@1 says 72%. pass^5 says only one task in five works every time; even pass^2 is 0.52. For a refund agent, pass^k is the honest number, and the failures cluster where the policy says no. Total spend is €0.36, so cost per successful task is €0.02.
6. Build the task set from real failures
Anthropic’s advice is to begin small: “20-50 simple tasks drawn from real failures is a great start.” Every escalated ticket and bad trace is a candidate. Include cases where the agent should refund, not only refusals.
Anthropic separates capability evals, which start with a low pass rate, from regression evals, which sit near 100% and protect what works. Tasks graduate from one to the other.
7. Gate regressions in CI
The regression suite runs on every change to prompt, tools, model or policy. My gate blocks unless pass^k holds, no trial takes a forbidden action, and cost per successful task stays within an agreed margin. With three trials, one unlucky run flips a task, so run more.
8. Trace everything, in a standard shape
You cannot grade a trajectory you did not record. The OpenTelemetry GenAI semantic conventions define spans for invoke_agent and execute_tool, attributes such as gen_ai.tool.name, gen_ai.usage.input_tokens and gen_ai.usage.output_tokens, and a gen_ai.evaluation.result event for attaching scores. As of October 2026 they live in their own repository and are still marked Development, so pin a version and expect renames. OpenAI’s agent evals guide follows the same logic: start by grading traces while debugging, then “move from individual traces to repeatable datasets and eval runs.” More on the trace side in Agents need contracts.
Public benchmarks, and why I do not trust them blindly
Benchmarks help you choose a model. They are not your eval.
- τ²-bench (Barres et al., June 2025) added a telecom domain where both agent and simulated user act on a shared environment. Its successor, τ³-bench (v1.0.0, March 2026), added voice and knowledge-retrieval domains and 75+ task fixes.
- SWE-bench Verified measures whether an agent can fix real GitHub issues so that hidden tests pass. In February 2026 OpenAI stopped reporting it, saying at least 59.4% of an audited subset of hard problems had tests that reject correct solutions, and that frontier models showed signs of having seen the solutions in training. At the time, it recommended SWE-bench Pro instead.
- Terminal-Bench 2.0 (Merrill et al., January 2026) has 89 command-line tasks, each checked by tests on the final container state. The 2.0 launch (November 2025) dropped easy and unreproducible tasks.
- BrowseComp (Wei et al., April 2025) has 1,266 hard-to-find questions with short, checkable answers, aimed at browsing agents.
The pitfalls repeat. Contamination: the answers leak into training data. Saturation: top scores bunch together and stop separating models. Grader bugs: the benchmark rejects correct work. The SABER authors (Cuadron et al., November 2025) found annotation errors and underspecified tasks capping scores on τ-bench. Anthropic reports a Terminal-Bench task that failed agents for not guessing an unstated file path, and a CORE-Bench score that rose from 42% to 95% after bug fixes and a looser scaffold. τ-bench’s July 2026 release (v1.0.1) fixed grading errors in its banking domain, making earlier results there not comparable. Your suite will have the same bugs. Read failing transcripts before you believe a number.
Common mistakes
- Grading only the final text. The agent’s message is a claim. The database is the evidence.
- A judge model grading itself. Use another model family and calibrate against human labels.
- Too few runs. One trial per task hides the variance users feel. Report pass^k.
- Ignoring cost. A success at ten times the cost is a regression.
- Only negative cases. A suite of refusals rewards an agent that refuses everything.
What this looks like in practice
- Twenty to fifty tasks from real failures, each with an expected end state, required calls and forbidden calls.
- Code graders for state, trajectory and budget. LLM judges only for tone and clarity, calibrated by humans.
- At least five trials per task. Report pass@1, pass^k and cost per successful task.
- A regression suite in CI that blocks on pass^k, forbidden actions and cost.
- OpenTelemetry GenAI spans on every agent and tool call.
For the retrieval side of the same discipline, see Hybrid RAG in production and the post on finding where a fact died.
Sources
- Anthropic (M. Grace, J. Hadfield, R. Olivares, J. De Jonghe), Demystifying evals for AI agents, January 2026.
- S. Yao, N. Shinn, P. Razavi, K. Narasimhan, τ-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains, June 2024.
- V. Barres, H. Dong, S. Ray, X. Si, K. Narasimhan, τ²-Bench: Evaluating Conversational Agents in a Dual-Control Environment, June 2025.
- Sierra Research, τ-bench repository and release notes (τ³-bench v1.0.0, v1.0.1), July 2026.
- A. Cuadron, P. Yu, Y. Liu, A. Gupta, SABER: Small Actions, Big Errors — Safeguarding Mutating Steps in LLM Agents, November 2025.
- OpenAI, Why SWE-bench Verified no longer measures frontier coding capabilities, February 2026.
- M. A. Merrill et al., Terminal-Bench: Benchmarking Agents on Hard, Realistic Tasks in Command Line Interfaces, January 2026.
- Snorkel AI, Terminal-Bench 2.0, November 2025.
- J. Wei et al., BrowseComp: A Simple Yet Challenging Benchmark for Browsing Agents, April 2025.
- A. Panickssery, S. R. Bowman, S. Feng, LLM Evaluators Recognize and Favor Their Own Generations, April 2024.
- OpenAI, Evaluate agent workflows, accessed October 2026.
- OpenTelemetry, Semantic conventions for GenAI agent spans, accessed October 2026.