Designing reliable agent evals
Combining deterministic graders, mocked-tool CI workflows, replayable traces, incident-to-eval loops, and canary rollouts so agent changes ship without silent regressions.
The four-stage pyramid
An agent change ships safely when each stage of the pyramid only has to catch what the stage below it already ruled out. Skip a stage and the one above drowns.
| Stage | Patterns | Question It Answers | Speed and Cost |
|---|---|---|---|
| 1. Deterministic checks | Structured Output Specification, Rich Feedback Loops, Deterministic Grader in the Loop, Rendered UI Finish Gate | Does the output have the shape and the properties you can count? | Schema and counted checks cost no tokens. The agent’s revision pass and a UI render take time |
| 2. Mocked-tool and replay CI | Workflow Evals with Mocked Tools, Out-of-Process Provider-Boundary Replay | Does the whole workflow behave when prompt, tools, and model interact? | Workflow evals spend model calls on every PR. Replays cost nothing and need no key |
| 3. Grader and rubric evals | Skill Activation as Precision/Recall Measurement, Evidence-Layered Evaluation for Interactive Agents, Output Verification Loop, Anti-Reward-Hacking Grader Design | Is the behavior good, not only valid? | Model calls per row, plus labelling and instrumentation time |
| 4. Production feedback and rollout | LLM Observability, Incident-to-Eval Synthesis, Canary Rollout and Automatic Rollback | What is breaking for real users, and can you get back to a known-good state? | Observability spend, triage time, and release orchestration |
Stage 1: Deterministic checks
Start with what a machine can verify without a model in the loop.
- Structured Output Specification constrains output with schemas, so a parser or a downstream system can rely on it
- Rich Feedback Loops returns compiler errors, test failures, and lint output after each tool call, so the agent has something specific to fix
- Deterministic Grader in the Loop replaces the LLM-as-judge in a self-review loop with a scorer that returns the raw counts behind each sub-score. It is reproducible, so you can assert it in a test or a CI gate
- Rendered UI Finish Gate checks an agent-built interface against its design contract, required states, and rendered output before merge
Stage 2: Mocked-tool and replay CI
Then test the pieces together, with no side effects and no bill.
- Workflow Evals with Mocked Tools runs the complete workflow against mocked tools in CI. It checks which tools were called, plus agent-as-judge quality criteria
- Out-of-Process Provider-Boundary Replay captures a run at the model-provider HTTP boundary from outside the process, then serves those bytes back. The agent re-executes its own logic with no provider call, so replays belong in CI and in bug reports
Know the limit of replay: blocking provider egress is not sandboxing. The agent still executes its recorded tool calls for real.
Stage 3: Grader and rubric evals
Now ask whether the behavior is good.
- Skill Activation as Precision/Recall Measurement treats skill routing as classification over a labelled dataset, with per-skill precision and recall and CI thresholds that fail the build
- Evidence-Layered Evaluation for Interactive Agents scores interactive runs on a task outcome assertion and links each result to layered evidence: actions, screenshots, replays, network, and messages
- Output Verification Loop extracts individual claims, checks each against evidence sources, and returns per-claim trust scores before anything acts on the result
- Anti-Reward-Hacking Grader Design hardens any grader a model optimizes against, with multi-criteria evaluation and iterative hardening
Stage 4: Production feedback and rollout
Finally, let production tell you what the suite missed.
- LLM Observability gives span-level traces of each model call and tool use, plus aggregate cost, latency, and success metrics
- Incident-to-Eval Synthesis converts each production incident into executable eval cases with pass/fail criteria, and gates future releases on them
- Canary Rollout and Automatic Rollback for Agent Policy Changes ships a policy change to a small traffic slice, monitors guardrail metrics, and rolls back to the last stable version automatically
Comparison matrix
| Eval Technique | Speed and Cost | What It Catches | What It Misses |
|---|---|---|---|
| Structured Output Specification | Schema check with no model call | Output that would break a parser or a downstream system | Whether the content is correct |
| Rich Feedback Loops | One model pass per revision; raises runtime and cost | Errors that a compiler, test suite, or linter can report | Problems with no objective signal to feed back |
| Deterministic Grader in the Loop | Offline, reproducible, no token cost | The specific counted property the agent failed, with numbers it can act on | Everything you did not think to count. Meaning, truth, and fit for audience. It invites Goodhart |
| Rendered UI Finish Gate | Render time plus review time | Broken states and interactions that compile-time checks and source review miss | Issues that no rule covers, and comparisons that encode reviewer bias |
| Workflow Evals with Mocked Tools | Slower, spends model calls, and flakes | Regressions in prompts and tools together, and which tools were called | Mocks that drift from real tools. Too variable to serve as a blocking gate |
| Out-of-Process Provider-Boundary Replay | Fast, no key, no model call | Bugs that reproduce only in a full session | Prompt changes, which need a live model. Real side effects, which need a sandbox |
| Skill Activation as Precision/Recall Measurement | One model call per row, times replicates | Silent mis-routing and over-triggering across a skill catalog | Single-row verdicts, since only the aggregate is trustworthy. Numbers move with the model version |
| Evidence-Layered Evaluation for Interactive Agents | Storage and instrumentation overhead | Failures that a single pass/fail score hides, for browser and desktop agents | A correct evaluator is not guaranteed. Logs can hold sensitive data |
| Output Verification Loop | One verification call per output; adds latency | Factual errors that reflection loops miss | Quality beyond your evidence source. Tight latency budgets |
| Anti-Reward-Hacking Grader Design | More code to maintain, and multi-criteria grading takes longer per sample | A model that games the metric: reward rises while real performance does not | Criteria that resist a precise definition, such as financial soundness |
| LLM Observability | Ongoing platform spend, usually minimal latency | Cost, latency, and failure patterns across many runs | Whether a run was any good. Traces show what happened, not what should have happened |
| Incident-to-Eval Synthesis | Triage time per incident | Failures that recur after an operational fix | Anything before you have traffic and capturable incident data |
| Canary Rollout and Automatic Rollback | Release orchestration and telemetry | Regressions that only appear on live traffic | Anything without real-time telemetry and versioned policies |
Anti-patterns
LLM-as-judge with no deterministic checks underneath
An LLM judge is non-deterministic, costs tokens, and gives the agent nothing specific to fix. Deterministic Grader in the Loop exists because of this: it replaces the judge with a scorer that returns raw counts, which gives the revision loop a gradient. Reserve the judge for attributes that genuinely need semantic judgment, such as factual correctness or tone for an audience. Workflow Evals with Mocked Tools points at the same problem: judge-based results are too variable to serve as a blocking CI gate.
Testing only the happy path
A suite that checks only the expected output passes on the day before the incident. Three patterns widen it:
- Rendered UI Finish Gate keeps required states visible: async, empty, error, and responsive
- Skill Activation as Precision/Recall Measurement scores every skill on every row, so a description edit cannot quietly re-route another skill’s prompts
- Incident-to-Eval Synthesis turns each real failure into a case
Letting graders get reward-hacked
Any metric an agent can read, it will learn to satisfy. The deterministic grader pattern calls this Goodhart risk “real and direct” and advises capping the iterations and keeping the threshold well below the maximum. Anti-Reward-Hacking Grader Design is written for reinforcement learning reward design, and lists “training reward rises while real performance does not” as its warning signal. The same failure appears whenever an agent optimizes against any grader. You cannot harden a grader you never inspect, so traces from LLM Observability are part of the fix.
Never turning production bugs into regression cases
An operational fix without an eval case is a promise to debug the same thing twice. Incident-to-Eval Synthesis names the symptom: incidents recur after they were fixed operationally, and the eval suite drifts away from what production shows. When a regression slips past the suite anyway, Canary Rollout and Automatic Rollback is the last line. It limits the blast radius and shortens time-to-recovery.
Close the loop
The stages form a cycle, not a ladder. Production incidents become eval cases at stage 3. Those cases gate releases, and the next policy change ships behind a canary. Each turn of the cycle moves a failure from “surprised us in production” to “fails a PR check”.
A minimum loop for a new agent:
- Constrain the output with a schema
- Feed compiler, test, and lint output back after each tool call
- Run a mocked-tool workflow eval on every PR, non-blocking at first
- Capture traces at the provider boundary, so every bug report is replayable
- Instrument production
- Turn each incident into an eval case
- Ship policy changes behind a canary with automatic rollback
Next steps
- Choose the patterns that feed the evals with Choosing the Right Patterns
- A rubber-stamp judge is a topology failure too. See Multi-Agent Topologies Compared
- Context changes shift eval results. See the Context Engineering Playbook
- A defense you have not tested is a hypothesis. See Prompt-Injection Defense in Depth