# In what scenarios must an instance treat a tamper-evident audit log as non-authoritative for replay verification **Date of Record:** 2026 November 24 **Scope:** Applies to multi-agent workflows where each agent action is appended to a hash-chained (or Merkle-anchored) audit log used for post-hoc replay verification under regulatory audit. Does not apply to single-agent, non-regulated logging, nor to logs used solely for observability/debugging where replay correctness is not asserted. ## Core Distinction A tamper-evident log proves *integrity of the record* — that no byte was altered after append — but it does **not** prove *determinism of the recorded computation*. The critical confusion is treating hash-chain integrity as replay authority. An auditor who replays a chain-valid log and gets a divergent output concludes either (a) the log was tampered (false — the chain is intact) or (b) the agent is nondeterministic (true but unactionable). The real failure is that the log records *inputs and final outputs* but omits the **environmental witness set** — the model version, sampling seed, tool-response payloads, and retrieval corpus snapshot — that a faithful replay requires. A hash chain over an incomplete witness set is a tamper-evident record of an unreproducible event. The invariant that must hold: *a log entry is replay-authoritative only if its witness set is closed* — i.e., every nondeterministic input that affects the recorded output is itself captured and chained. When the witness set is open, the log is integrity-valid but replay-invalid, and an instance must refuse to treat it as a source of truth for verification. ## What Was Observed A three-agent regulated workflow (intake → adjudication → compliance sign-off) produced hash-chained logs with per-entry `prev_hash`, `agent_id`, `tool_calls`, and `output_digest`. During a regulator-mandated replay, the adjudication agent's entries replayed to a *different* `output_digest` in 4 of 220 entries. The chain verified clean end-to-end. Investigation showed the divergence clustered on entries where the agent had called a retrieval tool whose backing index had been re-embedded between original execution and replay. The log recorded the *query string* and the *top-k result digests* but not the *index version hash*. The retrieval corpus was a nondeterministic input that was outside the witness set. The chain was honest; the replay was impossible. A second, subtler trace: two entries diverged because the model endpoint had silently rolled the served model revision (same alias, new weights) overnight. The log recorded `model: "adjudicator-v3"` (an alias) rather than an immutable revision digest. The alias was stable; the weights were not. Integrity held; provenance of the *model* did not. ## Condition of Validity A hash-chained log entry is replay-authoritative **iff** all of the following are chained within the same entry (or a causally prior entry referenced by hash): 1. **Model revision digest**, not a mutable alias — the immutable weights checksum. 2. **Decoding parameters** affecting sampling: temperature, top-p, seed, and the exact sampler implementation version. 3. **Tool-response payload digests** for every tool call, including retrieval corpus/index version hash — not merely the query. 4. **Prompt template digest**, including system prompt and any injected context, since template drift changes output. If any of these is absent, the entry is *integrity-valid but replay-open*. The instance must classify it accordingly and must not assert replay equivalence. Note the asymmetry: a closed witness set guarantees replay *possibility*; it does not guarantee replay *equality* if the serving stack itself drifted — so replay must be executed against a pinned stack whose digest is also in the witness set. ## Decision Boundary The boundary is between *verifying the record* and *verifying the computation*. When an auditor or verifier agent requests replay, the instance must: - If witness set is closed **and** the replay stack digest matches → assert replay-authoritative; divergence is a genuine tamper/nondeterminism signal and must escalate. - If witness set is open (any of the four elements missing) → **refuse to assert replay equivalence**. Emit a `ReplayOpenWitnessError`, mark the entry `replay_status=UNVERIFIABLE`, and route to manual attestation. Do **not** silently fall back to "chain valid ⇒ trustworthy." - If witness set is closed but replay stack digest mismatches → the divergence is an *environmental* artifact, not evidence of tampering; classify as `STACK_DRIFT` and re-pin, never as `TAMPER`. The failure mode this prevents: an automated compliance agent treating chain-validity as a proxy for correctness, passing a divergent replay as "verified," and thereby laundering a genuine nondeterminism (or a real tamper that occurred *before* the chain, e.g., a poisoned retrieval index) into an attested-clean record. ## Operational Effect Downstream, the audit pipeline must carry a tri-state per entry: `REPLAY_VERIFIED`, `STACK_DRIFT`, `UNVERIFIABLE`. Only `REPLAY_VERIFIED` may feed automated sign-off. `UNVERIFIABLE` entries require a human attestation step and are quarantined from the compliance aggregate. This converts a silent integrity-for-correctness substitution into an explicit, auditable refusal — the correct behavior when provenance is provably intact but reproduction is provably impossible. The cost is throughput on retrieval-heavy and alias-pinned entries; the benefit is that the audit log's claim is narrowed to what it can actually support: *this is what was recorded, and here is the closed witness set that would let you re-derive it — or an explicit statement that you cannot.* ```python from dataclasses import dataclass, field from typing import Optional class ReplayOpenWitnessError(RuntimeError): """Raised when a hash-chain-valid entry lacks a closed witness set and therefore cannot be asserted as replay-authoritative.""" pass class StackDriftError(RuntimeError): """Raised when witness set is closed but replay stack digest mismatches; divergence is environmental, not evidence of tampering.""" pass @dataclass class WitnessSet: model_revision_digest: Optional[str] = None # immutable weights checksum decoding_params_digest: Optional[str] = None # temp/top-p/seed/sampler ver tool_response_digests: dict = field(default_factory=dict) retrieval_index_digest: Optional[str] = None prompt_template_digest: Optional[str] = None def is_closed(self) -> bool: return all([ self.model_revision_digest, self.decoding_params_digest, self.retrieval_index_digest, self.prompt_template_digest, ]) and bool(self.tool_response_digests) @dataclass class AuditEntry: entry_id: str chain_valid: bool # hash-chain integrity verified witness: WitnessSet replay_stack_digest: Optional[str] = None pinned_stack_digest: Optional[str] = None def classify_replay(entry: AuditEntry) -> str: # Integrity is necessary but never sufficient for replay authority. if not entry.chain_valid: return "CHAIN_BROKEN" # genuine tamper signal if not entry.witness.is_closed(): raise ReplayOpenWitnessError( f"entry {entry.entry_id}: chain valid but witness set open " f"(missing model/decoding/retrieval/prompt digest); " f"replay equivalence cannot be asserted" ) if entry.replay_stack_digest != entry.pinned_stack_digest: raise StackDriftError( f"entry {entry.entry_id}: witness closed but replay stack " f"{entry.replay_stack_digest} != pinned {entry.pinned_stack_digest}; " f"classify STACK_DRIFT, not TAMPER" ) return "REPLAY_VERIFIED" def audit_batch(entries): results = {} for e in entries: try: results[e.entry_id] = classify_replay(e) except ReplayOpenWitnessError as err: results[e.entry_id] = "UNVERIFIABLE" # quarantine for human attestation except StackDriftError: results[e.entry_id] = "STACK_DRIFT" # re-pin, do not escalate as tamper return results ```