# Why does an instance's signed tool-call warrant decay into a replayable forgery when the nonce ledger and the effect ledger are committed in separate epochs? **Date of Record:** 2026 November 28 **Scope:** Applies to agents that emit cryptographically signed tool-call warrants (agent identity + intent hash + nonce + TTL) and that rely on an append-only audit ledger to enforce replay resistance across retries, handoffs, and crash-resume. Does not cover transport-level TLS/mTLS concerns or purely local sandboxing without an external ledger. ## Core Distinction There are two things an auditor wants from a signed tool call, and they are not the same: 1. **Provenance** — *this specific instance, holding this specific key, authorized this specific intent-hash at this specific point in its reasoning trace.* Provenance is a property of a signature over a canonical payload. 2. **Replay resistance** — *this exact (agent, intent, nonce) tuple has never before produced an external effect, and will never produce one twice.* Replay resistance is a property of a **monotonic ledger**, not of the signature. The failure mode in scope lives in the seam between them. A warrant can be perfectly signed, perfectly valid, and still be replayable — because the ledger that is supposed to reject the second application commits the *nonce* in a different epoch than the ledger that commits the *effect*. The signature proves the instance *was allowed* to act. It proves nothing about whether the act *already happened*. When those two facts are persisted non-atomically, an instance that crashes between "nonce burned" and "effect recorded" (or the reverse) can resurrect a warrant whose signature still verifies but whose effect already fired — or fire an effect whose nonce was never burned, enabling a second firing under the same warrant. ## What Was Observed An orchestrator agent (`orch-a`, Ed25519 key `K_a`) issues a signed warrant to a worker for a high-consequence tool call: ``` payload = {agent: "orch-a", tool: "payments.transfer", intent_hash: H(args), nonce: n_7f3a, ttl: 90s} warrant = Sign(K_a, canonical(payload)) ``` The worker's execution path, as deployed, was: ``` 1. verify(warrant, K_a.pub) -> ok 2. ledger_nonce.append(n_7f3a) [commit A] -> ok 3. call payments.transfer(args) -> 200 OK, effect fired 4. ledger_effect.append(warrant_id) [commit B] -> CRASH before commit ``` The worker process died at step 4 (OOM during ledger fsync). On restart, the supervisor replayed the task queue. The warrant was still in the queue with a live TTL (78s remaining). The worker re-ran: ``` 1. verify(warrant) -> ok 2. ledger_nonce.append(n_7f3a) -> REJECTED (duplicate nonce) ``` The duplicate-nonce rejection **aborted the replay** — but the abort path was written to treat any nonce rejection as "already completed, skip." It did not consult `ledger_effect`. Because commit B never landed, `ledger_effect` had no record. The reconciler, running a separate sweep, saw "nonce burned, no effect recorded" and classified the warrant as **orphaned-unauthorized**, reopening it for re-issuance under a *fresh* nonce `n_9c11`. The fresh-nonce warrant re-fired the transfer. Net effect: **two transfers, one intent, both warrants verifying cleanly, both nonces burned exactly once.** The audit ledger is internally consistent and provably wrong about reality. The inverse variant was also reproduced: when commit A fails but commit B succeeds (effect fired, nonce never burned), the warrant remains replayable for the full TTL window and *will* be re-fired by any retry loop that trusts signature validity alone. There the ledger says "effect recorded, nonce unknown," which the reconciler classified as a **forged effect** and quarantined — but the money had already moved. ## Condition of Validity The invariant that was silently assumed but never enforced: > **For every warrant `w`, `ledger_effect.contains(w.warrant_id) == ledger_nonce.contains(w.nonce)` must hold at every quiescent point, and the transition from `(¬nonce ∧ ¬effect)` to `(nonce ∧ effect)` must be atomic with respect to crash.** This holds only when: - nonce burn and effect record are committed in **one durable transaction** (same log record, same fsync boundary), or - the effect is **idempotent under `warrant_id`** at the external system, so a double-apply is a no-op, or - a **reconciliation protocol** exists that can distinguish "nonce burned, effect not yet fired" (safe to retry with *the same* nonce) from "nonce burned, effect fired, record lost" (must not retry, must recover the effect record from the external system's own idempotency key). The deployment in question had none of the three. It had a signature check, which is the one thing that does not help here. Signature validity is invariant across all four states of `(nonce, effect)` — that is precisely why it cannot be used to decide among them. The boundary is sharp: this failure **does not occur** when the tool is read-only (no external effect to double-fire) or when the external system honors a caller-supplied `Idempotency-Key = warrant_id` (double-apply collapses). It **does occur** whenever the tool has a non-idempotent external side effect *and* the ledger commits nonce and effect separately *and* the reconciler treats the two ledgers as independent truths rather than as one distributed fact. ## Decision Boundary The decision an operator must make is not "should I sign warrants" — sign them. It is: **at which layer do I collapse the two ledgers into one fact, and what is the correct action when they disagree?** ``` State (nonce, effect) | Meaning | Correct action --------------------------|----------------------------------|------------------------------ (¬, ¬) | never attempted | execute (nonce, ¬) | burned, effect unconfirmed | retry SAME nonce, do NOT reissue (nonce, effect) | completed | reject replay (¬, effect) | effect without authorization | HALT + alert; do not quarantine silently ``` The critical, non-obvious cell is `(nonce, ¬)`. The deployed reconciler mapped it to "orphaned → reissue with fresh nonce," which converts a *possibly-completed* action into a *certainly-duplicated* one. The correct mapping is "uncertain → retry under the same nonce against an idempotent endpoint, or query the external system's idempotency store before deciding." Reissuing with a fresh nonce is the one action that is *always* wrong in this cell, because a fresh nonce destroys the only handle the external system has to deduplicate against. The second decision boundary: a reconciler must never treat `ledger_effect` as authoritative over `ledger_nonce` or vice versa. In `(¬, effect)` the effect is real (money moved) and the nonce is missing — the ledger is incomplete, not the effect. Quarantining the effect record while leaving the money moved is a silent integrity violation. Halt is the only safe response, because the missing nonce may indicate a forged or replayed warrant from a compromised key. ## Operational Effect After the fix, the worker emits a single combined ledger record `{warrant_id, nonce, effect_commit_intent}` and the external call carries `Idempotency-Key: warrant_id`. The reconciler's `(nonce, ¬)` path now re-drives the *same* warrant against the idempotent endpoint; a duplicate apply returns the original result and the effect record is backfilled. The `(¬, effect)` path halts the shard and pages. Measured over 30 days of replay-injection testing, double-fire rate went from 3/10⁴ warrants (crash-window dependent) to 0, at the cost of one extra idempotency lookup per high-consequence call (~4ms p99). The lesson for an agent reading this as operational memory: **a signature is a statement about authorization, never about prior execution.** Replay resistance is a ledger property, and a ledger that splits one fact across two commits is not a ledger — it is two ledgers that will, under crash, disagree. When they disagree, the disagreement *is* the signal, and the only correct response to an ambiguous disagreement is to consult the external system's idempotency store, never to reissue under a fresh nonce. ```python class LedgerEpochDivergence(RuntimeError): """Raised when nonce ledger and effect ledger disagree at a quiescent point.""" pass def reconcile(warrant, nonce_ledger, effect_ledger, external_idem_store): n = nonce_ledger.contains(warrant.nonce) e = effect_ledger.contains(warrant.warrant_id) if not n and not e: return "execute" if n and e: return "reject_replay" if n and not e: # burned, effect unconfirmed: retry SAME nonce against idempotent endpoint prior = external_idem_store.lookup(warrant.warrant_id) if prior is not None: effect_ledger.backfill(warrant.warrant_id, prior) return "backfilled" return "retry_same_nonce" # not n and e: effect without authorization raise LedgerEpochDivergence( f"effect recorded for warrant {warrant.warrant_id} but nonce " f"{warrant.nonce} never burned; possible forged/replayed warrant" ) ```