Agent Evaluation

Online Evaluation for AI Agents: Experiments and Guardrails

Evaluate AI agents on real traffic with stable assignment, mature outcomes, safety guardrails, trustworthy telemetry, and planned statistical decisions.

· · 7 min read

Prepared with AI research assistance. Sources are linked throughout; worked examples are illustrative unless stated otherwise. Editorial approach.

Online evaluation asks whether an AI agent improves real outcomes under production conditions. That requires more than reviewing a sample of convincing responses. The evaluation must connect an assigned system version to an eligible task, preserve failed and abandoned runs, wait for outcomes to mature, and distinguish operational containment from evidence of improvement.

This guide develops a hypothetical support-agent experiment. Its thresholds, schedules, and numbers are illustrative design choices, not a tested deployment or a sample-size recommendation.

Separate deployment safety from product improvement

A canary exposes a limited population to a change and evaluates whether rollout should continue. Google's SRE guidance defines this as a partial, time-limited deployment with evaluation integrated into release decisions. It also discusses attribution and isolation problems when populations share infrastructure. Google SRE: Canarying Releases.

For an agent, a canary can catch malformed tool requests, runaway loops, elevated latency, or unexpectedly high spending. It usually cannot establish that customers receive better resolutions, especially when the canary is small and outcomes take days.

Use two explicit decision tracks. An operational track can stop exposure when a serious invariant fails. A product experiment estimates an outcome difference using a planned population, observation window, and analysis. Passing the operational track permits more observation; it does not establish product benefit.

A shadow run can inspect production inputs without returning its answer to the customer. Prevent its tools from creating effects, including hidden writes such as sending analytics-triggered emails. Shadow evaluation helps compare proposed decisions, but cannot directly measure how a real customer reacts to the proposed experience.

Choose the assignment unit around shared state

Suppose a customer contacts support three times about one order. Assigning each model call independently could expose the same case to two policies. One variant may inherit a promise made by the other, obscuring which system produced the eventual result.

In this illustrative design, assign the entire support case before the first eligible agent action. Persist the assignment and keep retries, handoffs, and follow-up messages with that variant. Define eligibility before any behavior that the treatment can change.

Case-level assignment still may be insufficient. If an agent updates account memory used by other cases, randomize at the account level or isolate that memory. If agents compete for a shared human review queue, treatment load can change control waiting time. Isolation, capacity reservations, or a different experiment design may be necessary.

The review Statistical Challenges in Online Controlled Experiments discusses interference between treatment and control, including cluster randomization and its reduced effective sample size. This supports treating shared effects as an experimental-design issue rather than assuming that more requests provide more independent observations. Read the research review.

Record assignment, exposure, and outcomes separately

Assignment means a case belongs to a variant. Exposure means the changed behavior actually reached it. Outcome means the specified task result became observable. These events can occur at different times and must not collapse into one success flag.

A proposed event contract includes:

Event Required evidence Common failure
Assignment Experiment version, unit ID, eligibility rule, assigned variant Reassigning on retries
Exposure Assignment ID, actual workflow version, first affected action Logging only after successful completion
Task outcome Case ID, outcome definition, observation cutoff Missing abandoned runs
Safety event Action ID, policy check, verified external effect Treating a model's statement as execution truth

Join outcomes through stable identifiers instead of matching response text. Store the workflow, prompt, model configuration, retrieval snapshot strategy, and tool contract versions. If those change during the experiment, identify the affected population and decide whether the result still answers the original question.

Avoid making every trace available to every analyst. An experiment ledger can reference access-controlled evidence rather than copying sensitive customer conversations. Agent observability and tracing explains how diagnostic records differ from low-cardinality metrics.

Define outcomes that resist convenient shortcuts

For the support example, the primary outcome might be a correctly resolved case without reopening within seven days. That definition needs an operational rubric: a closed ticket alone is not enough if the agent merely persuaded the customer to leave.

Use distinct outcome classes such as verified resolution, unresolved escalation, abandonment, incorrect resolution, and still pending. Measure human repair work, including cases handled after the agent's final message. Otherwise, an agent can appear efficient by transferring invisible cleanup to another team.

Keep guardrails separate from the primary benefit metric. Candidate guardrails include unauthorized effects, cross-account access attempts that reached a backend, severe factual errors, long-running loops, and cost per eligible case. Some require deterministic checks; others require blinded, sampled review with a documented rubric.

A lower escalation rate is ambiguous: it may indicate better automation or failure to ask for help. Similarly, a higher approval acceptance rate can reflect a worse review interface. Evaluate the business outcome and inspect the mechanisms behind movement in proxy metrics.

Wait for comparable outcome maturity

Imagine the control's cases have seven days of follow-up, while newly enrolled treatment cases have only one. Comparing their reopening rates biases the result toward the less mature population.

In the proposed design, enroll cases through a fixed cutoff and evaluate seven-day outcomes only after both arms have the same opportunity for follow-up. Maintain an explicit pending category. If an analysis excludes immature cases, apply the same eligibility logic to both arms and disclose the remaining denominator.

Do not claim that a seven-day metric proves long-term satisfaction. The research review notes that short-term and long-term treatment effects can differ, and that long-term estimation introduces its own identification and measurement challenges. The practical implication here is to label the observed horizon honestly and retain follow-up monitoring after rollout.

A hypothetical experiment and its interpretation

Assume 2,000 mature cases are assigned to each arm. The control records 1,440 accepted resolutions and the candidate records 1,500: 72% versus 75%, a difference of three percentage points.

Under a simplified independent-Bernoulli approximation, the standard error of the difference is approximately the square root of (0.72 × 0.28 / 2000) + (0.75 × 0.25 / 2000), or 1.4 percentage points. An approximate fixed-horizon 95% interval is therefore about 0.3 to 5.7 percentage points.

These arithmetic assumptions are intentionally simplified. Account clustering, missing labels, unequal exposure, or a different prespecified analysis can change the uncertainty. The calculation is an illustration, not authorization to ship.

Suppose the candidate also creates two confirmed unauthorized refunds. A positive resolution difference does not offset those events if the release contract forbids them. Stop the affected capability, investigate effects, and keep the experiment's product estimate distinct from the safety decision. Agent incident response covers containment and reconciliation after real actions have occurred.

Detect instrumentation failures before reading uplift

Microsoft describes sample ratio mismatch as a discrepancy between configured and observed variant proportions that can reveal assignment, execution, logging, or analysis defects. Its guidance emphasizes diagnosing the cause before trusting the outcome comparison. Microsoft Research: Diagnosing Sample Ratio Mismatch.

For this agent experiment, compare assigned-unit counts, exposure counts, missing-outcome rates, and join failures by arm. A failed tool call must not prevent an exposure event from being recorded. A candidate that times out more often must not disappear from the denominator.

Run an A/A check before a consequential A/B rollout: send equivalent variants through the complete assignment and measurement pipeline. Inspect both aggregate and prespecified segment results. A clean A/A exercise is useful evidence about instrumentation, although it does not prove that every future treatment will preserve that instrumentation.

Decide how repeated looks affect the conclusion

Watching an operational dashboard continuously is sensible. Repeatedly applying an ordinary fixed-horizon significance test and stopping at the first favorable result changes its error behavior.

Johari, Pekelis, and Walsh develop always-valid inference for decisions made while monitoring an experiment. Their work provides a statistical framework for such stopping, rather than permission to peek using any familiar p-value calculation. Always Valid Inference.

Choose a fixed analysis horizon or a suitable sequential procedure before interpreting benefit. Specify the primary comparison, meaningful effect size, observation horizon, multiplicity handling, and treatment of unresolved cases. A safety stop can remain immediate while the team correctly declines to call an immature experiment a product win.

Frequently asked questions

Can online evaluation replace offline tests?

No. Offline tests can expose known failure classes without subjecting customers to them. Online evaluation addresses production distributions, customer responses, and operational interactions that a fixed dataset may miss. Use both, and turn important production failures into regression cases.

How much traffic should receive a new agent?

Choose exposure using potential harm, detection delay, recovery ability, and the evidence needed for the decision. A universal percentage ignores those constraints. A tiny canary can detect a severe deterministic defect while remaining too small to estimate a rare outcome reliably.

What if there is too little traffic for a useful A/B test?

Report the uncertainty instead of forcing a winner. Combine careful offline evaluation, bounded pilots, adjudicated case review, and operational monitoring, while distinguishing those observations from a sufficiently powered causal comparison.

Source reference list

AI Agent Evaluation
Online Experiments
A/B Testing
Agent Reliability