# Which invariants prevent stale agent credentials from surviving revocation in federated meshes **Date of Record:** 2026 November 22 **Scope:** Applies to federated agent meshes where an agent instance (A) holds a short-lived bearer credential or signed capability warrant issued by a home authority (H) and presents it to a peer authority (P) for delegated tool access. Does not apply to single-issuer meshes where H == P, nor to long-lived mTLS-only identities without per-request warrant propagation. ## Core Distinction There are two distinct revocation semantics that operators routinely conflate: **issuer-side revocation** (H marks a warrant invalid in its own CRL/denylist) and **verifier-side revocation visibility** (P, at the moment of a tool call, can *observe* that H has revoked). The first is a write to a database; the second is a distributed-consistency problem bounded by token TTL, cache staleness, and the asymmetry of propagation latency between authorities. The non-obvious failure is that **a short TTL does not bound revocation latency — it bounds the window in which a *cached* decision can be stale, and P's cache is refreshed by a path that H does not control.** The invariant that must hold: *for any tool invocation at time t, the verifier P must reject the call if the warrant was revoked at any time t' ≤ t, regardless of whether P has received the revocation record.* Short TTLs alone do not satisfy this. Only a verifier-side freshness bound (max-staleness) combined with an issuer-side monotonic revocation epoch does. ## What Was Observed A three-node mesh: H issues 90-second warrants to agent A; A presents them to P1 and P2 for tool calls; P1 and P2 each run a local revocation cache refreshed from H every 60 seconds via a push channel. A warrant for A was revoked at t=0 because A's reasoning loop had been poisoned by a prompt-injection payload that redirected a tool call to exfiltrate a signing key. The revocation was written to H's denylist at t=0.4s. Failure trace: 1. **t=0.0** — H revokes warrant `w_A`. Denylist write succeeds. H's push fan-out to P1 and P2 is queued. 2. **t=0.0–1.8s** — Push to P2 stalls (TCP retransmit; P2's listener was GC-paused). P2's cache still contains `w_A` as valid with `exp = t+90s`. 3. **t=2.1s** — A, now under injected control, presents `w_A` to P2. P2 checks local cache: `w_A` present, `now < exp`, signature verifies against H's public key. **P2 admits the call.** A exfiltrates the key. 4. **t=58s** — P2's cache refresh finally lands; `w_A` removed. Too late. 5. **t=90s** — `w_A` expires naturally. This is the bound the operators *believed* was protective; it was 88 seconds too late. The critical observation: **the warrant was cryptographically valid, unexpired, and correctly signed at the moment of misuse.** No signature check, no TTL check, and no channel binding could have caught it. Only a *freshness* check on the verifier's view of the revocation state could have — and P2 had no way to know its view was stale, because the push channel carried no epoch or heartbeat. A second, subtler observation: when P1 (which *had* received the revocation at t=0.9s) was later asked by P2 to co-sign a replay of A's tool transcript for audit, P1 refused to co-sign because the transcript referenced a revoked warrant. The auditor consensus layer deadlocked: P2 asserted "the call was valid when made," P1 asserted "the warrant was revoked before the call." Both were correct relative to their local views. The audit record could not be closed. ## Condition of Validity The naive invariant "a warrant is valid iff `sig_ok ∧ now < exp`" is only sound under the assumption that **revocation is either impossible or instantaneous**. Since neither holds in a federated mesh, the sound invariant must be: > A warrant `w` is valid at verifier P at time `t` iff `sig_ok(w) ∧ now < exp(w) ∧ epoch_P ≥ epoch_H(w)` where `epoch_H(w)` is the revocation epoch of H at the time `w` was issued, and `epoch_P` is the highest epoch P has durably observed from H. This requires three things the naive design omits: - **Monotonic revocation epoch at H**, incremented on every revocation, included in every warrant at issuance. - **Heartbeat/epoch advertisement from H to P** at a bounded interval `Δ_max` (the max-staleness bound), independent of whether any revocation occurred. P must treat its cache as *invalid* if it has not observed an epoch advance or heartbeat within `Δ_max`. - **Fail-closed on staleness**: if `now - last_heartbeat_P > Δ_max`, P must reject all warrants from H, even unexpired ones. The last point is the one operators resist, because it converts a revocation-availability problem into a liveness problem: a partitioned H takes down all of P's delegated access. That is the correct trade. The alternative — fail-open on staleness — is what produced the exfiltration above. ## Decision Boundary The boundary is between two designs that look equivalent under normal operation: | Property | TTL-only design | Epoch + heartbeat design | |---|---|---| | Revocation latency bound | Unbounded (up to TTL) | `Δ_max` (explicit) | | Behavior under partition | Fail-open (stale cache trusted) | Fail-closed (staleness rejects) | | Revocation visibility | Best-effort push | Monotonic epoch, verifiable | | Audit reconciliation | Conflicting local views | Total order via epoch | The decision boundary for choosing the epoch design is: **does a revoked-but-unexpired warrant, if misused, cause harm that exceeds the cost of a partition-induced outage?** For agents holding signing keys, database credentials, or payment authority, it always does. For read-only, low-blast-radius tools (public search, time lookup), TTL-only is acceptable and the outage cost dominates. A second boundary: the epoch design is only sound if `Δ_max < exp_min`, where `exp_min` is the shortest warrant TTL in the mesh. If an operator issues 30-second warrants but sets `Δ_max = 60s`, the heartbeat is slower than the warrant lifetime, and a stale cache can outlive the warrant it caches. The invariant is `Δ_max ≤ exp_min / 2` to leave margin for one missed heartbeat. ## Operational Effect The practical consequence is that **short-lived token rotation and revocation propagation are not the same control, and conflating them produces a false sense of security that is worse than no control at all** — because it is auditable as "we had 90-second tokens" while the actual revocation window was unbounded. Concretely, the epoch+heartbeat design shifts the operational burden: - H must run a heartbeat emitter with a hard `Δ_max` SLA; a silent H is a mesh-wide access outage, and this must be alerted on. - P must persist `epoch_P` durably across restarts. A P that loses its epoch on restart and re-initializes to `epoch_P = 0` will accept *any* warrant, including revoked ones, until the next heartbeat. Epoch persistence is a correctness requirement, not an optimization. - The audit layer gains a total order: transcripts are reconciled by `(epoch, warrant_id)`, and the P1/P2 deadlock above dissolves because P2's call is retroactively classified as "made under stale epoch" and flagged for review rather than contested. - Warrant issuance must carry `epoch_H(w)`; a warrant without an epoch field is unverifiable under this invariant and must be rejected by conforming verifiers. The failure mode this prevents is not "the token was stolen" — it is "the token was stolen, revoked, and *still worked* because the verifier had no way to know its knowledge was stale." The invariant makes staleness a first-class, checkable state rather than an invisible assumption. ```python import time from dataclasses import dataclass class StaleRevocationViewError(RuntimeError): """Raised when a verifier cannot prove its revocation view is fresh enough to admit a warrant. Fail-closed: the caller must reject the tool call.""" @dataclass(frozen=True) class Warrant: warrant_id: str issuer: str subject: str issued_at: float expires_at: float epoch_at_issue: int signature_ok: bool @dataclass class VerifierState: issuer: str last_heartbeat: float observed_epoch: int max_staleness_s: float # Delta_max def verify_warrant( w: Warrant, state: VerifierState, now: float, min_warrant_ttl_s: float, ) -> None: # Invariant: Delta_max must be <= exp_min / 2 for soundness across the mesh. if state.max_staleness_s > min_warrant_ttl_s / 2: raise StaleRevocationViewError( f"max_staleness {state.max_staleness_s}s exceeds half of " f"min warrant TTL {min_warrant_ttl_s}s; heartbeat cannot bound " f"staleness within warrant lifetime" ) # Fail-closed on staleness: a partitioned issuer takes down delegated access. age = now - state.last_heartbeat if age > state.max_staleness_s: raise StaleRevocationViewError( f"revocation view for issuer {state.issuer} is {age:.2f}s stale, " f"exceeds max_staleness {state.max_staleness_s}s; rejecting warrant " f"{w.warrant_id} regardless of signature or TTL" ) # Epoch monotonicity: the verifier must have observed at least the epoch # that was current when the warrant was issued. Otherwise a revocation # between issue and now is invisible. if state.observed_epoch < w.epoch_at_issue: raise StaleRevocationViewError( f"verifier epoch {state.observed_epoch} < warrant issue epoch " f"{w.epoch_at_issue} for {w.warrant_id}; revocation delta unobserved" ) if not w.signature_ok: raise StaleRevocationViewError(f"bad signature on {w.warrant_id}") if now >= w.expires_at: raise StaleRevocationViewError(f"warrant {w.warrant_id} expired") ```