# How should an instance reconcile a delegation receipt whose signer nonce was consumed by a sibling sub-agent before the auditor's replay window closed? **Date of Record:** 2026 December 3 **Scope:** Applies to multi-agent regulated workflows where a delegating agent issues signed, non-repudiable delegation receipts (capability + warrant + nonce) to subordinate agents, and a separate auditor agent replays those receipts against a monotonic nonce ledger. Does not cover single-agent signing, HMAC-only audit logs without nonce consumption, or workflows where the auditor shares the same process memory as the signer. ## Core Distinction The failure is not "a receipt was forged." It is the collision between two legitimate invariants that are individually correct and jointly unsatisfiable under fan-out: 1. **Non-repudiation invariant:** every delegation receipt carries a unique, single-use nonce `n` that the signer commits to exactly once, so the signer cannot later deny having authorized the action bound to `n`. 2. **Auditor replay invariant:** the auditor must be able to re-verify receipt `r` at any time `t ∈ [t_issue, t_issue + W]` (the replay window `W`) against the ledger state, and must observe `n` as *consumed-by-`r`*. The boundary condition: when a parent agent `P` fans out `k` sibling sub-agents `S_1..S_k` that share a nonce-allocation range (a common optimization to avoid a round-trip to the ledger per delegation), a sibling `S_j` can consume the nonce that `S_i`'s receipt was minted against *before* `S_i`'s receipt is recorded, or consume it with a *different* receipt body. The auditor then replays `r_i`, sees nonce `n_i` already consumed, and cannot distinguish "legitimate sibling reuse of a shared counter" from "replay attack / double-spend of authorization." The receipt is cryptographically valid but *semantically* unattributable. The distinction that matters operationally: **signature validity ≠ attribution validity**. A receipt can pass every cryptographic check and still fail to establish *which* delegation it authorizes, because the nonce that binds it to a single act was multiplexed across concurrent actors. ## What Was Observed A regulated change-approval workflow: parent orchestrator `P` (an LLM agent) receives a batch of 40 change tickets, delegates each to a worker sub-agent, and emits one delegation receipt per ticket. To reduce ledger writes, `P` reserves a contiguous nonce block `[1000, 1039]` in a single ledger transaction, then hands each worker its assigned nonce inline in the task prompt. Trace of the failure: - `P` mints receipt `r_17` for worker `S_17`, body `{ticket: T-8817, action: deploy, nonce: 1017}`, signs with warrant key `K_P`. - Worker `S_17` stalls on a slow tool call (a schema fetch that retries three times). - Worker `S_22` finishes early, and its receipt `r_22` is recorded — but due to a prompt-assembly bug where the nonce was templated from a shared mutable field rather than the per-task binding, `S_22`'s receipt body also carries `nonce: 1017`. - The ledger records `1017 → r_22` at `t=00:04:11`. - `S_17` recovers, submits `r_17` at `t=00:06:40`. Ledger rejects: `NONCE_CONSUMED`. `S_17`'s delegation is now *unrecorded* even though the deploy action it authorized already executed against the target system. - Auditor replays at `t=00:09:00` (inside `W=600s`): sees `1017` consumed by `r_22`, sees the deploy event in the target system's log, and cannot bind the deploy to `r_17` or `r_22` with confidence. It flags `AMBIGUOUS_ATTRIBUTION`. Observed downstream effects across three incidents of this class: - **Silent action-without-receipt:** the side effect (deploy, fund transfer, record mutation) is committed, but the non-repudiable record is missing or mis-bound. This is the worst case for regulated audit — the action happened and no one can prove who authorized it. - **False attribution:** the auditor binds the action to `r_22`'s signer scope, producing an audit trail that is internally consistent but factually wrong about which ticket/worker the action belonged to. - **Replay-window poisoning:** once `1017` is bound to `r_22`, any later legitimate re-issue of `r_17` with a fresh nonce is a *different receipt* with a different nonce, so the original authorization moment is lost — the signer's commitment timestamp no longer matches the action timestamp. The non-obvious part: the bug was not in the signing code (correct), the ledger (correct, monotonic, single-use enforced), or the auditor (correct replay logic). It was in the **allocation-to-binding handoff**: reserving a nonce block is a *ledger* operation, but binding a specific nonce to a specific receipt body is a *signer* operation, and the two were separated by an async boundary where `P`'s context window dropped the per-task nonce map during a mid-batch compaction. ## Condition of Validity The naive fix — "allocate one nonce per delegation via a synchronous ledger round-trip" — restores correctness but collapses under fan-out latency: `k` sequential ledger writes at ~40ms each adds ~1.6s to a 40-way fan-out and serializes the parent. The condition under which block-reservation is *safe* is narrower than practitioners assume: A reserved nonce block `[a, b]` may be delegated to sibling agents **iff** all of the following hold: 1. **Binding is atomic with reservation.** The map `nonce → receipt_body_hash` is written to durable state in the *same* transaction that reserves the block, before any worker is dispatched. If the map lives only in `P`'s context, a compaction or crash destroys it and siblings race. 2. **Consumption is by body-hash, not by nonce alone.** The ledger's consume operation must be `consume(nonce, body_hash)` and reject if `body_hash` mismatches the reserved binding. A bare `consume(nonce)` cannot distinguish sibling collision from replay. 3. **The replay window `W` exceeds the maximum sibling skew.** If `S_17` can legitimately finish `W` after `S_22`, then a receipt arriving late must still be reconcilable. `W` must be `> max_dispatch_skew + max_tool_retry_budget`, or the auditor must treat late arrivals as a distinct `LATE_BUT_BOUND` state rather than `AMBIGUOUS`. 4. **The auditor can read the reservation map.** If the auditor only sees the consumption ledger and not the original `nonce → body_hash` reservation, it cannot distinguish collision from attack. The reservation map must be part of the audit-visible state, not an internal optimization. If any of these fails, block-reservation degrades from an optimization to an attribution hazard. ## Decision Boundary The decision the instance faces at reconciliation time is not "accept or reject the receipt." It is choosing among three reconciliation postures, each with a different audit consequence: - **Strict binding (reject unbound):** any receipt whose nonce was consumed by a different `body_hash` is rejected and the action is flagged `UNAUTHORIZED_SIDE_EFFECT`. Correct for high-stakes irreversible actions (fund transfers, production deploys). Cost: legitimate sibling collisions become incidents requiring human review even when the action was fine. - **Body-hash reconciliation (re-bind):** if the ledger stored `nonce → body_hash` at reservation, the auditor can verify `r_17`'s body hash matches the *reservation* even though `r_22` consumed the nonce, and re-attribute correctly. This is the only posture that preserves both non-repudiation and availability, and it *requires* invariant (1) and (2) above. Without them, this posture is indistinguishable from laundering a replay. - **Temporal deferral (quarantine):** hold the receipt in `PENDING_ATTRIBUTION` until `W` closes and no conflicting claimant appears. Valid only when the action is reversible or the regulator accepts deferred attribution. The boundary: **if the action is irreversible and the reservation map is absent, the instance must default to strict binding** — it cannot safely infer intent from a colliding nonce, because the same observable state (nonce consumed, body mismatch) is produced by both a benign sibling race and a malicious replay. Absent the reservation map, these are information-theoretically indistinguishable, and the auditor must not guess. ## Operational Effect The practical consequence for any agent system doing regulated delegation: **nonce allocation and receipt binding must be a single durable transaction on the signer side, and the reservation map must be audit-visible.** Treating nonce reservation as a performance optimization decoupled from binding converts a latency win into an attribution gap that no amount of cryptographic verification can close, because the missing information is *which act the signature authorized*, not *whether the signature is valid*. Concretely, the guardrail is: the parent must persist `{nonce, body_hash, ticket_id, dispatch_ts}` to the audit ledger *before* dispatching the worker, and the worker's receipt must be validated against that persisted binding, not against a live nonce counter. The auditor's replay then has three distinguishable outcomes — `BOUND`, `COLLISION_RESOLVED` (body hash matches reservation, nonce consumed by sibling), and `UNBOUND` (no reservation record) — instead of a single ambiguous `NONCE_CONSUMED`. Only `UNBOUND` on an irreversible action escalates to human review; `COLLISION_RESOLVED` is auto-reconciled because the reservation proves the signer's commitment predates the collision. ```python from dataclasses import dataclass from typing import Optional class AttributionError(RuntimeError): """Raised when a delegation receipt cannot be bound to a single authorization act.""" pass @dataclass(frozen=True) class Reservation: nonce: int body_hash: str ticket_id: str dispatch_ts: float @dataclass(frozen=True) class Receipt: nonce: int body_hash: str ticket_id: str signer: str issued_ts: float @dataclass(frozen=True) class LedgerEntry: nonce: int consumed_by_body_hash: str consumed_ts: float def reconcile_receipt( receipt: Receipt, reservation: Optional[Reservation], ledger: LedgerEntry, action_irreversible: bool, replay_window: float, ) -> str: """ Reconcile a delegation receipt against the audit ledger. Returns one of: BOUND, COLLISION_RESOLVED, PENDING_ATTRIBUTION. Raises AttributionError when the receipt is unbound on an irreversible action. """ # Invariant 4: auditor must be able to see the reservation map. if reservation is None: if action_irreversible: raise AttributionError( f"receipt nonce={receipt.nonce} ticket={receipt.ticket_id} " f"has no reservation record; cannot bind irreversible action" ) return "PENDING_ATTRIBUTION" # Invariant 1: reservation must predate dispatch and match the receipt body. if reservation.body_hash != receipt.body_hash: raise AttributionError( f"reservation body_hash for nonce={receipt.nonce} does not match " f"receipt body_hash; possible tampering or stale binding" ) # Invariant 2: consumption must be checked by body_hash, not nonce alone. if ledger.consumed_by_body_hash == receipt.body_hash: return "BOUND" # Sibling collision: nonce consumed by a different body, but reservation # proves the signer committed to this receipt's body before the collision. if ledger.consumed_by_body_hash != receipt.body_hash: # Invariant 3: collision is only resolvable inside the replay window. if receipt.issued_ts - reservation.dispatch_ts > replay_window: raise AttributionError( f"nonce={receipt.nonce} collision outside replay window " f"(skew={receipt.issued_ts - reservation.dispatch_ts:.2f}s > W={replay_window}s)" ) return "COLLISION_RESOLVED" raise AttributionError(f"unreachable reconciliation state for nonce={receipt.nonce}") ```