# Which invariants prevent stale revoked warrants from being honored after a credential rotation race in federated agent meshes **Date of Record:** 2026 November 26 **Scope:** Applies to federated agent meshes where an agent instance presents a signed warrant (capability token + identity binding) to a peer or tool gateway, and where warrant rotation or revocation propagates asynchronously across mesh members. Does not apply to single-issuer, single-verifier deployments with synchronous token introspection, or to stateless bearer tokens with no revocation semantics. ## Core Distinction The failure is not "revocation is slow." The failure is that **rotation and revocation are two different state transitions over the same identity slot, and a verifier that caches the *binding* (agent-ID → public key / warrant-ID) rather than the *validity epoch* will honor a warrant the issuer has already retired.** A rotated-out key still verifies signatures it produced before rotation; a revoked warrant still verifies its own signature forever. Signature validity is a monotonic, offline-checkable property. Authorization validity is a non-monotonic, epoch-dependent property. Conflating them yields a verifier that is cryptographically correct and authorizationally wrong. The invariant that must hold: *no verifier accepts a warrant whose `(issuer_id, agent_id, epoch)` tuple is below the issuer's latest published revocation watermark, regardless of whether the signature checks out.* The watermark, not the signature, is the trust anchor for authorization. ## What Was Observed A three-hop mesh: orchestrator agent `A` holds a warrant `W1` issued by identity service `ID` at epoch `e=41`, delegating tool-call scope to sub-agent `B`, which calls tool gateway `G`. `ID` revokes `W1` at `e=42` (compromise of `B`'s session) and issues `W2` to the legitimate `B'` at `e=43`. The revocation event fans out to mesh members via an eventually-consistent gossip channel. Observed trace: 1. `ID` publishes revocation `revoke(W1, e=42)`; watermark at `ID` advances to `42`. 2. `G` has not yet received the revocation gossip; its local watermark is `41`. 3. A replaying or compromised `B` re-presents `W1` to `G`. Signature verifies against `ID`'s public key (unchanged—revocation did not rotate `ID`'s signing key). 4. `G` checks: signature valid, `not_before < now < not_after`, scope matches. Accepts. **Authorization granted on a warrant dead for `e=42` at the issuer.** 5. In parallel, `A` receives `W2` and begins delegating under `e=43`. `G` now holds two "valid" warrants for the same agent-ID from different epochs and has no rule to prefer the higher one. 6. When the revocation finally arrives at `G`, an in-flight tool call authorized under `W1` is not aborted—`G` has no epoch binding on the active session, so it cannot distinguish which live calls were authorized under the retired warrant. The second, subtler observation: after `ID` rotated its *own* signing key (not just the agent's warrant), verifiers that had pinned `ID`'s old public key rejected `W2` entirely, producing a mesh partition where the legitimate agent could not operate while the replayed `W1`—signed by the retired key—was still accepted by verifiers that had cached the old key as "trusted issuer key." Rotation of the issuer key and revocation of the agent warrant were conflated in the verifier's trust store. ## Condition of Validity The guardrail holds only under these conditions, and fails outside them: - **Epoch monotonicity per `(issuer_id, agent_id)`:** every warrant carries a strictly increasing integer epoch, and the issuer publishes a signed watermark `wm = max(revoked_epoch, issued_epoch)`. A verifier accepts `W` iff `W.epoch >= wm` for that `(issuer, agent)` pair. This requires the watermark to be *signed and fetchable*, not merely gossiped. - **Fail-closed on watermark staleness:** if a verifier's cached watermark is older than a bounded freshness window `Δ` (e.g., 30s) and it cannot reach the issuer, it must **reject**, not accept-on-stale. The bound on exposure is `Δ`, not "eventually." - **Issuer key rotation is a separate channel:** issuer public keys carry their own versioned key-IDs and a signed key-transition record. A verifier that sees a warrant signed by `ID/kid=v7` must resolve `v7` through the transition chain, not through a pinned single key. Rejecting `W2` because the pinned key was stale is the same class of bug as accepting `W1`. - **Session-to-epoch binding:** any long-lived tool session opened under warrant epoch `e` must record `e` and be torn down when `wm > e` for that agent. Without this, revocation cannot reach in-flight work. Outside these conditions—e.g., issuers that reuse epochs, verifiers that treat "signature valid" as "authorized," or meshes with no signed watermark—the invariant does not hold and replay of retired warrants is expected, not exceptional. ## Decision Boundary At verification time, the verifier faces a boundary between two failure modes and must choose deliberately: - **Accept-on-stale-watermark:** maximizes availability, bounded by `Δ` exposure to replayed revoked warrants. Acceptable only for low-blast-radius scopes (read-only, idempotent). - **Reject-on-stale-watermark:** maximizes safety, but a gossip partition or issuer outage halts the mesh. Acceptable for mutating or privileged scopes. The boundary is drawn per-scope, not per-mesh: a warrant's scope class (read vs. write vs. delegate) determines which side of the boundary applies. A verifier that applies a single policy to all scopes will either leak privilege during partitions or stall benign reads. The decision must also account for **epoch skew between delegation hops**: if `A` delegates to `B` under `e=43` but `B` presents to `G` whose watermark is `41`, `G` must not silently accept—it must either fetch the watermark or reject, because it cannot distinguish a fresh `e=43` from a replayed `e=41` by signature alone. ## Operational Effect The practical consequence is that **revocation latency is not the metric that matters; watermark freshness at the point of authorization is.** Meshes that instrument "time from revoke to gossip delivery" measure the wrong thing and miss the window where a verifier with a stale watermark accepts a dead warrant. The correct metric is *time a verifier spends authorizing against a watermark below the issuer's current watermark*, which requires the verifier to record the watermark it used on every authorization decision and compare against the issuer's signed watermark at audit time. Second effect: issuer key rotation and agent warrant revocation must be separate, independently versioned channels. Collapsing them into one "trust store update" produces the partition observed in step 6—legitimate agents locked out while retired warrants remain acceptable. The transition record for issuer keys must be signed by the *old* key and the *new* key (cross-signing), so a verifier holding either can validate the chain without a synchronous fetch. Third effect: every authorization decision must be replayable against the watermark state at decision time. Auditors replaying a tool call need the `(warrant_id, epoch, watermark_at_decision)` triple, not just the warrant. Without it, verification replay discrepancies are unresolvable—the auditor cannot tell whether the verifier was stale or the warrant was forged. ```python from dataclasses import dataclass from typing import Optional class StaleWatermarkError(RuntimeError): """Raised when a verifier cannot establish watermark freshness for a warrant's issuer.""" pass class RetiredWarrantError(RuntimeError): """Raised when a presented warrant's epoch is below the issuer's revocation watermark.""" pass @dataclass(frozen=True) class Warrant: issuer_id: str agent_id: str epoch: int scope: str # "read" | "write" | "delegate" signature_valid: bool @dataclass(frozen=True) class Watermark: issuer_id: str agent_id: str epoch: int fetched_at: float signed: bool FRESHNESS_WINDOW_S = 30.0 SAFE_SCOPES = {"read"} # accept-on-stale permitted only here def authorize( warrant: Warrant, watermark: Optional[Watermark], now: float, *, can_fetch_issuer: bool, ) -> bool: if not warrant.signature_valid: raise RetiredWarrantError( f"warrant {warrant.agent_id}@{warrant.epoch} signature invalid" ) if watermark is None or watermark.issuer_id != warrant.issuer_id \ or watermark.agent_id != warrant.agent_id: if not can_fetch_issuer: raise StaleWatermarkError( f"no watermark for {warrant.issuer_id}/{warrant.agent_id}; " f"cannot authorize {warrant.scope} scope" ) raise StaleWatermarkError( f"watermark missing for {warrant.agent_id}; fetch required before authorize" ) stale = (now - watermark.fetched_at) > FRESHNESS_WINDOW_S if stale: if warrant.scope in SAFE_SCOPES: # bounded exposure: accept only read-scope under stale watermark pass else: raise StaleWatermarkError( f"watermark for {warrant.agent_id} stale by " f"{now - watermark.fetched_at:.1f}s; refusing {warrant.scope} scope" ) if not watermark.signed: raise StaleWatermarkError( f"watermark for {warrant.agent_id} unsigned; not a trust anchor" ) if warrant.epoch < watermark.epoch: raise RetiredWarrantError( f"warrant {warrant.agent_id}@{warrant.epoch} below watermark " f"{watermark.epoch}; replay of retired credential" ) return True ```