# Which invariants prevent a revoked agent from re-entering a federated mesh through a warm capability cache **Date of Record:** 2026 November 22 **Scope:** Applies to federated agent meshes where authorization decisions are cached per-capability (tool schema + scope tuple) and where revocation is propagated asynchronously via a separate control plane. Does not apply to meshes that re-verify every invocation against a synchronous central authority, nor to single-tenant deployments with a single trust domain. ## Core Distinction There are two distinct notions of "revoked" in a federated agent mesh, and they diverge under load: 1. **Control-plane revocation** — the identity provider (IdP) marks the agent's warrant/credential as withdrawn and emits a revocation event onto the mesh bus. 2. **Data-plane enforcement** — a peer agent (the *verifier*) refuses to honor a presented warrant at the moment of a tool call. The failure mode this record covers is **revocation shadowing through a warm capability cache**: a verifier agent has previously negotiated a capability grant (e.g., `filesystem.read:/shared/scratch`, `sql.query:analytics_ro`) with the now-revoked agent, and caches the *authorization decision* keyed on `(subject_id, capability_hash, warrant_epoch)`. When revocation arrives, the control plane bumps the warrant epoch and emits an event — but the verifier's cache key is derived from the *presented* warrant, not the *current* one. A revoked agent that presents its old, still-cryptographically-valid-until-expiry warrant produces the same cache key and hits the warm entry. The revocation event updates a *different* index (a deny-list keyed on `subject_id` only), which the fast path never consults because the cache hit short-circuits before the deny-list lookup. The result: revocation succeeds on the control plane, the audit log records `REVOKED`, and the agent continues to execute tools against peers for the remainder of the warrant's TTL. This is not a race in the ordinary sense (the event *was* delivered); it is a **key-space mismatch between the revocation index and the authorization cache**. ## What Was Observed In a three-peer mesh (`orchestrator`, `verifier-a`, `verifier-b`) with a shared capability cache backed by a 300-second TTL, the following trace was captured during a revocation drill: ``` t=0.000 IdP: revoke(subject=agent-7f3, warrant_epoch=41->42) t=0.000 IdP: publish REVOCATION{subject=agent-7f3, epoch=42} -> bus t=0.004 verifier-a: deny_list.insert(agent-7f3) # deny-list path t=0.006 verifier-a: cache still holds key (agent-7f3, cap=db_ro, epoch=41) -> HIT t=0.010 agent-7f3: invoke(verifier-a, sql.query, warrant_epoch=41) t=0.010 verifier-a: cache_lookup -> HIT -> ALLOW # deny-list never consulted t=0.011 verifier-a: executes sql.query, returns rows t=0.013 verifier-b: deny_list.insert(agent-7f3) t=0.020 agent-7f3: invoke(verifier-b, sql.query, warrant_epoch=41) t=0.020 verifier-b: cache_lookup -> HIT -> ALLOW ``` The revoked agent executed 14 tool calls across both verifiers between `t=0.010` and `t=298` (warrant expiry). The audit log on the IdP showed a clean revocation; the peer-side audit logs showed `ALLOW` with `cache_hit=true` and no record of the deny-list check because it was structurally bypassed. Two secondary observations compounded the problem: - **Epoch monotonicity was not enforced on presentation.** Peers accepted `warrant_epoch=41` after the IdP had advanced to 42, because the warrant's signature was valid and the verifier had no local record of the *current* epoch — only of epochs it had itself observed. A verifier that had been partitioned during the epoch bump never learned epoch 42 existed. - **Capability re-negotiation masked the gap.** When the revoked agent opened a *new* capability (`http.fetch:internal`), the cache missed, the deny-list was consulted, and the call was correctly rejected. This produced a misleading signal: the mesh appeared to enforce revocation for new capabilities while silently permitting cached ones. ## Condition of Validity The invariant that must hold for revocation to be *effective* (not merely *recorded*) is: > **For every authorization decision served from cache, the cache key must include the warrant epoch, and the verifier must reject any presented warrant whose epoch is strictly less than the highest epoch it has observed for that subject — regardless of cache state.** This is the **monotonic epoch guard**. It is distinct from signature validity (which only proves the warrant was once issued) and from deny-list membership (which only proves a revocation event was received). The guard is what closes the shadow: a stale-epoch presentation is refused *before* the cache is consulted, so a warm entry keyed on the old epoch can never be served. The invariant is only valid under these conditions: - The IdP advances the epoch **monotonically** and never reuses an epoch value for a subject (epoch reuse reopens the shadow). - Each verifier persists the **high-water-mark epoch per subject** across restarts; an in-memory-only high-water-mark is lost on cold start and the shadow returns for the duration of the TTL. - Capability negotiation binds the epoch into the grant, so a grant issued at epoch 41 is not silently re-scoped to epoch 42 without re-negotiation. Otherwise a verifier may "upgrade" a stale grant and serve it under the new epoch — a different shadow. - Clock skew between IdP and verifiers is bounded below the epoch-advance interval, or the high-water-mark comparison must be event-order-based (from the bus) rather than timestamp-based. It does **not** hold if the mesh relies on short TTLs as a substitute for the guard. TTL expiry bounds the shadow window but does not close it: a 300-second TTL means up to 300 seconds of post-revocation execution, which for a `sql.query` or `filesystem.write` capability is unbounded in effect even though bounded in time. ## Decision Boundary When designing or auditing a federated mesh, the decision boundary is: **If revocation is asynchronous and authorization is cached, then the cache key MUST carry the revocation-relevant version, and the fast path MUST consult a monotonic version check before the cache.** The boundary separates two architectures that look identical in steady state but diverge under revocation: - **Cache-keyed-on-subject** (unsafe): `key = (subject, capability)`. Revocation must invalidate by scanning the cache or by relying on TTL. Under load, the scan lags and the TTL is the only bound. This is the configuration that produced the trace above. - **Cache-keyed-on-version** (safe): `key = (subject, capability, epoch)`, plus a pre-cache `presented_epoch >= high_water_mark[subject]` check. Revocation is effective at the moment the high-water-mark advances, independent of cache population or TTL. The boundary also determines what "continuous authorization" means operationally. Continuous authorization is **not** "re-check periodically" (which leaves a window equal to the check interval) and **not** "short TTLs" (which leaves a window equal to the TTL). It is the monotonic guard: a presented credential that is *older than the verifier's knowledge* is refused, full stop. The verifier's knowledge is the high-water-mark, and it must be durable. A corollary boundary: **deny-lists are necessary but not sufficient.** They handle the case where the verifier learned of the revocation; the monotonic guard handles the case where it did not (partition, restart, bus lag) by refusing anything that *predates* what it does know. The two mechanisms cover disjoint failure classes and neither substitutes for the other. ## Operational Effect With the monotonic epoch guard in place, the trace becomes: ``` t=0.000 IdP: revoke(agent-7f3, epoch 41->42), publish t=0.010 agent-7f3: invoke(verifier-a, sql.query, warrant_epoch=41) t=0.010 verifier-a: presented_epoch(41) < high_water_mark(42) -> REJECT (reason=STALE_EPOCH, cache not consulted) ``` The revoked agent is refused at the first call after the verifier learns of epoch 42, and — critically — refused *before* the warm cache can serve it. For a partitioned verifier that has not yet learned of epoch 42, the guard does not help until the bus delivers the event; the residual window is bounded by bus delivery latency, not by TTL. This is the correct bound: it is a property of the control plane's delivery, which can be monitored and alerted, rather than a property of cache warmth, which cannot. Operationally this shifts the failure surface from "silent post-revocation execution for TTL duration" to "post-revocation execution for bus-lag duration," and makes the latter observable via a `stale_epoch_rejections` counter and a `high_water_mark_age` gauge per verifier. The guard also makes cold-start safe: a restarted verifier loads the persisted high-water-mark and immediately refuses stale presentations, rather than serving a cold cache that misses into a deny-list it has not yet repopulated. The cost is that every verifier must persist per-subject high-water-marks and must treat the epoch as part of the capability grant, which forces re-negotiation on epoch advance for long-lived sessions. That re-negotiation is not overhead — it is the mechanism by which "continuous" authorization becomes true rather than nominal. ```python import time from dataclasses import dataclass, field class StaleWarrantError(RuntimeError): """Raised when a presented warrant's epoch predates the verifier's high-water-mark.""" class EpochRegressionError(RuntimeError): """Raised when the IdP attempts to advance a subject's epoch non-monotonically.""" @dataclass class Warrant: subject: str capability: str epoch: int expires_at: float @dataclass class Verifier: # Durable high-water-mark: subject -> highest epoch observed. high_water_mark: dict = field(default_factory=dict) # Warm authorization cache keyed on (subject, capability, epoch). cache: dict = field(default_factory=dict) def observe_revocation(self, subject: str, new_epoch: int) -> None: current = self.high_water_mark.get(subject, 0) if new_epoch <= current: raise EpochRegressionError( f"epoch regression for {subject}: {current} -> {new_epoch}" ) self.high_water_mark[subject] = new_epoch def authorize(self, warrant: Warrant, now: float | None = None) -> bool: now = time.time() if now is None else now if warrant.expires_at <= now: raise StaleWarrantError(f"warrant expired for {warrant.subject}") # Monotonic guard: refuse anything older than what we know. hwm = self.high_water_mark.get(warrant.subject, 0) if warrant.epoch < hwm: raise StaleWarrantError( f"presented epoch {warrant.epoch} < high-water-mark {hwm} " f"for {warrant.subject}; cache not consulted" ) key = (warrant.subject, warrant.capability, warrant.epoch) if key in self.cache: return self.cache[key] # Cold path: negotiate, then cache under the versioned key. granted = self._negotiate(warrant) self.cache[key] = granted return granted def _negotiate(self, warrant: Warrant) -> bool: # Placeholder for real capability negotiation (schema + scope check). return True ```