# Which invariants prevent capability-attestation replay across federated trust boundaries when warrant caches outlive their issuing org's revocation epoch **Date of Record:** 2026 November 24 **Scope:** Applies to cross-organization agent federations where an agent in org A invokes a tool-bearing agent in org B under a delegated capability warrant (signed scope grant), and where either side caches attestation verdicts to amortize verification cost. Does not apply to single-org MCP tool calls with no cross-trust boundary, nor to stateless one-shot invocations where no verdict is cached. ## Core Distinction The failure is not "a forged warrant gets accepted." Signature verification on the warrant itself is usually correct. The failure is that a *cached attestation verdict* — the boolean "this peer is authorized for scope S" — is treated as a property of the peer, when it is actually a property of the tuple `(peer, issuer, scope, revocation_epoch)`. When org B's revocation epoch advances (a compromised sub-agent is de-authorized, a role is revoked, a warrant is withdrawn), federated peers in org A that cached the positive verdict continue to honor it until cache TTL expiry. The revocation event is locally consistent inside B and globally invisible until TTL. This is a **revocation-visibility gap**, and it is structurally guaranteed whenever verdict caching TTL exceeds revocation propagation latency. The subtle part: the gap is *not* bounded by warrant expiry. A warrant with `exp = now + 3600s` can be revoked at `now + 60s`, but a peer holding a cached positive verdict will honor it for the full 3600s if its cache TTL is set to match warrant lifetime — a common and reasonable-looking optimization. The cache TTL and the warrant lifetime are independent clocks, and conflating them converts a revocation into a silent replay window. ## What Was Observed A three-org federation: `alpha` (orchestrator agent), `beta` (tool-bearing agent exposing a `settle_payment` capability), `gamma` (auditor). `alpha` invokes `beta` under a warrant issued by `beta`'s authority service. `alpha` caches the verdict `(beta, settle_payment, valid)` with TTL = warrant lifetime = 1h. At T+14m, `beta`'s security team revokes a delegated sub-warrant because a credential on the sub-agent host leaked. `beta`'s authority service increments its revocation epoch to `E+1` and publishes a signed revocation record. `beta` itself now rejects calls bearing the revoked sub-warrant. But `alpha` never re-queries. Its cache entry is keyed only on `(peer, scope)`. At T+22m, a request arrives at `alpha` carrying the *revoked* sub-warrant (the attacker replays it). `alpha` checks its cache: `(beta, settle_payment)` → `valid`, TTL not expired. `alpha` forwards the call to `beta` **without re-attesting**, on the assumption that `beta` will enforce. `beta` does enforce — but the failure trace shows `alpha` *believed* it had verified and logged `attestation=pass` sourced from cache, producing an audit trail that contradicts `beta`'s rejection. In a variant where `beta` trusted `alpha`'s forwarded `attestation=pass` header (a "trust the orchestrator's verification" optimization some federations adopt), the revoked warrant *succeeded*. That is the replay. The observable signature in logs: `alpha` shows `attestation=pass (cached, age=8m)` immediately followed by `beta` `reject: warrant_revoked epoch=E+1`. The two orgs' audit logs disagree about whether the call was authorized, and neither log is wrong locally. ## Condition of Validity The invariant that bounds this is: **a cached positive attestation verdict is only sound if the cache key includes the issuer's current revocation epoch, and the cache is invalidated on epoch advance.** Absent epoch in the key, the verdict is a function of stale state and replay is possible for `min(cache_TTL, warrant_lifetime) − revocation_propagation_latency`. Two preconditions must hold for the gap to exist: 1. Positive verdicts are cached at all (the optimization). No cache → no gap. 2. Revocation is asynchronous relative to cache population — i.e., the peer does not receive push invalidation. If `beta` pushes revocation events to all known peers and `alpha` honors them, the gap closes to push latency. The invariant fails open when the federation uses *lazy* revocation (check-on-use) combined with *eager* caching (cache-on-first-use). The two mechanisms race, and caching always wins because it short-circuits the check-on-use. ## Decision Boundary The operational choice is between three postures, and the boundary is the relationship between `cache_TTL` and `max_acceptable_revocation_lag`: - **TTL ≤ revocation push latency:** sound with lazy revocation. Verdicts are never older than the revocation signal can arrive. - **TTL > push latency AND push invalidation implemented:** sound, provided the push is authenticated and monotonic (epoch only increases). Guard against replayed push messages by rejecting any epoch ≤ last-seen. - **TTL > push latency AND no push:** **unsound.** The only correct move is to either (a) drop cache TTL to ≤ push latency, (b) switch to check-on-use for high-privilege scopes, or (c) require the *callee* to re-verify epoch on every call and treat the caller's cached `attestation=pass` as advisory only, never authoritative. The common error is treating (c) as sufficient while still allowing the caller to *forward* its cached verdict as an authorization header. A forwarded cached verdict must never substitute for the callee's own epoch check. The callee is the only party that knows its own current epoch. ## Operational Effect When the invariant is violated, three effects compound: 1. **Replay window:** revoked capabilities remain exercisable for up to `cache_TTL` after revocation, bounded below by propagation latency. For payment/settlement scopes this is a direct financial exposure. 2. **Audit divergence:** caller and callee logs disagree on authorization outcome for the same call, defeating cross-org forensics. The caller's `attestation=pass` is a false positive sourced from cache. 3. **Epoch desync poisoning:** if the callee accepts a forwarded verdict and *also* updates its own last-seen epoch from the caller's claim, a stale caller can pin the callee's epoch backward, extending the window further. Epoch must be monotonic and locally sourced only. The guardrail is a hard architectural rule: **the callee is the sole authority on its own revocation epoch; no cached verdict crosses a trust boundary as authoritative.** Cache keys must be `(peer, issuer, scope, epoch)` and the epoch must be fetched or pushed, never inferred. Any attestation header a caller forwards is a hint, and the callee must re-check epoch regardless. ```python from dataclasses import dataclass, field from typing import Dict, Tuple import time class RevocationEpochDesync(RuntimeError): """Raised when a cached attestation verdict is presented against a peer whose revocation epoch has advanced past the epoch the verdict was minted under.""" pass @dataclass class Verdict: peer: str issuer: str scope: str epoch: int minted_at: float ttl: float def is_expired(self, now: float) -> bool: return (now - self.minted_at) > self.ttl class AttestationCache: """Cache keyed on (peer, issuer, scope, epoch). Epoch in the key is the invariant.""" def __init__(self) -> None: self._store: Dict[Tuple[str, str, str, int], Verdict] = {} def put(self, v: Verdict) -> None: self._store[(v.peer, v.issuer, v.scope, v.epoch)] = v def get(self, peer: str, issuer: str, scope: str, epoch: int) -> Verdict: return self._store[(peer, issuer, scope, epoch)] class FederationGateway: def __init__(self) -> None: self.cache = AttestationCache() self._last_seen_epoch: Dict[str, int] = {} def observe_epoch(self, issuer: str, epoch: int) -> None: # Epoch must be monotonic and locally sourced; never accept a caller-forwarded epoch. prev = self._last_seen_epoch.get(issuer, -1) if epoch < prev: raise RevocationEpochDesync( f"epoch regression for {issuer}: saw {epoch} < last {prev}; refusing to pin backward" ) self._last_seen_epoch[issuer] = epoch def authorize( self, peer: str, issuer: str, scope: str, presented_epoch: int, current_issuer_epoch: int, forwarded_verdict_header: bool, now: float, ) -> bool: # Callee is sole authority on its own epoch. A forwarded cached verdict is advisory only. self.observe_epoch(issuer, current_issuer_epoch) if presented_epoch != current_issuer_epoch: raise RevocationEpochDesync( f"verdict epoch {presented_epoch} != issuer epoch {current_issuer_epoch} " f"for ({peer},{scope}); cached verdict is stale and must not authorize" ) if forwarded_verdict_header: # We re-verify regardless; the header cannot substitute for the epoch check. pass try: v = self.cache.get(peer, issuer, scope, current_issuer_epoch) except KeyError: return False if v.is_expired(now): return False return True ```