Skip to content
Inference Academy

Evaluating agent trajectories

Why grading only an agent's final answer misses forbidden actions, skipped checks and loops; how to score a trajectory on outcome, required and forbidden tool calls, ordering and efficiency; state-based checks; LLM judges for trajectories; and how to build a trajectory test set. With runnable code that shows final-answer grading passing runs that should fail.

By

16 min · verified 2026-11Pro
Share

An agent's final message is the last line of a long story. Between the user's request and that message, the agent may have called the wrong tool, acted on the wrong record, skipped a required check, or looped ten times. Grading only the final answer misses all of it. This lesson shows how to grade the whole trajectory.

#What a trajectory contains

A trajectory is the ordered record of a run: the user input, each model turn, each tool call with its arguments and result, and the final answer. If you trace your agent (tracing), you already have it; evaluation reads the same data.

Pro content

Keep reading with Inference Academy Pro

Unlock the rest of this lesson, plus every advanced lesson, hands-on lab, the larger playground models and completion certificates.

Still to come in this lesson

  1. Five things to score
  2. State checks versus path checks
  3. LLM judges for trajectories
  4. Non-determinism
  5. Building a trajectory test set
  6. Common mistakes
  7. Exercises

You will be able to answer

  • An agent refunds the right order but first refunds the wrong one by mistake. Final-answer grading says...
  • Which trajectory checks should be hard fails, whatever the outcome?
  • Why compare final state (the database after the run) rather than only the tool-call list?
  • An agent passes but uses 6 tool calls where 2 are enough. How should that be reported?
  • Agents are non-deterministic. How many runs per task should you use?