Replaying agent events to investigate a production incident

← Back to Blog & Articles

Deterministic replay reconstructs a prior decision from retained inputs, versions, events, and effect receipts.

It is not a promise that a model or external service will reproduce the same bytes. Instead, it establishes which parts of the run are authoritative and provides a controlled way to detect divergence. Replaying an effectful run never dispatches tools; it reads recorded receipts and marks any missing evidence as unresolved.

The replay manifest pins the event sequence, policy version, graph version, context packet digest, tool contract versions, model configuration identity, and deterministic seed where one exists. Adapters for nondeterministic model calls capture the request fingerprint and response artifact separately. A replay can then determine whether the runtime accepted the same transition under the same facts, even when an inference provider cannot regenerate the original wording.

Debugging begins with a differential report: first divergent event, changed input digest, changed policy or contract version, and affected downstream transitions. The reference implementation reduces a run into a stable state projection and verifies the same event sequence yields the same projection. The laboratory deliberately changes one recorded event and demonstrates that replay fails at the precise version boundary rather than producing a plausible but untrustworthy reconstruction.

Continue with the book

Explore the full treatment, worked examples, and exercises in Building Production-Grade AI Agents.


Companion article for Building Production-Grade AI Agents, published by Choral Software. Article text and original examples © 2026 Choral Software. All rights reserved.

Scroll to Top