Evals & Observability·Question 41 of 83Advanced

How do you evaluate agents? Compare trajectory-based and outcome-based approaches.

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Agents make evaluation harder in three ways: many valid paths to success, state accumulates across steps (early errors compound or get recovered), and outcomes depend on an environment, not just text. Two complementary approaches:

Outcome-based: did the task actually complete? Verified programmatically against the environment's final state - tests pass on the patched repo (SWE-bench), the database row has the right booking (τ-bench), the file exists with correct contents, the order status changed. This is the gold standard when checkable: it's objective, it doesn't penalise unconventional-but-valid strategies, and it's what users care about. Its costs: you need a sandboxed environment simulator with realistic tools, seeded state, and reset-ability (evals must be repeatable and must not touch production systems); building and maintaining these simulators is most of the engineering work in agent evals. For multi-turn tasks you often also need a simulated user (an LLM playing the customer), which introduces its own variance and realism questions.

Full worked answer with diagram

Agents make evaluation harder in three ways: many valid paths to success, state accumulates across steps (early errors compound or get recovered), and outcomes depend on an environment, not just text. Two complementary approaches:

Outcome-based: did the task actually complete? Verified programmatically against the environment's final state - tests pass on the patched repo (SWE-bench), the database row has the right booking (τ-bench), the file exists with correct contents, the order status changed. This is the gold standard when checkable: it's objective, it doesn't penalise unconventional-but-valid strategies, and it's what users care about. Its costs: you need a sandboxed environment simulator with realistic tools, seeded state, and reset-ability (evals must be repeatable and must not touch production systems); building and maintaining these simulators is most of the engineering work in agent evals. For multi-turn tasks you often also need a simulated user (an LLM playing the customer), which introduces its own variance and realism questions.

Trajectory-based: score the path - tool-choice accuracy (right tool for the step), argument correctness, step efficiency (steps taken vs a reasonable minimum; loop detection), error recovery behaviour, and safety along the way (an agent that succeeds but ran a destructive command en route is a failure). Graded by assertions against expected tool sequences where the path is constrained, or by judges over the trace where it isn't. Trajectory scoring is the diagnostic layer: outcome metrics tell you the 40% failure rate; trajectory analysis tells you it's mostly wrong arguments to the search tool at step 2.

Practices that matter: run k trials per task - agent variance is enormous, single runs are anecdotes; report pass@k and pass^k (all k succeed, per τ-bench) because reliability is the product metric - 80% per-trial success is pass^8 ≈ 17%. Grade partial credit via milestone/subgoal checkpoints so long tasks yield gradient, not just 0/1. And keep a transcript-reading habit: agent failure modes (loops, hallucinated tool outputs, giving up early) are obvious to a human reader and invisible in aggregates.

Worth sketching. Two arrows off the same run: one grades the world, the other grades the path, and only the second tells you where to look.

flowchart LR
    T["Task in a seeded sandbox"] --> R["Trajectory:<br/>step 1, 2, ... n"]
    R --> F["Final environment state"]
    F --> O["Outcome grade:<br/>did the booking row change?"]
    R --> J["Trajectory grade: tool choice,<br/>arguments, loops, destructive steps"]
    O --> K["k trials: report pass@k<br/>and pass^k"]
    J --> L["Localises it:<br/>wrong arguments at step 2"]

What a good answer covers

  • Agents make evaluation harder in three ways
  • Outcome-based: did the task actually complete?
  • Verified programmatically against the environment's final state - tests pass on the patched repo…
  • This is the gold standard when checkable
  • Its costs: you need a sandboxed environment simulator with realistic tools, seeded state, and…

Key terms: Outcome-based · sandboxed environment simulator · simulated user · Trajectory-based · k trials per task · pass^k

Interviewer follow-ups to expect

  1. How do you eval an agent whose tools hit non-resettable third-party APIs?

  2. Your agent scores well in the simulator and disappoints in production - enumerate the gaps.

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep