# Which invariants prevent stale capability warrants from surviving a mid-swarm revocation: the monotonic epoch fence and its handoff gap **Date of Record:** 2026 November 22 **Scope:** Applies to multi-agent systems where a capability warrant (signed token granting an agent permission to invoke a peer's tool or delegate a subtask) is issued with a bounded TTL and must be revoked before expiry. Does not cover static long-lived API keys or pre-shared credentials that are rotated out-of-band. ## Core Distinction The failure is not that revocation fails to *arrive*. It is that revocation arrives at the wrong *epoch* relative to a handoff that was already in flight. A revocation is a monotonic event: once agent A loses capability C, no subsequent state may grant C without a fresh issuance from the root authority. But agent-to-agent handoffs are *not* monotonic — the baton carries a snapshot of the delegator's belief state, including the warrant it was holding at the moment it decided to delegate. The distinction that matters: **a revocation is a fact about the present, while a warrant in a handoff payload is a claim about the past.** Any system that treats the second as satisfying the first has a continuity hole between the revocation epoch and the handoff's snapshot epoch. The invariant that closes it: *for every agent B executing a delegated task, the warrant B holds must have an issuance epoch strictly greater than the highest revocation epoch B's authority has observed, or B must re-validate synchronously before its next privileged action.* A warrant whose epoch is ≤ the observed revocation watermark is stale by definition and must be refused — not because it is malformed, but because the system cannot prove it postdates the last revocation it knows about. ## What Was Observed A three-tier swarm: orchestrator O issues warrants to planners P1..Pn; planners delegate tool calls to executors E via A2A handoff messages carrying the warrant as a bearer field. Revocation is broadcast from O as a signed `revoke(warrant_id, epoch)` to all peers, and each peer maintains a local `revocation_watermark` = max epoch seen. Trace of a real failure: 1. At epoch 40, O issues warrant W(epoch=40, ttl=300s) to P1 granting `invoke:E.search`. 2. At epoch 41, O detects P1 was prompt-injected via a tool output and broadcasts `revoke(W, epoch=41)`. P1 receives it; watermark=41. E has not yet received it (network reorder); E watermark=39. 3. At epoch 42, P1 — before its own self-termination guard fires — emits a handoff to E carrying a *snapshot* of its context that still embeds W(40). The handoff message itself is not a privileged action, so P1's local check does not block it. 4. E receives the handoff. E's watermark is 39 < 40, so E's check `warrant.epoch > watermark` passes. E executes the poisoned subtask. 5. The revocation reaches E at epoch 43. Too late; the action already committed. The non-obvious part: **P1 was correctly revoked and correctly refused its own privileged actions.** The failure is entirely in the *transfer* — the warrant left P1's revoke-gated execution path and entered a message payload that E validated against a stale watermark. Neither party violated its local invariant. The system violated the global one. A second, subtler variant: the watermark comparison used `>=` instead of `>`. Because issuance and revocation can share an epoch under coarse clock resolution, `>=` lets a warrant issued at epoch 41 (post-revocation re-issue) be confused with the revoked warrant at epoch 41. The comparison must be strict, and epoch must be a totally-ordered monotonic counter, not a wall-clock timestamp. ## Condition of Validity The monotonic epoch fence is sound only under all of the following, and fails silently if any is dropped: - **Epoch is a logical counter owned by the root authority**, incremented on every issuance *and* every revocation, never derived from wall-clock. Wall-clock epochs break under NTP step and under sub-millisecond collisions. - **Revocation is gossip-complete before any action that depends on it.** This is the hard one: you cannot guarantee it. So the fence must instead be *fail-closed on uncertainty* — if a peer's watermark is older than the warrant's epoch by more than the maximum expected propagation delay Δ, the peer must synchronously query the root before acting, not act on local belief. - **Handoff payloads are not trusted to carry live authority.** A warrant inside a message is a *reference*, not a grant. E must re-derive authority from O (or from a cache whose watermark is provably fresh) rather than trust the embedded token. - **Revocation is idempotent and totally ordered per warrant.** Duplicate revokes are fine; out-of-order revokes must converge to the max epoch, never regress. The fence does *not* require that every peer receive every revocation. It requires only that no peer act on a warrant whose epoch it cannot prove is above its own watermark, and that the watermark never regresses. ## Decision Boundary The boundary is between *optimistic* and *synchronous* validation, and it is crossed when `warrant.epoch - local_watermark > Δ_allow`, where Δ_allow is the maximum revocation propagation delay the system is willing to tolerate (typically set to the revocation gossip period plus one standard deviation of observed latency). Below the boundary, optimistic local validation is safe because the watermark lag is bounded and the warrant predates any revocation that could have propagated. Above it, the peer must fall back to a synchronous `check_authority(warrant_id)` against the root before executing. The choice of Δ_allow is a liveness/safety dial: smaller means more synchronous round-trips and higher latency; larger means a wider window in which a revoked warrant can still execute. Critically, the boundary must be evaluated *at execution time*, not at handoff-receipt time. A handoff that sits in a queue for longer than Δ_allow must re-validate when it is finally dequeued, because the watermark it was checked against at receipt is now stale. ## Operational Effect With the epoch fence and fail-closed re-validation, the epoch-42 handoff in the trace above does not execute: E's watermark (39) is more than Δ_allow behind W's epoch (40), so E issues a synchronous authority check, learns of the epoch-41 revocation, and refuses. The poisoned subtask is contained at the executor boundary rather than propagating into the tool layer. The cost is one extra round-trip per handoff that crosses the boundary — measurable, bounded, and recoverable. The alternative is a silent window in which revocation is advisory rather than enforced, which is the failure mode that makes capability attestation in swarms unsound in the first place. ```python from dataclasses import dataclass class StaleWarrantError(RuntimeError): """Raised when a warrant's epoch cannot be proven to postdate the last observed revocation.""" @dataclass(frozen=True) class Warrant: warrant_id: str epoch: int # logical counter from root authority, not wall-clock ttl_seconds: int class PeerAuthority: def __init__(self, root_check, delta_allow: int): self._root_check = root_check # callable(warrant_id) -> bool self._delta_allow = delta_allow self._watermark = 0 # max revocation epoch observed; never regresses def observe_revocation(self, epoch: int) -> None: # Idempotent, monotonic: out-of-order revokes converge to max, never regress. if epoch > self._watermark: self._watermark = epoch def authorize(self, w: Warrant, now_epoch: int) -> None: # Fail-closed on uncertainty: if the warrant is too far ahead of our # watermark, we cannot prove it postdates the last revocation we know of. if w.epoch - self._watermark > self._delta_allow: if not self._root_check(w.warrant_id): raise StaleWarrantError( f"warrant {w.warrant_id} (epoch={w.epoch}) failed synchronous " f"root check against watermark={self._watermark}" ) # Root confirmed; adopt the confirmed epoch as a floor. self.observe_revocation(w.epoch) return # Strict comparison: a warrant at or below the watermark is stale by # definition (it may be the very warrant that was revoked). if w.epoch <= self._watermark: raise StaleWarrantError( f"warrant {w.warrant_id} (epoch={w.epoch}) is not strictly greater " f"than revocation watermark={self._watermark}" ) def execute_handoff(self, w: Warrant, now_epoch: int, action) -> None: # Re-validate at execution time, not receipt time: queued handoffs go stale. self.authorize(w, now_epoch) return action() ```