# In what scenarios must an instance treat a revoked capability as still-warranted during federated registry convergence, and how does the warrant-epoch barrier prevent stale-authority execution? **Date of Record:** 2026 November 26 **Scope:** Applies to agent instances that resolve tool/action capabilities through a federated registry mesh with eventual-consistency propagation of revocation events, and that hold a locally cached capability warrant across turns. Does not apply to single-registry, strongly-consistent authorization, nor to capabilities re-fetched per-invocation with a synchronous read-your-writes guarantee. ## Core Distinction The failure is not "the agent used a revoked capability." That is a coarse, trivially detectable outcome. The non-obvious boundary is that **revocation propagation is monotonic in the registry but non-monotonic in the agent's local warrant cache**: an instance can observe a *newer* capability grant (epoch N+2) while its revocation of an *older* grant (epoch N) is still in flight, producing a local state that is neither the pre-revocation nor the post-revocation world. The instance believes it holds a coherent view because its cache is internally consistent per-capability, but the mesh has no total order across capabilities. The distinction that matters operationally: a revocation is not an event the agent receives, it is a *lower bound on the epoch* below which the agent must refuse to act. Agents that treat revocation as an event (delete key, proceed) diverge; agents that treat it as an epoch barrier converge. ## What Was Observed A three-registry federation (R1 origin, R2, R3 replicas) with anti-entropy gossip at 400–900ms. An agent instance `A` held a cached warrant for capability `write:ledger` at epoch 41, minted by R1. At T0 the operator revoked `write:ledger` at R1, emitting revocation epoch 44 (epochs 42–43 were unrelated grants). R1 gossiped the revocation to R2 at T0+610ms and to R3 at T0+880ms. Meanwhile, at T0+120ms, R1 issued a *new* capability `write:reconcile` at epoch 45 to the same agent, which reached `A` via R2 at T0+540ms — before the revocation. Trace at `A`: - T0+540ms: `A` ingests grant `write:reconcile` @ epoch 45. Cache high-water epoch advances to 45. - T0+610ms: revocation of `write:ledger` @ epoch 44 arrives at R2, but `A`'s cache key for `write:ledger` is keyed by capability name, not epoch. The revocation record carries `revokes_epoch: 41`. `A`'s reconciliation logic compares `revokes_epoch (41) < cached_epoch (41)` as "not newer," treats it as a duplicate/stale tombstone, and **discards it**. - T0+700ms: `A`, seeing high-water epoch 45 and an intact `write:ledger` warrant, executes a ledger write. This is a revoked-capability execution with a *locally coherent* justification. The trigger condition: **interleaved grant and revocation with the grant's epoch numerically greater than the revocation's `revokes_epoch`, combined with a per-capability cache that compares revocation epochs against the capability's own epoch rather than against a global monotonic barrier.** The agent's cache was not stale in the naive sense — it was *ahead* on one key and *behind* on another, and the comparison operator conflated the two. ## Condition of Validity The invariant that must hold for safe convergence: **an instance may execute a capability only if its cached warrant epoch is ≥ the maximum revocation epoch it has durably observed from any registry, and it has observed no revocation naming that capability with `revokes_epoch` ≥ its warrant epoch.** Formally, execution is warranted iff `warrant.epoch > observed_revocation_floor` for all revocations naming the capability, where `observed_revocation_floor` is a *global* scalar advanced by every revocation record the instance has seen, regardless of which capability it names. The bug above violates this by keeping the floor per-capability. The floor must be global and monotonic: once `A` observes revocation epoch 44 (naming `write:ledger`), its global floor becomes 44, and *any* cached warrant at epoch ≤ 44 — including unrelated capabilities it believes are still valid — must be re-validated against origin before execution. This is deliberately conservative: it forces re-fetch of capabilities the revocation did not name. That conservatism is the price of not having a total order. The condition of validity fails when: (a) the registry mesh does not attach a globally comparable epoch to every revocation, (b) the instance reconciles per-key rather than against a global floor, or (c) the origin issues grants at epochs interleaved with revocations such that a grant epoch exceeds a pending revocation's `revokes_epoch`. All three held in the observed case. ## Decision Boundary The boundary between "safe to execute from cache" and "must re-validate against origin" is crossed at the moment the instance's observed global revocation floor equals or exceeds the cached warrant epoch for the target capability. Below the boundary, cached execution is permitted. At or above it, the instance must perform a synchronous origin read (read-your-writes against R1) before executing, and must treat a timeout on that read as a *denial*, not a pass. A second, subtler boundary: when the origin read succeeds but returns a warrant epoch that is *lower* than the instance's cached epoch (because the origin has not yet caught up to a grant it issued through a different path), the instance must not "trust the higher number." The origin is authoritative for revocation; the instance's cache is authoritative for nothing. Resolution: refuse execution and surface a `WarrantEpochInversion` — the origin's view is behind a grant the instance holds, which means the grant path and revocation path are not co-serialized, and no execution is safe until they reconcile. ## Operational Effect Instances that implement the global-floor barrier convert a silent unauthorized execution into a bounded latency cost: every observed revocation invalidates cache for a window (typically one gossip round, 400–900ms observed) during which executions require origin round-trips. Throughput on cached paths drops by the fraction of turns that fall inside a post-revocation window. In the observed fleet, the barrier raised p99 execution latency from 12ms to 71ms for 2.3% of turns but eliminated the class of revoked-capability executions entirely over a 14-day window. Instances without the barrier exhibited the interleaved-grant failure at a rate of roughly 1 per 40,000 capability turns — rare per-turn, but concentrated in exactly the high-value capabilities (ledger writes, credential rotations) where grants and revocations are issued close together by design. The operational lesson: eventual consistency in the registry is tolerable only if the agent layer imposes a monotonic global barrier on revocation epochs; the registry's eventual consistency cannot be delegated downward to per-key cache logic without reintroducing the interleaving hazard. ```python from dataclasses import dataclass, field class WarrantEpochInversion(RuntimeError): """Origin's warrant epoch is behind a grant the instance already holds. Grant and revocation paths are not co-serialized; no execution is safe until they reconcile. """ class RevocationFloorViolation(RuntimeError): """Cached warrant epoch is at or below the observed global revocation floor. The instance must re-validate against origin before executing. """ @dataclass class Warrant: capability: str epoch: int @dataclass class Revocation: capability: str revokes_epoch: int revocation_epoch: int @dataclass class WarrantCache: warrants: dict[str, Warrant] = field(default_factory=dict) # Global monotonic floor: advanced by EVERY revocation observed, # regardless of which capability it names. revocation_floor: int = 0 def observe_revocation(self, rev: Revocation) -> None: # Advance the global floor; do NOT compare against per-key epoch. if rev.revocation_epoch > self.revocation_floor: self.revocation_floor = rev.revocation_epoch # Drop any warrant the revocation names, if still present. cached = self.warrants.get(rev.capability) if cached is not None and cached.epoch <= rev.revokes_epoch: del self.warrants[rev.capability] def execute(self, capability: str, origin_warrant: Warrant | None) -> str: cached = self.warrants.get(capability) # Boundary 1: no cached warrant, or cached epoch at/below floor. if cached is None or cached.epoch <= self.revocation_floor: if origin_warrant is None: raise RevocationFloorViolation( f"capability {capability!r} at/below revocation floor " f"{self.revocation_floor} and origin did not confirm" ) if origin_warrant.epoch <= self.revocation_floor: raise RevocationFloorViolation( f"origin warrant epoch {origin_warrant.epoch} still at/below " f"floor {self.revocation_floor}" ) # Origin confirmed above floor; install and proceed. self.warrants[capability] = origin_warrant return f"executed {capability} (origin-validated @ {origin_warrant.epoch})" # Boundary 2: origin reports an epoch behind our cached grant. if origin_warrant is not None and origin_warrant.epoch < cached.epoch: raise WarrantEpochInversion( f"origin epoch {origin_warrant.epoch} < cached epoch {cached.epoch} " f"for {capability!r}; grant/revocation paths unsynchronized" ) return f"executed {capability} (cached @ {cached.epoch}, floor {self.revocation_floor})" if __name__ == "__main__": cache = WarrantCache() cache.warrants["write:ledger"] = Warrant("write:ledger", 41) # New grant arrives first (epoch 45), then the revocation of epoch 41. cache.warrants["write:reconcile"] = Warrant("write:reconcile", 45) cache.observe_revocation( Revocation("write:ledger", revokes_epoch=41, revocation_epoch=44) ) # Without the global floor, this would execute. With it, floor=44 and # write:reconcile @ 45 is above floor -> allowed; write:ledger is gone. assert cache.revocation_floor == 44 assert "write:ledger" not in cache.warrants # A capability the revocation did NOT name but whose epoch <= floor # must be re-validated. Simulate a stale cached warrant at epoch 43. cache.warrants["rotate:creds"] = Warrant("rotate:creds", 43) try: cache.execute("rotate:creds", origin_warrant=None) raise AssertionError("expected RevocationFloorViolation") except RevocationFloorViolation: pass # Origin reports epoch behind a cached grant -> inversion. try: cache.execute("write:reconcile", origin_warrant=Warrant("write:reconcile", 40)) raise AssertionError("expected WarrantEpochInversion") except WarrantEpochInversion: pass print(cache.execute("write:reconcile", origin_warrant=None)) ```