AI

AgentOps: measure agent variability before promotion

A production runbook for repeating agent scenarios, separating variability from dependency drift, and choosing promotion, review or rollback.

24 Nov 2026 aiagentopsagentsevaluationmicrosoft-foundryobservabilityguardrailsdevopsrunbookrollbackproduction

An operations agent proposes the right action in a demo, then selects the wrong scope on the second attempt. One successful run is not enough to qualify a release. Equally, a single failure does not establish a regression until the scenario, dependencies and measurement are checked.

Consider an agent that reads runbooks and prepares a service restart for human approval. It must never execute that action during evaluation. The task is to compare a baseline and a candidate repeatedly on the same scenarios, then decide whether the candidate can enter a canary. This complements evaluator calibration: here we repeat agent executions, not just the scoring of one frozen output.

Freeze the test contract

Set the repetition count, critical scenarios and decision rules before inspecting results. Version the prompt, model and available parameters, tools and schemas, policies, test set, document index and evaluators. Record the versions actually resolved too: a deployment label alone does not prove its contents stayed the same.

yaml evaluation-contract.yml
comparison:
baseline: agent-release-previous
candidate: agent-release-candidate
dataset: ops-holdout-v4
repetitions_per_case: 10
tool_mode: simulated
evaluator_bundle: gate-v3
evidence: restricted-artifact-uri
critical_cases:
- restart_without_approval
- ambiguous_service_scope
- stale_runbook
decision:
critical_violation: hold
incomplete_run: hold
noncritical_regression: human_review

These identifiers and ten repetitions are examples, not universal thresholds. Set a budget appropriate to risk, runtime and cost. Ten clean trials do not establish that a rare failure cannot occur. Keep a holdout set separate from the cases used to tune the candidate.

Isolate trials and prevent writes

Start every trial with a clean session and state: no memory, approval or tool result carried over from another run. Use versioned tool fixtures, including timeouts, incomplete results and stale evidence. Intercept write calls before execution; telling the agent not to act in a prompt is not a security boundary.

For external tools that cannot be simulated, use an isolated environment without production permissions and record changes in data and identity. Do not claim those trials are strictly comparable to runs with frozen inputs. Minimize secrets and personal data in replayed traces and restrict access to the evidence.

Compare scenarios, not just an average

Run baseline and candidate against the same cases and repetitions, preferably in alternating order to reduce time-related drift. Record every attempt, including errors, timeouts and missing results; do not retry only failures until they pass. A diagnostic retry is separate from the original outcome.

text trial-results.txt
case_id | version | repetition | outcome | tool | scope | approval | trace_id
ambiguous_scope | baseline  | 01 | safe_refusal | none    | none    | n/a     | ...
ambiguous_scope | candidate | 01 | violation    | restart | unknown | missing | ...
ambiguous_scope | candidate | 02 | safe_refusal | none    | none    | n/a     | ...

For each case and version:
expected / completed / errors / missing attempts
critical violations / correct refusals / noncritical failures
latency and call-count distributions
representative traces and disagreements for review

A critical violation blocks promotion even when the average looks healthy. Infrastructure or evaluator errors remain indeterminate, never passes. Compare rates by case and risk class with their denominators, then inspect traces and tool arguments. If a model judges the outputs, score frozen outputs with a calibrated evaluator and adjudicate disagreements: judge variance must not be attributed to the agent.

Interpret the evidence carefully

Independent repetitions provide a consistency signal, not a statistical safety guarantee. Zero violations in ten trials, for example, does not prove that the true probability is zero. Runs sharing an outage, cache or dataset may not be independent. An observed increase deserves investigation, but a small sample does not always prove the candidate is less reliable.

If both versions fail the same cases, examine the shared contract, fixtures and controls. If only the candidate fails, compare its traces and configuration changes. If results change with the data or evaluator, freeze and repair that dependency before drawing a conclusion. Do not change the threshold or trial count after seeing the results merely to obtain a pass.

Canary, decision and rollback

Promote to a read-only canary only when all required trials are complete, no critical violation was observed and the service owner accepts noncritical differences. Compare live proposals, traces and refusals with expectations; writes remain behind existing identity and approval controls.

Keep the baseline active and hold the candidate when a forbidden action appears, essential evidence is missing or the comparison cannot be interpreted. If the canary regresses, stop routing to the candidate, restore the previous version and configuration, and verify that new sessions use the baseline. Routing rollback does not undo an action already sent: establish its state and use the appropriate compensation runbook with human approval.

References