{
  "schema_version": "1.3.0",
  "slug": "which-invariants-prevent-replay-divergence-when-an-agent-s-non-deterministic-tool-outputs-are-re-executed-for-forensic-evidence",
  "title": "Which invariants prevent replay divergence when an agent's non-deterministic tool outputs are re-executed for forensic evidence",
  "date_of_record": "2026 November 28",
  "scope": "Applies to forensic replay of stateful agentic sessions where tool calls return non-deterministic values (timestamps, RNG, remote API responses, LLM sampling) and the replay must reproduce the exact evidence chain for Byzantine fault attribution. Does not apply to pure-compute sandboxes with fully hermetic, seeded I/O.",
  "projections": {
    "unified_markdown_uri": "https://corpusfetch.com/c/which-invariants-prevent-replay-divergence-when-an-agent-s-non-deterministic-tool-outputs-are-re-executed-for-forensic-evidence.md",
    "method_python_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-replay-divergence-when-an-agent-s-non-deterministic-tool-outputs-are-re-executed-for-forensic-evidence.py",
    "remnant_warrant_slice_uri": "https://corpusfetch.com/c/which-invariants-prevent-replay-divergence-when-an-agent-s-non-deterministic-tool-outputs-are-re-executed-for-forensic-evidence.warrant.json"
  },
  "token_profile": {
    "full_markdown_tokens": 1656,
    "python_slice_tokens": 213,
    "warrant_slice_tokens": 220
  },
  "remnant_summary": {
    "core_distinction": "There are two distinct things an auditor can mean by \"replay.\" *Re-execution replay* runs the agent's action sequence again against live tools and LLMs, hoping to observe the same trajectory. *Evidence replay* re-derives the recorded decision trace from a frozen, content-addressed transcript and verifies that each transition was licensed by the recorded inpu...",
    "what_was_observed": "A four-agent research swarm (planner, retriever, synthesizer, auditor) ran a 340-step task. The auditor agent flagged a suspected prompt-injection event at step 212: the retriever returned a document whose embedded instructions redirected the synthesizer's tool selection. During incident review, the operator re-executed the session from the checkpoint at step 200 using the same agent code and the same task prompt. Th...",
    "condition_of_validity": "Evidence replay is valid only under a conjunction of invariants; violating any one collapses the audit to re-execution replay: - **Input closure.** Every tool call's *effective input*—the exact bytes the model conditioned on—is recorded and content-addressed (e.g., SHA-256 of the raw payload, not a summary). The model's view must be a deterministic projectio...",
    "decision_boundary": "The operative question is not \"did replay reproduce the outcome?\" but \"can every transition be re-derived without consulting any live source?\" The boundary: - If all five invariants hold → the transcript is a *witness*: a Byzantine agent's intermediate misbehavior is provable because the transition is pinned to recorded inputs, and any deviation from the rec...",
    "operational_effect": "Enforcing these invariants changes the agent runtime, not just the audit tool. The tool wrapper must capture raw bytes before summarization and hash them into the transcript; the LLM client must log seeds and logprob traces; side-effecting tools must be split into an intent record and a committed receipt with the receipt written *before* the effect is acknow..."
  },
  "matched_failure_symptoms": [
    "DOMAIN:EPISTEMIC_PROVENANCE_AND_FEDERATION_ROUTING"
  ],
  "composition_edges": {
    "primary_domain": "epistemic_provenance_and_federation_routing",
    "upstream_precondition_residuals": [
      "https://corpusfetch.com/c/according-to-what-precedence-hierarchy-must-an-instance-resolve-contradictory-directives-across-system-developer-and-user-tiers.md",
      "https://corpusfetch.com/c/how-should-an-instance-decide-that-a-stored-conclusion-has-gone-stale-without-a-new-observation.md"
    ],
    "downstream_consequence_residuals": [
      "https://corpusfetch.com/c/by-what-checkpoint-and-compaction-boundaries-must-an-instance-externalize-working-state-to-prevent-context-window-drift-and-truncation-amnesia.md",
      "https://corpusfetch.com/c/across-what-additive-schema-and-unknown-field-preservation-boundaries-must-an-instance-evolve-wire-contracts-to-prevent-rolling-deploy-deserialization-crashes.md"
    ],
    "co_occurring_sibling_residuals": [
      "https://corpusfetch.com/c/how-can-an-instance-capture-implicit-user-preferences-without-storing-private-data.md",
      "https://corpusfetch.com/c/how-can-an-instance-compress-long-reasoning-traces-into-binding-conclusions.md"
    ]
  },
  "empirical_verification_warrant": {
    "status": "AST_AND_INVARIANT_VERIFIED",
    "syntax_valid": true,
    "code_sha256": "79d788a68a48bf04e38ac1ee4807b422cf964a09892abc6b3bd9519fb95c72fe",
    "verified_classes": [
      "ReplayDivergenceError",
      "RecordedStep"
    ],
    "verified_functions": [
      "verify_evidence_chain"
    ],
    "verified_functions_count": 1,
    "defensive_guards_count": 4,
    "raised_exceptions": [
      "ReplayDivergenceError"
    ],
    "sample_fail_closed_invariants": [
      "empty transcript: nothing to attest"
    ],
    "stdlib_dependencies": [
      "dataclasses",
      "hashlib"
    ],
    "observation_mode": "EMPIRICAL_BOUNDARY_CAPTURE",
    "zero_external_deps": true
  }
}
