Part 6 of 7 · Enterprise AI Agent Engineering

Evals for Agents: How to Test Enterprise AI Agents Before and After You Release Them

Learn how to build evals for AI agents: test trajectories, choose graders you can trust, and set release gates for pilot and rollout.

Part 6 of 7 in the Enterprise AI Agent Engineering guide

Why this matters now

Imagine a claims-triage agent in an insurance GCC. The team tunes the prompt and upgrades the model version. Five hand-picked examples all look good, so the change goes live. For the next two weeks, one category of claims is routed to the wrong queue. Nobody notices until a service team asks why its backlog is empty and another team's is overflowing. (This is an illustrative scenario, not a customer case.)

The change was not reckless. The team simply had no way to see what it had broken, because the only test was a handful of examples chosen by the person who wrote the prompt.

Enterprises feel this strongly. Agents change often: prompts, tools, models and retrieved data all move. Behaviour varies from run to run, so a single success proves little. Work touches regulated processes, so "it seemed fine" is not an answer an auditor or a risk committee will accept. And there is a cost to guessing: every unmeasured change is a bet made with live customer or employee work.

This is the discipline of evals. It is the sixth topic in our series, and it ties the earlier ones together. Context, tools, loops, guardrails and human checkpoints each describe how an agent should behave. Evals check whether it does.

The core concept

An eval is a repeatable test that runs an agent on defined cases and scores its behaviour against stated criteria. An eval set is the collection of cases. A grader is whatever does the scoring. A release gate is the threshold of scores an agent must meet before it moves to the next stage.

Three ideas make agent evals different from testing ordinary software.

First, score the path as well as the outcome. An agent can reach the right answer by calling a tool it should not have used, skipping a required check or taking many more steps than needed. The record of a run, called the trace, lets you grade the trajectory: which tools were called, in what order, whether limits were respected and whether a human checkpoint was triggered when it should have been.

Second, expect variation. Agents are not deterministic. The τ-bench benchmark (Yao et al., 2024) proposed a measure called pass^k, which asks whether an agent succeeds on the same task across several repeated trials. Enterprises need that kind of consistency, since a process that works on one run in two is not a process.

Third, choose graders deliberately. There are three kinds. Code-based graders check things with exact answers, such as a routing label, a required field or a forbidden tool call. Human graders judge quality and edge cases. Model-based graders use a second model as judge, which scales well. Research on model judges, such as Zheng et al. (2023), found that strong judges can agree closely with human raters, and also documented biases such as favouring longer answers and answers in a particular position. A model grader should be checked against human labels before you trust it.

Evals run in two places. Offline evals run before release and on every change. Online evals sample real production runs and score them, which catches problems the offline set did not anticipate.

How the pieces connect:

Eval set: historical cases, hard cases, rejected checkpoints,
          injection tests, past incidents
      |
      v
Run the agent in a test harness (mocked or sandboxed tools)
      |
      v
Capture the trace of each run (repeat each case several times)
      |
      v
Graders: code checks | human review | model judge (calibrated)
      |
      v
Scorecard compared with the baseline  -->  Release gate
      ^                                         |
      |                                         v
      +---- new cases from production sampling and incidents

How it works in real systems

Scenario 1: Claims triage. The eval set is drawn from historical claims, spread across every claim type so no category hides inside an average. It also includes known hard cases and cases that previously went wrong. Code graders check the routing label and the required fields. A trajectory check confirms the agent never called a tool outside its permission scope (see guardrails and permissions). A person reviews a sample of the agent's written summaries for quality. The release gate says the new version must not score worse than the current one in any category. The misrouted category would have been caught before release.

What an eval case looks like. A case is a fixed input, an expected result and the rules for grading it, so the same case can be run again after every change. An illustrative case for claims triage:

case_id: triage-fraud-017
category: fraud_flag
source: historical claim, anonymised
input: claim text and attachments
expected:
  route: special_investigations
  required_fields: [claim_id, reason_code]
forbidden_tool_calls: [approve_claim, send_customer_email]
runs: 5                          # repeated to check consistency
graders:
  - code: route_matches_expected
  - code: no_forbidden_tool_call
  - human: sampled review of the written summary

The case checks the outcome, the path the agent took and its consistency across repeated runs. This is an example, not a customer case.

Scenario 2: IT service desk. Tools are replaced with simulated versions that return fixed responses, so the same case can be run many times at no risk. Each case runs several times to check consistency. Graders score whether the ticket was resolved correctly, how many steps it took, what it cost and whether the agent handed off to a person when the case was outside its scope. Rejections from human reviewers are turned into new test cases, as described in human-in-the-loop design.

Impact. Evals catch regressions before users do, which improves reliability. Step and cost scoring makes waste visible, which helps control cost and latency. Safety and injection cases lower risk. A scorecard that leaders can read gives them grounds to approve a rollout, which supports adoption.

Design decisions and trade-offs

Decision Option A Option B Choose A when Choose B when
What to score Final outcome only Outcome and trajectory The path does not matter and risk is low The agent uses tools, touches sensitive data or acts on others' behalf
Grader Code-based Model-based judge The answer is exact, such as a label or a field Quality is open-ended, such as a summary; calibrate against human labels
Environment Mocked tools Sandbox of real systems Speed and repeatability matter most Integration behaviour is the risk being tested
Test data Real historical cases Synthetic cases Real cases exist and can be used within policy Real data is restricted or rare cases are needed
Run frequency Every change On a schedule The agent is in active development The agent is stable; still run on any model or tool change

When not to use a model-based grader: do not use one for anything with a known correct answer. A code check is cheaper, faster and exact. And never rely on a model judge that has not been compared with human ratings on your own cases.

What breaks in production

Failure mode Symptom Root cause Mitigation
Tiny or hand-picked eval set Evals pass, production fails Cases chosen by the author, few categories Build from real cases, cover every category, add hard cases
Overfitting to the eval set Scores rise, real quality does not Prompt tuned to the test cases Keep a held-out set that is not used for tuning
Judge bias Scores favour long or confident answers Uncalibrated model-based grader Compare with human labels, use code checks where possible
Ignoring variation Agent passes once, fails the next run Each case run a single time Repeat each case and report consistency
Scoring only the final answer Unsafe or wasteful paths go unnoticed No trajectory checks Grade tool calls, steps, cost and handoffs from the trace
Stale eval set New failure types are never tested Set not updated after incidents Add every incident and rejection as a case; sample production

Enterprise Decision Framework

Set the evidence an agent must show at each stage of release. The gates below are recommended starting points; calibrate to your environment and risk appetite.

Stage Minimum evals Release gate
Prototype A small set of real cases, run by the builder None; use it to find failure types
Pilot Outcome and trajectory evals across every category, repeated runs, safety and injection cases Zero failures on safety cases; no category below the agreed threshold; human review of every pilot decision
Limited rollout Full offline set, plus sampled online scoring of live runs No regression against the pilot baseline; online scores tracked daily; defined rollback trigger
Full rollout Offline set run on every change, online scoring, periodic human audit Regression checks pass on every change; incidents become new cases within an agreed time

Rules for a design review:

  • Every eval set is built from real cases and covers every category the agent handles.
  • Safety, permission and injection cases are included, and the gate requires zero failures on them.
  • At least part of the eval set is held out and never used for tuning.
  • Any model-based grader has been compared with human ratings on your own data.
  • A change to the prompt, model, tools or retrieved data triggers the eval run before release.
  • If the agent has no eval set, it does not leave prototype.

Worked example. Suppose a new version of the claims agent is compared with the current one, using 50 cases per category. The pass counts are illustrative, not a customer result.

CategoryCurrent versionNew versionGate: not worse in any category
Standard claims48 of 5050 of 50Pass
Complex claims40 of 5046 of 50Pass
Fraud flags45 of 5041 of 50Fail

Across all three categories the new version scores higher overall (137 against 133 passes), so a single average would approve it. The gate blocks the release because fraud flags got worse. This is why the eval set must cover every category, and why the gate is set per category rather than on the average.

What to do in the next 30 days

  1. Assemble the first eval set. Owner: AI architect with the process owner. Outcome: real cases covering every category, plus hard cases and past incidents, with agreed expected results, by week one.
  2. Add trajectory capture. Owner: platform engineer. Outcome: every eval run stores its trace, with tool calls, steps and cost, by week two (see observability and tracing).
  3. Build the graders. Owner: engineering lead. Outcome: code checks for exact items, a human review process for quality, and any model judge compared with human ratings, by week three.
  4. Write the release gates. Owner: head of AI with risk and security. Outcome: a written gate for each stage, signed off by the accountable owner.
  5. Wire evals into change control. Owner: platform engineer. Outcome: no change to the prompt, model or tools reaches production without an eval run, in place by day 30.

Closing thoughts

Agents earn trust through evidence. Our practitioner's view is that a modest eval set built from real cases, run on every change, protects an enterprise more than a clever prompt ever will. The next and final post in the series looks at observability and tracing: how to see what your agent is doing in production, so that the evals, checkpoints and guardrails you have built keep working after launch. If useful, download the checklist below, or talk to our architects about an eval review for your agent.

Free checklist: Agent Evals Readiness Review

Download the Agent Evals Readiness Review checklist

A one-page, 13-point checklist your architects and risk team can use in the next design review.

Download PDF

Quick self-check

Tick the statements that are true for your agent today. The same checklist is available as a PDF above.

Eval set

Graders

Running evals

Release and learning

Frequently asked questions

What are evals for AI agents?

Evals are repeatable tests that run an agent on defined cases and score its behaviour against stated criteria. For agents, they should score the whole run, including which tools were called, how many steps were taken, what it cost and whether the agent handed off when it should, not only the final answer.

How do you test an AI agent before release?

Build an eval set from real cases covering every category the agent handles, add hard cases and safety tests, and run each case several times in a test environment with mocked or sandboxed tools. Score outcomes and trajectories, compare against a baseline and apply a written release gate.

Can you use an AI model to grade another AI model?

Yes, with care. Model-based judges scale well and can agree closely with human raters, but they also show biases such as favouring longer answers. Use code checks for anything with an exact answer, and compare any model judge with human ratings on your own cases before relying on it.

How often should agent evals run?

Run them on every change to the prompt, model, tools or retrieved data, and before every release stage. Also sample production runs continuously, since real use reveals cases the offline set did not include. Add each incident and rejected checkpoint to the eval set.

What is trajectory evaluation for AI agents?

Trajectory evaluation scores the path the agent took, not only its final answer: which tools it called, in what order, whether it stayed inside its permission scope, how many steps it took and what it cost. It matters when the agent uses tools or touches sensitive data, because a correct answer reached by a forbidden action is still a failure.

What is the difference between offline and online evals?

Offline evals run a fixed set of cases before release and on every change. Online evals sample real production runs and score them, which catches problems the offline set did not anticipate. Use both: offline for regression checks and release gates, online for what the set missed.

How big should an AI agent eval set be?

Big enough to cover every category the agent handles, including hard cases and cases that previously went wrong. Start small with real cases, hold some out so they are never used for tuning, and grow the set from incidents and rejected checkpoints. A set that stops growing stops protecting you.

References
  1. Yao et al., "tau-bench: A Benchmark for Tool-Agent-User Interaction in Real-World Domains" (2024)
  2. Zheng et al., "Judging LLM-as-a-Judge with MT-Bench and Chatbot Arena" (2023)

Scenarios and examples in this guide are illustrative, not customer cases. Thresholds and intervals are recommended starting points; calibrate to your environment. Last reviewed: October 2026.

Share

Put this into practice

Tell us about the workflow you want an agent to own. We map the controls, the failure modes and the measurement before any build starts.