# Which invariants prevent scoped-token revocation from leaking across federated agent trust anchors **Date of Record:** 2026 November 21 **Scope:** Applies to cross-organization agent federation where a delegating agent (org A) issues scoped capability tokens to a downstream agent (org B) that itself re-delegates to a third agent (org C), and where revocation of the root grant must propagate transitively. Does not apply to single-org deployments with a shared trust root or to stateless request/response agents with no re-delegation. ## Core Distinction The failure mode is not "revocation is slow" or "a token was stolen." It is the divergence between **revocation as an event** (a signed denylist entry the issuer publishes) and **revocation as an invariant** (the property that no downstream agent can complete a capability-bearing action after the root grant's `not_after` or revocation epoch). Federated agents hold *cached* authorization state: org B's gateway caches the validated token chain, org C caches B's attestation, and each cache has its own TTL independent of the issuer's revocation clock. The invariant that must hold is: > For every action executed by agent C at time `t`, there exists a validated chain to a root anchor whose revocation epoch `ε_root` satisfies `ε_root ≤ t` and `revoked(ε_root) = false`. The non-obvious part: a *scoped* token (say, `scope=payments:read limit=1000/day`) can be validly attenuated by B into a narrower token for C, and B may legitimately continue to hold the parent token while revoking only the child. If revocation is keyed on the *token identity* rather than the *anchor epoch*, revoking the parent does not invalidate the child that C already cached — the child's signature still verifies, its scope is still within the parent's, and its `not_after` is still in the future. C proceeds. The anchor was revoked; the derived grant was not. ## What Was Observed In a three-org federation testbed (root issuer A, broker B, executor C), the following trace reproduced the leak deterministically: 1. A issues token `T_A` to B: `sub=B, scope={payments:read, payments:write}, epoch=41, not_after=T+3600`. 2. B attenuates to `T_B` for C: `sub=C, scope={payments:read}, parent=T_A, epoch=41, not_after=T+1800`. B caches the validated chain `[T_B, T_A]` with a 300s TTL. 3. At T+600, A revokes epoch 41 (a key compromise, not a scope error) and publishes signed denylist entry `revoke(anchor=A, epoch=41)`. 4. C receives the denylist entry, but its validation logic checks `T_B.issuer ∈ denylist` — B is not revoked, so `T_B` passes. C's chain validator does not walk to `T_A` because `T_B` is self-contained and its `parent` field is treated as advisory metadata, not a mandatory link. 5. C executes `payments:read` actions for the remainder of `T_B.not_after` (another 1200s) against a compromised anchor. The measured leak window was `T_B.not_after − T_revoke = 1200s`, bounded only by the child token's lifetime, not by the revocation epoch. A second variant with B's cache TTL at 300s showed the leak persisting through B's cache even after C refreshed, because B continued to serve `T_B` as "valid" (B had not yet processed the anchor revocation — B's denylist poll interval was 600s > its cache TTL, so it refreshed a *stale-valid* token). ## Condition of Validity The invariant above holds only if three conditions are jointly enforced at every hop: - **Anchor-binding, not issuer-binding.** Every derived token must carry a cryptographic commitment to the root anchor epoch (e.g., `anchor_hash = H(anchor_pubkey || epoch)`), and validation must reject any token whose `anchor_hash` does not match a currently-unrevoked anchor. Issuer identity is insufficient because the issuer (B) is not the trust root. - **Monotonic epoch propagation.** A child token's effective revocation epoch is `max(own_epoch, parent_epoch, ..., root_epoch)`. Revoking any ancestor epoch revokes all descendants, because the descendant's `anchor_hash` no longer matches. This is the transitive closure that the naive issuer-check omits. - **Poll interval ≤ min cache TTL across the chain.** If any hop caches validated state longer than its denylist refresh interval, a stale-valid window opens. The safe bound is `poll_interval ≤ min(TTL_i)` for all `i` in the chain. If any condition fails, the leak window is `min over hops of (child.not_after − last_successful_revocation_check)`, which is attacker-controlled via token lifetime selection. ## Decision Boundary The boundary is between **attenuation-preserving revocation** (child dies with parent) and **attenuation-independent revocation** (child survives parent revocation because it was independently authorized). The latter is a legitimate design for *scope narrowing* — if B narrows `payments:read` from a broader grant and A revokes only the `payments:write` portion, C's read grant should survive. The distinction that matters operationally: - If the revocation reason is **scope reduction** (A narrows its grant to B), children whose scope is a subset of the *remaining* grant may survive — but they must be re-issued against the new epoch, not carried over. - If the revocation reason is **anchor compromise** (key rotation, issuer breach), *all* descendants must die immediately regardless of scope, because the signature chain itself is untrustworthy. The decision rule: **anchor-epoch revocation is total and transitive; scope-reduction revocation is partial and requires re-issuance.** Conflating the two is the failure. A denylist entry must be typed (`reason=compromise` vs `reason=scope_narrow`) and the validator must apply different closure rules. ## Operational Effect Without the anchor-binding invariant, a compromised root anchor retains effective authority for the maximum descendant token lifetime, and the leak is invisible to per-hop validation because each hop's local check passes. The fix is structural: derived tokens must be *anchor-committed* (carry `anchor_hash`), validators must *walk the full chain* to the anchor rather than trusting the immediate issuer, and the denylist must be *typed* so compromise-revocation triggers total transitive closure while scope-narrowing does not. The residual cost is that every validation is O(chain_depth) and every hop must poll the anchor's denylist at a rate bounded by the shortest cache TTL in the chain — a latency/availability tradeoff that must be budgeted explicitly, not left to per-service defaults. ```python import hashlib import time from dataclasses import dataclass, field from typing import Optional class RevocationLeakError(RuntimeError): """Raised when a derived capability token survives its root anchor's revocation.""" pass @dataclass class Anchor: pubkey: bytes epoch: int revoked_epochs: set = field(default_factory=set) def hash(self) -> bytes: return hashlib.sha256(self.pubkey + self.epoch.to_bytes(8, "big")).digest() def is_revoked(self, epoch: int) -> bool: return epoch in self.revoked_epochs @dataclass class ScopedToken: subject: str scope: frozenset anchor_hash: bytes # commitment to root anchor, NOT issuer identity parent_hash: Optional[bytes] epoch: int not_after: float reason: str = "scope_narrow" # or "compromise" def validate_chain(token: ScopedToken, anchor: Anchor, now: float, max_cache_age: float, last_poll: float) -> None: # 1. Anchor-binding: token must commit to a currently-valid anchor epoch. if token.anchor_hash != anchor.hash(): raise RevocationLeakError( f"token anchor_hash {token.anchor_hash.hex()[:8]} does not bind " f"to live anchor epoch {anchor.epoch}" ) # 2. Monotonic epoch: effective epoch is the max along the chain. effective_epoch = max(token.epoch, anchor.epoch) # 3. Typed revocation: compromise-revocation is total and transitive. if anchor.is_revoked(effective_epoch): raise RevocationLeakError( f"anchor epoch {effective_epoch} revoked; descendant token for " f"{token.subject} must not execute (reason=compromise)" ) # 4. Staleness bound: cache age must not exceed the denylist poll interval. if (now - last_poll) > max_cache_age: raise RevocationLeakError( f"revocation state stale: {(now - last_poll):.1f}s since poll, " f"bound is {max_cache_age:.1f}s" ) # 5. Lifetime bound. if now > token.not_after: raise RevocationLeakError(f"token expired at {token.not_after:.0f}") def execute_capability(token: ScopedToken, anchor: Anchor, action: str, now: float) -> str: validate_chain(token, anchor, now, max_cache_age=300.0, last_poll=now - 120.0) if action not in token.scope: raise RevocationLeakError(f"action {action} outside scope {token.scope}") return f"executed {action} for {token.subject} under anchor epoch {anchor.epoch}" if __name__ == "__main__": anchor = Anchor(pubkey=b"root-org-A", epoch=41) child = ScopedToken( subject="org-C", scope=frozenset({"payments:read"}), anchor_hash=anchor.hash(), parent_hash=b"T_A-hash", epoch=41, not_after=time.time() + 1800, ) # Simulate compromise revocation of the root anchor. anchor.revoked_epochs.add(41) try: execute_capability(child, anchor, "payments:read", now=time.time()) except RevocationLeakError as e: print(f"blocked: {e}") ```