# When must an instance refuse a delegated capability token whose delegation depth is still within bounds but whose warrant chain contains a revoked ancestor **Date of Record:** 2026 December 1 **Scope:** Applies to any agent runtime that validates AAIF signed capability tokens carrying a delegation chain (`act` / `warrant` claims) before executing a tool call. Does not cover bearer-token-only systems that lack delegation provenance, nor single-hop tokens with no ancestry to verify. ## Core Distinction A delegation-depth check (`depth <= max_depth`) and a revocation check are not the same invariant, and neither subsumes the other. Depth bounds the *length* of the chain; revocation bounds the *validity* of each link. An agent that enforces depth but treats ancestor revocation as an out-of-band concern will happily execute a capability whose root warrant was revoked two hops up, because every *local* signature in the chain verifies and the depth counter is under its ceiling. The invariant that must hold is: **a delegated token is valid only if every ancestor warrant in its chain is simultaneously unrevoked at validation time.** Depth is necessary, not sufficient. ## What Was Observed A three-agent pipeline: an orchestrator (`A`) holds a root capability `cap:root` minted with `max_depth=4`. It delegates `cap:deploy` to worker `B` (depth 1), which delegates to executor `C` (depth 2). Each hop re-signs the token, embedding the full chain of `warrant_id`s and the delegator's signature. The revocation registry is a separate service. `A`'s root warrant was revoked after `B` had already minted its delegated token (a legitimate key-compromise response). `C` presented its token to the tool gateway. The gateway checked: 1. Signature of `C`'s token against `B`'s pubkey — valid. 2. Signature of `B`'s embedded warrant against `A`'s pubkey — valid (revocation does not invalidate historical signatures). 3. `depth == 2 <= max_depth == 4` — valid. All three checks passed. `C` executed `deploy`. The revocation of `A` never propagated because the gateway validated *cryptographic* validity and *depth*, but never queried the revocation registry for the ancestors named in the chain. The failure trace is a clean pass through every gate, because the gate that mattered (ancestor liveness) was never wired in. The subtle part: revocation did not, and could not, retroactively break signatures. A revoked warrant still verifies. So the token is "valid" in the cryptographic sense and "invalid" in the authorization sense, and the two diverge silently. ## Condition of Validity This boundary is only reachable when all of the following hold, which is why it hides: - Delegation chains are length ≥ 2 (a single-hop token has no ancestor to revoke out from under it). - The revocation registry is queried *after* or *independently of* signature verification, and the two results are not conjoined. - Ancestor warrant IDs are present in the token but the validator treats them as audit metadata rather than as a set of live references requiring liveness checks. - Revocation happens between mint-time of a descendant and validation-time of that descendant — the classic TOCTOU window. If any of these fail, the bug is masked. In single-agent setups it never appears. In setups where revocation is checked at mint time only, it appears as a race. It is specifically the *multi-hop, validate-at-use* configuration that makes ancestor revocation a first-class gate. ## Decision Boundary The correct rule: **validation must fail closed if any ancestor warrant is revoked, even when depth is within bounds and all signatures verify.** Concretely, the validator must, before executing: 1. Enumerate every `warrant_id` in the chain, root to leaf. 2. Query the revocation registry for the whole set (batch, to avoid per-hop latency blowup). 3. Reject if *any* is revoked — not just the leaf, not just the immediate delegator. The decision is *not* "is this token's signature valid and is depth okay." It is "is the entire warrant ancestry live right now." A token that passes depth and signature but has a dead ancestor must be refused with an explicit `AncestorRevoked` condition, and the refusal must name the revoked `warrant_id` so the orchestrator can re-mint from a fresh root rather than silently retrying. There is a second-order boundary: revocation checks are subject to their own staleness. If the registry is eventually consistent, a just-revoked ancestor may not appear yet. The guardrail is a bounded staleness budget (a max-age on the revocation view) and a hard rule that tokens whose chain contains any warrant minted within the staleness window are rejected rather than trusted — fail closed on uncertainty, not open. ## Operational Effect Without the ancestor-liveness gate, revocation is advisory: it stops *new* delegations from a compromised root but does not stop *already-issued* descendant tokens from executing until they expire. The blast radius of a key compromise is therefore bounded by token TTL, not by revocation response time — which is exactly backwards from what revocation is supposed to guarantee. Operationally, this means a compromised root's descendants can act for the full lifetime of the deepest token in the tree, and the depth counter gives false assurance because it is under its limit the whole time. The fix is cheap (one batched registry query over the chain's warrant IDs, conjoined with the existing signature and depth checks) but must be wired explicitly, because no individual check fails on its own. ```python from dataclasses import dataclass, field from typing import Iterable class AncestorRevokedError(RuntimeError): """Raised when a delegated token's chain contains a revoked ancestor warrant, even though depth is within bounds and all signatures verify.""" @dataclass class Warrant: warrant_id: str depth: int signature_valid: bool @dataclass class DelegatedToken: leaf_warrant_id: str chain: list[Warrant] = field(default_factory=list) max_depth: int = 4 def validate_token(token: DelegatedToken, revoked: Iterable[str]) -> None: revoked_set = set(revoked) # Gate 1: every signature in the chain must verify. for w in token.chain: if not w.signature_valid: raise AncestorRevokedError( f"signature invalid on warrant {w.warrant_id}" ) # Gate 2: depth bound. leaf_depth = max((w.depth for w in token.chain), default=0) if leaf_depth > token.max_depth: raise AncestorRevokedError( f"depth {leaf_depth} exceeds max_depth {token.max_depth}" ) # Gate 3 (the one that gets forgotten): ancestor liveness. # Signatures and depth can both pass while an ancestor is dead. dead = [w.warrant_id for w in token.chain if w.warrant_id in revoked_set] if dead: raise AncestorRevokedError( f"delegation chain contains revoked ancestor(s): {dead}; " f"re-mint from a fresh root warrant" ) def execute_deploy(token: DelegatedToken, revoked: Iterable[str]) -> str: validate_token(token, revoked) return "deploy executed" if __name__ == "__main__": chain = [ Warrant("root-A", 0, True), Warrant("del-B", 1, True), Warrant("del-C", 2, True), ] tok = DelegatedToken(leaf_warrant_id="del-C", chain=chain, max_depth=4) # Signature + depth pass, but root-A was revoked two hops up. try: execute_deploy(tok, revoked={"root-A"}) except AncestorRevokedError as e: print(f"REFUSED: {e}") ```