Introduction
An agent can produce a polished answer and still fail the task it was given. It might call the wrong tool, act on the wrong account, lose a constraint halfway through a conversation, or report a change that never occurred. The final response reveals only part of the story, so understanding a failure also means examining what the agent did, the environment it acted in, the resulting state, and the decisions it made along the way.
That broader view makes evaluation both an engineering and a product discipline. This book is for people who build agents, decide what quality means, operate systems after release, and communicate evidence to others. It begins with a practical premise: a useful evaluation starts with a decision, identifies observable evidence that can inform it, and states clearly what that evidence can—and cannot—establish.
To make these ideas concrete, the running examples use fictional organizations and provider-neutral Python code. Their numbers are illustrative, not findings about real models or products. When the book discusses research, benchmarks, frameworks, or standards, citations let readers examine the sources, methods, and scope for themselves.
No single score can certify an agent for every context. Instead, the goal is to help you build a defensible chain from a task and its risks to the tests and measurements that inform a release decision—and to carry what you learn forward after deployment.
An evaluation system at a glance
The following illustrative platform brings together the cases, execution environment, evaluators, analysis, and decisions needed to assess an agent. Its primary flow moves from left to right, while reviewed production findings can inform a later evaluation. The components are design options, not a claim that every agent requires every layer or tool.
The five layers read from left to right. Scroll the diagram horizontally to see them all; the explanation that follows also describes the flow.
Data & Configuration Layer
- Versioned Gold Sets
- Dynamic Rubric & Policy Registry
- Synthetic & Edge-Case Generator
- Production Traffic Sampler
Sandboxed Agent Execution Layer
- Configurable Orchestrator
- Target Agent Under Test
- Tool & API Mocks / Sandboxes
- Multi-Turn User Simulator
- Execution Trace & Telemetry Collector (capturing latency, token cost, tool calls, intermediate state)
Agent ↔︎ tools and simulator until a stopping condition.
Multi-Modal Scoring & Adjudication Engine
- Deterministic Assertions (Regex, Schema, Code/AST)
- LLM-as-a-Judge Panel (with position-swap & calibration controls)
- Human-in-the-Loop Annotation & Adjudication Queue
Statistical & Meta-Evaluation Layer
- Stratified Slice Aggregator
- Bootstrap Confidence Intervals & Power Analysis
- Inter-Rater Reliability (Krippendorff’s alpha / Cohen’s kappa) & Judge Calibration Monitor
Governance, CI/CD & Production Feedback
- Release Gate & Regression Alerts
- Interactive Leaderboard & Slice Explorer
- Drift & Online Monitoring Loop
Monitoring → results explorer for side-by-side review.
Feedback, right to left: versioned cases, rubrics or evaluator updates ← investigation, privacy review and adjudication ← production findings. Protected holdouts remain separate from tuning.
From cases to decisions
- Prepare the inputs. A versioned evaluation plan identifies the decision, task cases, initial states, expected outcomes and permitted actions. A gold set can supply reviewed labels; synthetic and boundary cases can extend coverage after their expected outcomes are checked. Separately versioned policies and rubrics tell evaluators what to assess without tying the scoring rules to the agent’s implementation.
- Run and collect evidence. The orchestrator supplies cases to the agent in an isolated environment. The agent can interact with mocked tools or a user simulator until it finishes, stops safely, or reaches a budget. A trace collector records available, authorized evidence, such as responses, tool calls and results, state changes, latency and cost; hidden model reasoning may not be available and is not required for every evaluation.
- Score and review. Deterministic checks assess observable facts such as schema validity or an authorized state change. Where judgment is needed, a qualified model judge can apply a rubric, and human reviewers can examine ambiguous cases, disagreements, or audit samples. Each evaluator receives only the evidence needed for its task; a model judge does not replace an authoritative system of record.
- Analyze and decide. Aggregate results by task and risk slice, report uncertainty appropriate to the sampling design, and check evaluator reliability and calibration. Bootstrap intervals can quantify sampling uncertainty when their assumptions fit; power analysis helps plan a future study. The resulting evidence supports a predeclared release gate or a ship, hold, or insufficient evidence decision. A results explorer can help teams investigate, but a leaderboard alone is not a release decision.
The production feedback loop
After deployment, authorized monitoring can surface missing evidence, changing traffic, regressions, and incidents. Probability-based samples and targeted risk reviews answer different questions, so a selected incident sample must not be treated as an estimate of the overall failure rate. A dashboard can show offline and online measures together, but differences in populations and measurement do not by themselves establish a causal effect.
Investigate findings promptly; urgent incidents require immediate action rather than a wait for the next evaluation. After appropriate privacy review, minimization, and adjudication, eligible findings can become versioned regression cases, rubric changes, or evaluator updates. Keep the independent holdout separate from tuning, and assess whether refreshed cases represent the population before using them to make population-level claims. For the service boundaries and operational controls behind this overview, see Chapter 16.