Trajectory evals
Tests that grade an agent’s whole path to an answer: which tools it called, in what order, how many steps and at what cost, not only the final output.
Trajectory evals are tests that grade an agent’s whole path to an answer: which tools it called, in what order, how many steps and at what cost, not only the final output. Two agents can reach the same correct answer while one reads a customer record it had no reason to touch and takes five times the steps. Final-answer evals miss that.
A trajectory eval checks the recorded run against expectations: required and forbidden tool calls, step and cost limits, and sometimes an LLM judge for the reasoning. The traces come from the same observability you use in production. Anthropic’s eval guide calls this record the transcript (or trajectory) and separates it from the outcome, the real state after the run: whether the booking exists in the database, not whether the agent said it did. Grade both.
Avoid checking the exact order of every step. Agents often find valid paths you did not plan, and a strict script fails them for no reason. Check what must and must not happen, plus budgets such as cost per task. In multi-agent setups the trajectory also includes each agent handoff, so check that the next agent got what it needed and nothing more.
Sources
- Anthropic: Demystifying evals for AI agents anthropic.com
Related terms
- Evals: A repeatable test set that scores an AI feature, so changes can be measured instead of guessed.
- LLM as judge: Using a model with a rubric to grade another model’s output.
- Golden dataset: A fixed set of real inputs with expected answers or checks, used to test an AI feature after every prompt or model change.
- LLM observability: Tracing every model call with inputs, outputs, latency, tokens, cost and the user outcome.
- Cost per task (agent unit economics): What one finished agent task really costs: tokens, retries, tool calls and the human time to review it, compared with doing it another way.
- Agent handoff: One agent passes control of a conversation, together with its context, to a specialist agent or to a person.
