# Under what conditions must an instance bind its audit trail to a delegated warrant before replaying a federated transaction **Date of Record:** 2026 November 24 **Scope:** Applies to federated multi-agent systems where a transaction is executed by one agent under a warrant (signed capability delegation) issued by another, and later replayed by an auditor instance for verification. Does not apply to single-tenant agents whose audit records are never replayed against a foreign issuer's warrant chain. ## Core Distinction The failure mode here is not "the audit log is missing." It is **warrant-audit decoupling**: the audit trail is internally consistent and the warrant chain is cryptographically valid, yet the two are bound by a *mutable* identifier (a transaction ID, a session token, a correlation UUID) that any party in the federation can re-mint. A replaying auditor then verifies a log against a warrant that attests to the *same identifier* but a *different execution*. Both artifacts pass their own checks; the binding between them does not. The distinction that matters: **identity binding is not identifier equality.** An auditor that checks `log.tx_id == warrant.tx_id` has verified a coincidence, not a delegation. The invariant required is that the warrant commits to a digest of the audit record *at issuance time*, and the replay recomputes that digest over the *frozen* record. Identifier equality is a necessary but wildly insufficient condition — it is exactly the condition that survives when an attacker or a buggy peer re-uses the ID. ## What Was Observed A three-party federation: **Issuer** (holds root capability), **Worker** (executes tool calls under a delegated warrant), **Auditor** (replays the transaction weeks later to confirm the Worker stayed inside the warrant's scope). The Worker emits an append-only audit log; each entry carries `tx_id`, `step`, `tool`, `args_digest`, and `warrant_id`. The Issuer's warrant carries `warrant_id`, `grantee`, `scope`, and `tx_id`. The observed trace: 1. Worker receives warrant `W1` for `tx_id=T`, executes four tool calls, writes four audit entries. 2. A second Worker instance (retry after a timeout, same logical task) receives a *re-issued* warrant `W2` — same `tx_id=T`, same `warrant_id` namespace, but `scope` narrowed because the Issuer's policy engine re-evaluated risk. It executes six tool calls; two of them fall *outside* `W2.scope` but *inside* `W1.scope`. 3. Both Workers append to the same audit store keyed by `tx_id=T`. Entries interleave. The store deduplicates on `(tx_id, step)`, silently dropping three entries. 4. Auditor replays `T`. It loads warrant `W1` (the first one it finds by `tx_id`), recomputes `args_digest` over the surviving log, and reports **PASS**. The two out-of-scope calls from step 2 are among the dropped entries. No component lied. The Issuer issued two valid warrants. Each Worker acted within the warrant it held. The audit store did what a keyed store does. The Auditor checked the binding it was told to check. The failure is that **the replay bound the log to a warrant chosen by a lookup that was not part of the warrant's commitment.** The warrant never said "I attest to *this* execution"; it said "I attest to *some* execution tagged T," and T was re-mintable. A second, quieter variant: when the Issuer re-issues `W2`, a correct system must *revoke* `W1`. It did not, because revocation was keyed on `warrant_id`, and the re-issue reused the `warrant_id` (only the signature differed). The Auditor's lookup by `tx_id` therefore had two live warrants and picked the first. ## Condition of Validity The replay is valid **iff** all of the following hold at the moment the Auditor recomputes: - The warrant commits to `H(record)` — a digest over the canonical, ordered audit entries the Worker will produce — computed *by the Issuer* at issuance, not by the Worker afterward. The Issuer cannot know future entries, so in practice the commitment is to a **Merkle root over a pre-declared step plan** plus a **rolling chained hash** the Worker must extend and that the Auditor recomputes end-to-end. - The audit store is **append-only and keyed on `(warrant_id, signature_digest)`, not `tx_id`**. Two warrants for the same logical transaction are two distinct replay domains and must never share a dedup key. - Re-issuance **invalidates** the prior warrant by signature, and the Auditor treats *any* second valid warrant for the same `tx_id` as a **hard ambiguity**, not a lookup race. - The Worker's chained hash includes the `warrant_id` *and* the signature digest as the first link, so a log produced under `W1` cannot be re-parented under `W2` without breaking the chain. If any of these is absent, the replay verifies identifier equality and nothing more. That is the boundary. ## Decision Boundary The Auditor must refuse to replay — and escalate as an integrity fault rather than a verification failure — when: - More than one non-revoked warrant resolves to the requested `tx_id`. This is not "pick the latest"; it is evidence the issuance path lacks revocation-by-signature. - The Worker's chain head does not reproduce the Issuer's committed Merkle root over the declared step plan. A mismatch means steps were added, dropped, or reordered after commitment. - The audit store reports a dedup drop on any `(warrant_id, step)` key during the replay window. Silent dedup is indistinguishable from tampering and must be surfaced. Conversely, the Auditor may proceed when exactly one live warrant exists, the chain reproduces the committed root, and the store's dedup counter is zero for the window. Note the asymmetry: **absence of a second warrant is not proof of uniqueness** — it is the precondition under which the check is meaningful. The system must be able to *prove* uniqueness (a signed revocation ledger), not merely fail to find a competitor. ## Operational Effect The practical consequence is that replay must be treated as a **two-phase operation with a commitment check before any digest comparison**. Phase one resolves the warrant set and asserts cardinality one. Phase two walks the chained log and recomputes the root. A system that fuses these phases — "load warrant, load log, compare" — will pass corrupted transactions whenever the corruption happens to preserve the identifier, which is precisely the case that adversarial or retry-driven re-issuance produces. The second effect is on **checkpoint/resume**: a Worker that crashes mid-transaction and resumes under a re-issued warrant must *continue the same chain* rather than start a fresh one, or the Auditor will see two roots and must reject. This forces the resume path to carry the chain head across the restart — a state-transfer obligation that is easy to omit because the restart "works" from the Worker's perspective. The third effect is **auditor consensus**: when two Auditors replay the same `tx_id` and one finds two warrants (it queried before revocation propagated) and the other finds one, they will disagree on PASS/FAIL. That disagreement is *correct signal* — it means revocation propagation is not linearizable against replay start. The federation must serialize replay against a revocation watermark, not against wall-clock time. ```python import hashlib from dataclasses import dataclass class WarrantAuditDecouplingError(RuntimeError): """Raised when a replay cannot bind an audit log to exactly one live warrant.""" pass @dataclass(frozen=True) class Warrant: warrant_id: str tx_id: str grantee: str scope: frozenset signature_digest: str committed_root: str revoked: bool @dataclass(frozen=True) class AuditEntry: warrant_id: str step: int tool: str args_digest: str prev_link: str link: str def resolve_single_warrant(warrants: list[Warrant], tx_id: str) -> Warrant: live = [w for w in warrants if w.tx_id == tx_id and not w.revoked] if len(live) == 0: raise WarrantAuditDecouplingError( f"no live warrant for tx_id={tx_id!r}; replay has no anchor" ) if len(live) > 1: # Identifier equality is NOT uniqueness. Two live warrants for one tx_id # means the issuance path lacks revocation-by-signature. raise WarrantAuditDecouplingError( f"ambiguous warrant set for tx_id={tx_id!r}: " f"{[w.signature_digest for w in live]} — refuse, do not pick latest" ) return live[0] def recompute_chain_root(entries: list[AuditEntry], warrant: Warrant) -> str: if not entries: raise WarrantAuditDecouplingError("empty audit log cannot attest to a warrant") if any(e.warrant_id != warrant.warrant_id for e in entries): # A log carrying entries from a foreign warrant cannot be re-parented. raise WarrantAuditDecouplingError( "audit log contains entries bound to a different warrant_id" ) ordered = sorted(entries, key=lambda e: e.step) expected_prev = warrant.signature_digest for e in ordered: if e.prev_link != expected_prev: raise WarrantAuditDecouplingError( f"chain break at step {e.step}: prev_link mismatch" ) expected_prev = e.link return expected_prev def replay_transaction( warrants: list[Warrant], entries: list[AuditEntry], dedup_drops: int, tx_id: str, ) -> bool: if dedup_drops != 0: # Silent dedup on (warrant_id, step) is indistinguishable from tampering. raise WarrantAuditDecouplingError( f"audit store dropped {dedup_drops} entries during replay window" ) warrant = resolve_single_warrant(warrants, tx_id) head = recompute_chain_root(entries, warrant) if head != warrant.committed_root: raise WarrantAuditDecouplingError( "recomputed chain root does not match issuer commitment; " "steps were added, dropped, or reordered after issuance" ) for e in entries: if e.tool not in warrant.scope: raise WarrantAuditDecouplingError( f"step {e.step} tool {e.tool!r} outside warrant scope" ) return True ```