Agent Evaluation
Agent evaluation tests whether an AI agent completes multistep tasks correctly and reliably, grading final outcomes and transcripts across repeated trials.
Agent evaluation is the practice of testing whether an AI agent completes multistep tasks correctly, reliably, safely, and at an acceptable cost. The agent attempts each task in a controlled environment, and graders check both the outcome, such as whether a refund was actually issued in the database, and the transcript of messages and tool calls that led there. Agent evaluation differs from ordinary model evaluation in three ways: the output is a sequence of actions that changes an environment, the same agent can succeed on one run and fail on the next, and the agent harness around the model, its prompts, tools, and memory rules, can change results as much as swapping the model.
How Agent Evaluation Works#
Anthropic's guide to evals for AI agents uses a vocabulary most teams share. A task is one test with defined inputs and success criteria. A trial is one attempt at it, and tasks get several trials because agent behavior varies between runs. The transcript, also called a trace or trajectory, records every output, tool call, and intermediate result, while the outcome is the final state of the environment. Graders then score each trial and come in three kinds:
- Code-based graders: Check outcomes and transcripts deterministically, such as whether a test suite passes, a record exists, or a forbidden tool was called. They are fast, cheap, and reproducible.
- Model-based graders: An LLM scores the transcript against a rubric, which suits qualities such as tone or whether an answer is grounded in retrieved evidence. These judges need calibration against human labels because they can share the agent's blind spots.
- Human graders: Domain experts review samples, settle disagreements, and supply the labels that calibrate model graders.
flowchart TD
A["Task suite"] --> B["Agent runs each task several times"]
B --> C["Record transcript and final state"]
C --> D{"Outcome checkable by code?"}
D -->|"Yes"| E["Code-based grader"]
D -->|"No"| F["Model grader with human spot checks"]
E --> G["Compute success and reliability"]
F --> G
G --> H{"Worse than the baseline?"}
H -->|"Yes"| I["Block the change and read traces"]
H -->|"No"| J["Ship the change"]What Agent Evaluation Measures#
- Task success: Whether the environment ended in the required state. Checking the state instead of the agent's final message catches agents that report success they never achieved, a form of hallucination.
- Reliability: How consistently the agent succeeds across repeated trials, paraphrased requests, and tool failures.
- Trajectory quality: Whether the agent chose the right tools, passed valid arguments, and avoided wasted or risky steps along the way.
- Safety and policy compliance: Whether it respected permissions, refused out-of-policy requests, asked before consequential actions, and resisted prompt injection planted in its inputs.
- Cost and latency: Tokens, tool calls, and wall-clock time per completed task, which decide whether a working agent is affordable in production.
Measuring Reliability with pass@k and pass^k#
Two metrics summarize repeated trials. pass@k, popularized by OpenAI's 2021 Codex paper on code generation, is the chance that at least one of k attempts succeeds, which fits tasks where a person or a test can pick the good answer. pass^k, introduced with the τ-bench benchmark in 2024, is the chance that all k attempts succeed, which fits customer-facing agents that must behave correctly every time. With n trials of a task and c successes, both are estimated with binomial coefficients and averaged over tasks:
from math import comb
# Graded outcomes of 8 trials per task (1 = the final environment state was correct)
trials = {
"cancel_order": [1, 1, 1, 1, 1, 1, 1, 1],
"change_flight": [1, 1, 0, 1, 1, 1, 0, 1],
"refund_with_coupon": [1, 0, 0, 1, 0, 1, 0, 0],
}
for k in (1, 4, 8):
# pass@k: at least one of k trials succeeds; pass^k: all k trials succeed
pass_at_k = sum(1 - comb(len(t) - sum(t), k) / comb(len(t), k) for t in trials.values()) / len(trials)
pass_hat_k = sum(comb(sum(t), k) / comb(len(t), k) for t in trials.values()) / len(trials)
print(f"k={k}: pass@k={pass_at_k:.2f} pass^k={pass_hat_k:.2f}")Both metrics start at 0.71 for k=1, the average success rate. At k=8, pass@k reaches 1.00 because every task succeeded at least once, while pass^k falls to 0.33 because only one task succeeded in all eight trials. τ-bench found the same gap in practice: the best function-calling agents of 2024, such as GPT-4o, solved fewer than half of its retail and airline customer-service tasks, and their pass^8 in retail was below 25%.
Agent Benchmarks and Related Terms#
Public benchmarks cover the main agent types. SWE-bench grades agentic coding on 2,294 real GitHub issues, WebArena grades web agents on 812 tasks in self-hosted websites, OSWorld grades computer-use agents on 369 desktop tasks where humans succeed 72.36% of the time, and GAIA grades general assistants on 466 questions that humans answered with 92% accuracy against 15% for GPT-4 with plugins at its 2023 release. Teams pair these with private suites, often a golden dataset of reviewed tasks and expected outcomes from their own product, because public benchmarks leak into training data and rarely match a product's tools. Agent evaluation also overlaps with three related practices:
- Model evaluation: Scores one model's outputs on a fixed dataset, such as mean average precision (mAP) for a detector. It evaluates one component of an agent.
- Observability: Records what agents do in production. Evaluation applies pass criteria to those records or to test runs.
- AI red teaming: Searches adversarially for new failures. Findings become regression tasks in the evaluation suite.
The strongest suites grow from production failures, and vision agents apply the same loop to their perception step. In Ultralytics Platform Agents, the Collect Uncertain Detections template sends a dataset's images through a deployed detector, such as a fine-tuned YOLO26 model, and copies every image with at least one detection confidence between, for example, 0.25 and 0.5 into a review dataset, where people label the hard cases as new test and training data.










