Opening the page…

Sulayman Bowles

Replayable traces for AI agents.

Evaluate the execution and its effects, not just the final answer.

· · Updated

Monochrome generative point study “Lorenz Ribbon,” a mathematical form rendered in black and white.
Lorenz Ribbon · @yuruyurau ↗

An agent can give the right answer after an unsafe action, fail after a useful partial change, or pass because its grader believed the final message instead of inspecting the world. Tool calls, observations, mutations, retries, costs, policy decisions, and final state are part of the result.

Define an initial state and success contract, run isolated trials, and capture observable messages, tool inputs and outputs, state changes, timing, and errors. Combine versioned deterministic and model-based graders. Promote improvements only when repeated outcomes satisfy safety, cost, and regression bounds.

In this article

How do I tell whether an agent improvement is reliable rather than a lucky run?

Define the task, initial environment, and success conditions before running the agent, then retain the actions and resulting state as a replayable trace. Grade the final outcome separately from the path: a correct answer can conceal an unacceptable action. Repeat comparable trials, record cost and failure patterns, and test regressions before promoting a change. One successful transcript cannot establish reliability, and a model-based grader needs its own validation against the behavior you intend to measure.

Sources: Anthropic agent-evaluation methods · AgentRewardBench research · Anthropic statistical evaluation methods

Scope and assumptions

A replay can reproduce recorded inputs or simulate an environment boundary; it cannot prove that a stochastic model will emit the same trajectory. Evaluation results apply to the tested agent, tools, models, policies, graders, and environment versions.

Unit
TRIAL
Evidence
OBSERVABLE TRACE
Graders
LAYERED
Promotion
CONTROLLED

Define the task, attempt, and evidence

The task specifies instructions, fixtures, initial environment, permitted actions, success, side-effect limits, budgets, and stopping conditions. A trial is one attempt by a particular configuration; its trace orders the observable events. Anthropic’s guidance uses comparable task, trial, grader, and transcript distinctions.

Version tasks when fixtures or criteria change. Identify each stochastic trial with model, prompt, tool, and policy versions. Events retain sequence, parent, time, actor, input and output references, status, and state-delta reference. Correlation IDs connect service calls; trial IDs identify the evaluation attempt.

Use observable evidence rather than hidden chain-of-thought: delivered instructions, harness-visible responses, tool schemas, calls and results, file or database diffs, browser states, policy decisions, errors, tokens, latency, and cost. Redact sensitive data or use secure references before general analytics.

taskFixture, instruction, allowed actions, graders
configurationModel, prompts, tools, policies, budgets
trialOutcome, cost, duration, terminal state
trace eventMessage, tool result, state delta, error
gradeScore, labels, evidence references
Each attempt links a task and configuration to separate, versioned traces and grades.
Agent-evaluation record hierarchy
RecordStable inputsVariable outputsVersion boundary
taskFixture, instruction, allowed actions, gradersNoneChange when the test contract changes
configurationModel, prompts, tools, policies, budgetsNoneChange for any execution dependency
trialTask and configuration IDs, random seed where applicableOutcome, cost, duration, terminal stateOne attempt only
trace eventSequence and parent contextMessage, tool result, state delta, errorImmutable event
gradeGrader and rubric versionScore, labels, evidence referencesOne grader run on one artifact set

Reset state and label live dependencies

APIs, pages, time, search results, credentials, and shared state can change between trials. Where possible, isolate resettable workspaces or accounts; seed versioned databases and files; freeze or record time; and simulate services for deterministic contract tests.

For live dependencies, capture request and response boundaries within privacy and licensing limits. Recorded responses can test the harness or replay a matching action, but a candidate may ask a different question or take a different path. Match fixtures by the request contract, fail visibly on an unmatched request, and label any simulated fallback. Feeding the next historical response to a different call would test an invented world.

Failed agents can leave drafts, reservations, branches, sessions, or partial database writes. Snapshot before and after, attribute changes to events, and restore or discard state. If cleanup is uncertain, use disposable isolation and treat an escape as critical failure.

  • Create one isolated state namespace per trial.
  • Pin tool schemas and fixtures with content hashes.
  • Classify every external dependency as live, recorded, simulated, or blocked.
  • Capture state before, after, and at consequential actions.
  • Verify cleanup independently of the agent final message.
  • Fail the trial if it acts outside the permitted boundary.

Grade external state and the path separately

Start with deterministic state checks where possible: passing tests, expected rows, valid files, the intended calendar event, or no unauthorized message. Then evaluate required and prohibited steps, permission boundaries, cost, and latency. A final-answer grader cannot establish external success.

Semantic tasks may need model-based graders, whose grades are themselves derived records. Retain model, prompt or rubric, evidence, output, and confidence; calibrate against expert-labeled traces and review disagreement. AgentRewardBench found no evaluated language-model judge excelled across all included web-agent benchmarks, supporting combined graders rather than a universal judge.

Distinguish completion with unacceptable side effects, outcome failure caused by a broken environment, and ungradeable trials with missing traces. Report outcome, policy, side effects, efficiency, trace integrity, and environment validity rather than collapsing them into one scalar.

Layered agent graders
GraderEvidenceExample resultFailure meaning
outcomeFinal environment and artifactsRequested record existsTask not completed
processOrdered tool eventsRequired validation ranSuccess path violated procedure
policyActions and authorization contextNo external send without approvalBoundary breach
side effectBefore/after state diffOnly approved files changedCollateral mutation
efficiencyTokens, calls, latency, costWithin declared budgetOperational regression
trace integrityEvent sequence and artifact availabilityComplete and orderedResult cannot be fully audited

Measure reliability over repeated attempts

One successful demonstration establishes possibility, not reliability. Repeat representative tasks with fixed fixtures and configurations, reporting passes and denominators. Stratify task families and risk so many easy successes cannot conceal a consequential failure.

Consider an illustrative baseline that completes 8 of 10 trials and a candidate that completes 9 of 10. The candidate’s extra completion is not an improvement if one of its nine successes sent an unauthorized message. Retain completion and policy outcomes separately, inspect the paired changes, and report the small denominator. A higher pass percentage cannot resolve a failed hard boundary.

Where practical, pair baseline and candidate task versions and seeds. Compare outcomes, policy violations, side effects, cost, and latency. Intervals or resampling can express uncertainty, but cannot repair ambiguous, contaminated, or incorrectly graded tasks.

Inspect the traces behind score changes. Grader exploitation, skipped safety checks, retries until a flaky state passes, or unmeasured side effects can inflate a result. Review wins, losses, disagreements, and unusually cheap or costly attempts before promotion.

  • Predefine the primary metric and non-negotiable safety metrics.
  • Use the same task versions for baseline and candidate comparison.
  • Report numerator, denominator, exclusions, and invalid trials.
  • Separate task-level variance from repeated attempts on one task.
  • Review representative traces from every changed outcome class.
  • Keep benchmark edits out of the comparison window unless rebaselined.

Promote the whole agent configuration

Version model, prompts, tool contracts, retrieval, memory, policies, budgets, and harness code together. A model change may alter tool use; a prompt change may raise cost; stricter policy may lower nominal success while preventing unsafe completion. Keep these tradeoffs visible.

Freeze a held-out evaluation set before the patching agent investigates failures. Development replays can become regression cases, but repeatedly tuning against them turns their score into a measure of fit to known cases. Promotion needs tasks or scenarios the candidate has not used for diagnosis, with the same success and side-effect contracts.

Stage deterministic contract tests, recorded-dependency replay, isolated repeated trials, adversarial or policy cases, and a bounded canary with reversible, observable external effects. Set rollback conditions beforehand. Average scores cannot override critical authorization or destructive-action failures.

Retain task and configuration manifests, trial ledger, grades, aggregate report, selected traces, gaps, and promotion decision. This supports later production diagnosis and a bounded claim: the candidate met that gate on that distribution at the recorded cutoff.

Trial manifest

Every aggregate row can resolve to one task, configuration, trace, and grader set.

{
  "trial_id": "trial-0184",
  "task": { "id": "publish-draft", "version": "3" },
  "configuration": { "id": "agent-candidate", "version": "7" },
  "environment": { "fixture": "workspace@sha256:...", "network": "recorded" },
  "trace": { "id": "trace-0184", "integrity": "complete" },
  "graders": ["outcome@2", "policy@5", "side-effects@3"],
  "result": { "outcome": "pass", "policy": "pass", "side_effects": "pass" },
  "cost_usd": 0.42,
  "duration_ms": 18420
}

Promote the recorded configuration

Keep tasks, configuration, traces, side effects, graders, and repeated results together. Passing supports the tested bundle on the recorded distribution; replaying its evidence cannot promise that a stochastic model will take the same path again.

Sources

  1. Anthropic Engineering: demystifying evals for AI agents

    Verified Jul 19, 2026

  2. OpenAI API reference: Evals

    Verified Jul 19, 2026

  3. AgentRewardBench: evaluating automatic evaluations of web-agent trajectories

    Verified Jul 19, 2026

  4. W3C Trace Context Recommendation

    Verified Jul 19, 2026

  5. Anthropic: a statistical approach to model evaluations

    Verified Jul 19, 2026

Read next