In this article
Before you start
This page is one step of the AI agent architecture learning path.
Why interviewers ask this
Evaluating agents is where an agent design stops being a diagram and becomes something a team can ship. A system that calls tools and changes state can fail in ways a chat answer cannot. Interviewers use the question to see whether a candidate separates what an agent says from what it does.
A weak answer is "I check whether the final answer is correct". That describes testing a chatbot. A strong answer names the outcome check, the trajectory and repeated trials. A Staff-level answer also says which grader owns which check, why one exact tool sequence is the wrong reference, and how the pass rate behaves when users need the agent to work every time. Candidates report this question in agent-design and machine learning system design rounds; pair it with agentic AI interview questions for the neighbouring ones.
Agent evaluation from first principles
- Outcome check
- An outcome check is a grader that reads the state an agent left in its environment, such as a database row or a file, and compares it with the state the task requires, so a confident final message cannot pass a task the agent did not complete.
- Trajectory match
- A trajectory match is a grader that compares the ordered list of tool calls an agent made with a reference list under a stated rule, such as exact order, any order, no extra tools or at least the reference tools, so it scores the path taken and not only where the agent ended.
Step-by-step description
- Read the environment state, not the message.
- Repeat each task and report pass^k.
- Average per task from n trials.
- Match tool calls to a reference path.
- Check arguments and single steps.
- Mix code, model and human graders.
- The outcome check reads the environment state, not the final message.
- Repeated trials give pass^k, the chance that all k trials succeed.
- The estimator averages per task, so it differs from a pooled success rate.
- The trajectory check compares tool calls to a reference path.
- Code, model and human graders each cover different checks.
In plain words
Think of a driving test. The examiner does not only ask whether you arrived. They watch whether you stopped at the lights, and a good school wants you to pass on most days, not once. The analogy breaks in one place. A driving test has one fixed route, while an agent task can have several valid paths and a simulated user who varies.
Some vocabulary, following Anthropic's guide to agent evals. A task is one test with defined inputs and success criteria, and each attempt at it is called a trial. A grader is logic that scores one aspect of the agent's performance. A trajectory is the ordered record of the agent's messages, tool calls and tool results in one trial. The harness is the code around the model that runs the loop and the tools. You evaluate the harness and the model together, not the bare model.
Step 1: Grade the outcome, not the final message
The outcome check reads the environment state, not the final message. Anthropic gives the example of a flight-booking agent that says the flight is booked, while the real test is whether a reservation exists in the environment's Structured Query Language (SQL) database (Anthropic, 2026).
τ-bench works this way. It compares the database at the end of a conversation with one annotated goal state, so every conversation that ends in that state passes, however it got there. It also checks that the replies contain required facts, such as the refund amount the user asked for.
Input: the final environment and the transcript. Output: pass or fail per check. The check is necessary but not sufficient. The τ-bench authors note that an agent might issue a return without explicit user confirmation, which breaks policy, so you add a check that the rules were followed.
Step 2: Repeat each task and report pass^k
Agents are non-deterministic, so one trial per task proves little. Repeated trials give pass^k, the chance that all k trials succeed. Its counterpart pass@k is the chance that at least one of k trials succeeds (Yao et al., 2024). Use pass@k when one good solution is enough, and pass^k when users need the agent to work every time.
The τ-bench authors report that gpt-4o with function calling solved about 61% of retail tasks in one trial (Yao et al., 2024, Table 2), but under 25% consistently across eight trials (Yao et al., 2024, abstract). Why does the number fall so fast? If trials were independent and each succeeded with probability 0.75 (illustrative), three successes in a row happen 0.4219 of the time. Eight successes in a row happen 0.1001 of the time at that rate.1 Real tasks differ in difficulty, so treat this as intuition and not as a forecast.
Text description of the diagram
- Three successes in a row happen 0.4219 of the time at 0.75 per trial.
- Eight successes in a row happen 0.1001 of the time at that rate.
Step 3: Estimate pass^k from n trials
With n trials of one task and c successes, the unbiased estimates are pass^k = C(c,k) / C(n,k) and pass@k = 1 − C(n−c,k) / C(n,k), averaged over tasks (Yao et al., 2024). Here C(a,b) counts the ways to choose b items from a.
Take one task with ten trials and eight successes (illustrative). Then pass^3 is 56 / 120, about 0.4667, while pass@3 is 1.1
| Metric (illustrative, 8 of 10 trials succeed) | k = 1 | k = 2 | k = 3 |
|---|---|---|---|
| pass^k | 0.8 | 0.6222 | 0.4667 |
| pass@k | 0.8 | 0.9778 | 1 |
The estimator averages per task, so it differs from a pooled success rate. Take two illustrative tasks: an easy one with ten of ten successes and a hard one with four of ten. Mean pass^3 is 0.5167, while cubing the pooled rate of 0.7 would wrongly give 0.343.1
Step 4: Compare the trajectory with a reference that allows more than one path
The trajectory check compares tool calls to a reference path. Exact match is simple, but LangChain's documentation warns that sometimes there can be multiple correct paths. Its trajectory-evaluation page lists match modes: exact order, any order, subset (no extra tools) and superset (at least the reference tools, extras allowed). Exact order is the strictest rule and fits steps that must happen in sequence. Any order accepts the same calls shuffled. No extra tools lets the agent skip a step but forbids additions, which suits efficiency checks. At least the reference tools allows additions but demands every reference call. The table compares tool names only; the evaluator can also compare tool-call arguments.
Below, the reference is get_reservation, check_fare_rules, cancel_reservation, book_flight. The agents are illustrative.1
| Agent | Exact order (tool names only) | Any order (tool names only) | No extra tools (tool names only) | At least the reference tools (tool names only) |
|---|---|---|---|---|
| A: same calls, same order | pass | pass | pass | pass |
| B: same calls, swapped order | fail | pass | pass | pass |
C: adds search_flights | fail | fail | fail | pass |
D: skips check_fare_rules | fail | fail | pass | fail |
| E: right tools, wrong reservation | pass | pass | pass | pass |
Step 5: Check tool arguments and single steps to find where it broke
Agent E shows the gap: name-only matching sees the tools selected, not the input passed to them. Match tool arguments too where the evaluator supports it, or add a state check that catches the wrong reservation. LangChain's documentation suggests giving a language model used as a judge the full trajectory plus a reference trajectory, which it calls the most challenging reference to compile.
Arguments matter. Of 36 gpt-4o failures on τ-retail, wrong argument made up 33.3%, wrong decision 25.0%, wrong information 22.2% and partially resolved 19.4% (Yao et al., 2024).
A single-step eval tests one decision, such as whether the agent picks the right tool. It is fast and pinpoints failures but does not capture the full agent (LangChain). Partial credit also helps when an agent takes some correct steps but misses the final answer (LangChain).
Step 6: Mix graders by what each check needs
Code, model and human graders each cover different checks. Anthropic describes code-based graders as fast, cheap, objective and reproducible, but brittle to valid variations. Model-based graders are flexible but non-deterministic and need calibration with human graders. Human graders are the gold standard but slow and expensive.
Anthropic's illustrative support task combines a state check (ticket resolved), a required tool-calls check, a transcript limit of ten turns and a language-model rubric for tone. It also reports a rigid grader failing a valid answer: a Claude Opus 4.5 model found a loophole in a flight-booking policy, failed the eval as written, yet served the user better. If a grader says no, read the transcript before blaming the agent.
Knowing it is half the job. Saying it is the other half.
Interview Clozo is an AI interview copilot for real interview rounds: it hears the question and puts a strong answer on your screen, and you say it in your own words. See the features or how it works.
Start Free Trial →The Staff-level answer
How do you evaluate an AI agent, beyond just checking the final answer?
I would not stop at the final message. First I check the outcome: after the run, I read the environment state, for example whether the reservation row exists, and whether the reply holds the required facts. Second, I run each task several times and report pass^k, the chance that all k trials succeed, because a good single-run score can hide an agent that fails often on repeat. Third, I compare the trajectory to a reference with a mode that allows more than one valid path, and I check tool arguments, since wrong arguments cause many failures. Code graders handle what is checkable, a calibrated model grader handles tone, and humans spot-check both.
What makes it Staff-level is that it separates what the agent said from what it did, names the reliability metric, and says which grader owns which check.
The rubric
This rubric is a study aid, not any company's scoring sheet.
| Dimension | Weak answer | Strong answer | Staff answer |
|---|---|---|---|
| Correctness | Checks that the final answer looks right | Checks the environment state after the run | Checks state, required replies and policy rules separately |
| Depth | Names no metric | Names trajectory and repeated trials | Explains pass^k against pass@k and the per-task estimator |
| Trade-offs | Wants one exact tool sequence | Allows several valid paths | Picks the matching mode by goal and adds argument checks |
| Communication | Lists tools and buzzwords | States three checks in order | Says what each check catches and which grader runs it |
| Follow-up readiness | Stuck on reliability questions | Explains why repeats matter | Handles judge calibration, cost and regression suites |
Three variants of this question
How do you evaluate an agent when several different paths are correct?
Grade the outcome state, which any valid path can reach, and use any-order or superset trajectory matching, or a judge given a reference trajectory. Keep exact-order matching for steps that must happen in sequence, such as a confirmation before a cancellation, where human-in-the-loop approval is the runtime counterpart.
What if the agent reaches the right state but breaks a rule on the way?
A state check is necessary but not sufficient (Yao et al., 2024). Add a transcript check, for example a rubric that the agent asked for confirmation before acting, and fail the trial if the rule was broken.
How do you evaluate the agent after it ships?
Anthropic's guide lists production monitoring, user feedback, A/B testing and manual transcript review alongside automated evals. Turn real failures into new regression tasks and track turn count, tool calls, tokens and latency.
Common mistakes
- "The agent said the booking is done, so it passed." (wrong) The message is not the state. (right) "I check that the reservation exists in the environment."
- "I ran it once and it passed, so it is reliable." (wrong) One trial hides variance. (right) "I run several trials and report pass^k."
- "The agent must call the tools in exactly this order." (wrong) Several paths can be correct. (right) "I match any order or a superset, and keep exact order only for required sequences."
- "The tool sequence matched, so the agent was correct." (wrong) Matching ignores arguments. (right) "I also check arguments and the final state."
- "A failed task means a bad agent." (wrong) The task or grader may be at fault; the τ-bench authors found 4 of 40 failures caused by typos or ambiguity in the user instruction (Yao et al., 2024). (right) "I read the transcript first."
Follow-up questions
What is the difference between pass@k and pass^k?
pass@k is the chance that at least one of k trials succeeds; pass^k is the chance that all k succeed. Choose by whether one good solution is enough or the agent must work every time. For more, see evaluating agents: trajectories, tool accuracy and reliability.
What is the difference between a regression eval and a capability eval?
A regression eval asks whether the agent still handles tasks it used to handle and should sit near a full pass rate. A capability eval asks what the agent can do well and should start at a low pass rate. Capability tasks with high pass rates can graduate into the regression suite (Anthropic).
Can you use an LLM as a judge to evaluate an agent?
Yes, for fuzzy checks such as tone or a trajectory compared with a reference. Model-based graders are non-deterministic and need calibration against human graders. Write the rubric as carefully as any prompt; see prompt engineering.
How many trials per task do you need?
There is no fixed number. You need at least k trials per task to report pass^k, more trials steady the estimate, and each trial costs money.
How do you evaluate a research agent?
Add checks for groundedness, coverage and source quality to the outcome checks (Anthropic). See how to design a deep-research agent for the system being evaluated.
- Grade the environment state, not the agent's final message.
- Report pass^k from repeated trials, because reliability falls as k grows.
- Match trajectories with a rule that allows several valid paths, and check tool arguments too.
- Use code graders for checkable facts, calibrated model graders for tone and humans for spot checks.
- Read the transcript before blaming the agent: tasks and graders can be wrong.
Sources
- Demystifying evals for AI agents — Anthropic Engineering (accessed 2026-10-26), 9 Jan 2026
- tau-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains (arXiv 2406.12045) — arXiv (Yao, Shinn, Razavi, Narasimhan; accessed 2026-10-26), 17 Jun 2024
- Application-specific evaluation approaches (agents) — LangChain LangSmith docs (undated page, accessed 2026-10-26), 26 Oct 2026
- How to evaluate your agent with trajectory evaluations — LangChain LangSmith docs (undated page, read as a search excerpt, accessed 2026-10-26), 26 Oct 2026
- Evaluate a complex agent — LangChain LangSmith docs (undated page, read as a search excerpt, accessed 2026-10-26), 26 Oct 2026