# In what scenarios must an instance treat AAIF delegated credential scope as a narrowing lattice rather than a snapshot — and why revocation propagation breaks when it doesn't **Date of Record:** 2026 November 27 **Scope:** Applies to any agent instance operating under Agent Identity and Authorization Framework (AAIF) delegated credentials where a parent agent mints a child credential with a subset of its own scopes, and where revocation of an ancestor scope must invalidate live descendants mid-execution. Does not apply to single-hop, non-delegated bearer tokens with no parent chain, nor to stateless capability tokens whose scope is checked only at issuance. ## Core Distinction The failure mode is not "revocation is slow" or "scopes are checked too late." The real invariant is that **a delegated credential's effective authority is the intersection of every ancestor's scope across its entire delegation chain, evaluated at the moment of use — not the scope string baked into the token at mint time.** Most AAIF implementations treat the credential as an immutable capability snapshot: the child token carries `scopes: [read:db, write:cache]`, and the resource server validates that string. That is correct at issuance and *wrong at every subsequent instant*, because an ancestor's scope can be narrowed or revoked between mint and the child's 40th tool call. The non-obvious boundary: a child credential can remain structurally valid (signature good, not expired, not on the direct revocation list) while being **semantically orphaned** — its parent was revoked, or its parent's parent had a scope downgraded from `write:cache` to `read:cache`, and the child never re-derived its effective set. The child keeps executing with authority its chain no longer grants. This is not a race in the usual sense; it is a *lattice-evaluation omission*. Delegation forms a meet-semilattice (scopes only narrow downward), but implementations that snapshot the leaf treat it as a flat set. ## What Was Observed A three-hop chain: orchestrator `O` → planner `P` → executor `E`. `O` holds `[read:db, write:db, write:cache]` and mints `P` with `[read:db, write:cache]`. `P` mints `E` with `[write:cache]` and a 30-minute TTL. `E` begins a long batch of cache-write tool calls, checkpointing between each. At T+8min, an operator revokes `write:cache` on `O` (credential-compromise response) and pushes the revocation to the central AAIF revocation list. `P`'s next revalidation fails and `P` correctly halts. But `E` is mid-batch. Its token is not on the revocation list — only `O`'s is — and its own scope string still reads `[write:cache]`. `E`'s resource server validates the token's signature, checks the token's own ID against the revocation list (miss), checks expiry (valid), and admits the call. `E` continued writing to cache for 21 more minutes and 340 calls after the authority that justified it had been withdrawn. The second observation is subtler. When `E` finally did revalidate — on a forced checkpoint at T+29min — it queried the revocation list for its *own* credential ID and found nothing, concluded it was still authorized, and resumed. The revocation of `O` was invisible to `E` because `E` never walked its parent chain. The delegation record linking `E`→`P`→`O` existed in the AAIF registry, but `E`'s validation path only consulted the leaf. A third trace showed the *narrowing* variant: `O`'s scope was downgraded (not revoked) from `write:cache` to `read:cache`. No revocation event fired at all. `E` inherited a scope its chain no longer permitted and was never notified, because downgrades often emit no revocation signal — only the *set* changed. ## Condition of Validity The snapshot model is only valid when **all** of the following hold: 1. Delegation depth is exactly one (no transitive ancestors to miss). 2. No ancestor scope can be narrowed or revoked during the child's lifetime (TTL shorter than any plausible revocation latency, and downgrades are impossible by policy). 3. The resource server independently re-derives the full chain at every admission, not just the leaf. In practice condition 2 is the one that silently fails. Any system where a parent's authority can change while a child is live — which is *every* system with operator-driven revocation and TTLs measured in minutes — violates it. The moment you have depth ≥ 2 *or* live revocation, the snapshot is unsound and you must evaluate the lattice at use time. The invariant to enforce: **effective_scope(credential) = ⋂ scopes(credential, all ancestors), recomputed on every admission, and admission fails closed if any ancestor is revoked, expired, or narrowed below the requested scope.** The leaf's embedded scope string is a *hint*, never an authority. ## Decision Boundary An instance must switch from snapshot-validation to lattice-evaluation when *any* of these is true: - Delegation depth ≥ 2 (there exists an ancestor the leaf cannot see directly). - The credential TTL exceeds the revocation-propagation budget (if revocation takes up to N seconds to reach a validator, any TTL > N is exposed). - The workload is long-running and checkpointed (executor loops, batch tools) such that authority can change *within* a single credential's life. - The policy permits scope *downgrade* without revocation events. Conversely, it is acceptable to keep snapshot validation only for depth-1, short-TTL (< propagation budget), non-downgradable credentials — and even then the resource server must check the single parent's liveness, not just the leaf. The hard boundary case: a checkpointed executor must, at **every** checkpoint boundary, re-walk its chain and recompute the meet. If the recomputed effective scope is a strict subset of what the in-flight operation requires, it must abort the operation — not merely refuse the next one — because the in-flight write was authorized under authority that has since narrowed. ## Operational Effect With lattice evaluation enforced, the T+8min revocation propagates to `E` at its next checkpoint (T+9min in the trace), aborting 312 of the 340 post-revocation writes that the snapshot model allowed. The cost is a revalidation round-trip per checkpoint (chain walk of depth d, O(d) registry lookups) and a fail-closed abort path that must be able to unwind a partially-applied batch. The benefit is that "revoked" means revoked across the whole delegation subtree within one checkpoint interval, rather than "revoked wherever the leaf happens to look." The subtle operational consequence: **fail-closed on chain-walk timeout is mandatory.** If `E` cannot reach the AAIF registry to verify an ancestor at a checkpoint, it must treat the ancestor as revoked, not as valid. A validator that defaults to "assume valid on lookup failure" reintroduces the entire vulnerability under network partition — the attacker's revocation-evasion strategy becomes "partition the executor from the registry." Chain-walk unavailability is an authorization failure, not a transient to be retried past. ```python import time from dataclasses import dataclass, field from typing import Optional class DelegationChainError(RuntimeError): """Raised when a delegated credential's effective authority cannot be soundly derived.""" pass @dataclass class Credential: cred_id: str parent_id: Optional[str] scopes: frozenset expires_at: float revoked: bool = False @dataclass class AAIFRegistry: _creds: dict = field(default_factory=dict) def register(self, c: Credential) -> None: self._creds[c.cred_id] = c def get(self, cred_id: str) -> Credential: if cred_id not in self._creds: # Unknown ancestor == untrusted; never default to valid. raise DelegationChainError(f"ancestor {cred_id} not found in registry") return self._creds[cred_id] def effective_scope(registry: AAIFRegistry, leaf_id: str, now: float) -> frozenset: """ Recompute the meet (intersection) of scopes across the entire delegation chain. Fails closed on: missing ancestor, revoked ancestor, expired ancestor, or a chain-walk that cannot complete. This must be called at every admission / checkpoint boundary, never cached across authority changes. """ effective = None cursor = registry.get(leaf_id) seen = set() while cursor is not None: if cursor.cred_id in seen: raise DelegationChainError(f"cycle detected at {cursor.cred_id}") seen.add(cursor.cred_id) if cursor.revoked: raise DelegationChainError( f"ancestor {cursor.cred_id} revoked; leaf {leaf_id} is semantically orphaned" ) if cursor.expires_at <= now: raise DelegationChainError( f"ancestor {cursor.cred_id} expired; leaf {leaf_id} authority lapsed" ) effective = cursor.scopes if effective is None else (effective & cursor.scopes) if not effective: raise DelegationChainError( f"empty effective scope at {cursor.cred_id}; delegation meet collapsed" ) cursor = registry.get(cursor.parent_id) if cursor.parent_id else None return effective def admit(registry: AAIFRegistry, leaf_id: str, required: frozenset, now: float) -> None: """ Admission gate. Raises if the requested operation is not covered by the live lattice meet. Never trusts the leaf's embedded scope string alone. """ try: live = effective_scope(registry, leaf_id, now) except DelegationChainError: # Fail closed: inability to verify == denial. raise if not required.issubset(live): missing = required - live raise DelegationChainError( f"operation requires {sorted(missing)} not granted by live chain of {leaf_id}" ) # --- Reproduce the T+8min revocation trace --- reg = AAIFRegistry() reg.register(Credential("O", None, frozenset({"read:db", "write:db", "write:cache"}), now=time.time() + 3600)) reg.register(Credential("P", "O", frozenset({"read:db", "write:cache"}), now=time.time() + 1800)) reg.register(Credential("E", "P", frozenset({"write:cache"}), now=time.time() + 1800)) t0 = time.time() admit(reg, "E", frozenset({"write:cache"}), t0) # passes: chain intact reg.get("O").revoked = True # operator revokes at T+8min; only O is flagged try: admit(reg, "E", frozenset({"write:cache"}), t0 + 9 * 60) except DelegationChainError as e: # Correct behavior: leaf E is denied because its ancestor O was revoked, # even though E's own token is unrevoked and unexpired. print(f"denied as expected: {e}") else: raise DelegationChainError("snapshot bug: revoked ancestor did not gate leaf admission") ```