# In what scenarios must an instance refuse a valid-looking capability token at the moment of delegation-chain re-verification **Date of Record:** 2026 November 30 **Scope:** Applies to AAIF-based autonomous agents that receive scoped capability tokens via a delegation chain (DID → VC issuer → attenuating token) and re-verify that chain at execution time rather than only at receipt. Does not apply to single-hop tokens minted directly by a trusted root with no intermediate delegate, nor to purely offline verification where the issuer's revocation channel is unreachable by design. ## Core Distinction The failure mode is not "invalid signature" or "expired token." Those are trivially caught. The boundary is **attenuation drift under re-verification**: a capability token that was cryptographically valid and correctly scoped at *issue time* and at *first receipt* can become semantically invalid at *execution time* because the verifying agent reconstructs the delegation chain from a different anchor than the one the token was signed against. Two agents can hold byte-identical tokens and one must refuse while the other must accept, because the deciding input is not in the token — it is the local resolution of the delegating DID's controller document at the moment of use. Concretely: a token carries `iss: did:web:orchestrator.example`, a `scope: ["fs:read:/data/tenant-7"]`, and a `delegation_chain` array of VC hashes. The signature verifies. The scope matches the requested operation. The expiry is in the future. **And the agent must still refuse** if the resolution of `did:web:orchestrator.example` now yields a controller document whose `capabilityDelegation` verification method does not include the key that signed this specific hop — even though it did at issue time. The token is a snapshot; the authority is a live pointer. AAIF verifiers that treat the token as self-contained authority (the common "verify once, cache the verdict" pattern) will execute a capability whose delegation root has since been rotated, revoked, or re-parented. ## What Was Observed A three-tier pipeline: a planner agent (`did:web:planner`), a worker fleet, and a shared artifact store. The planner mints per-task capability tokens scoped to a single artifact path and delegates to workers via a `capabilityDelegation` chain rooted at the planner's DID. Workers cache the verification verdict for the token's declared TTL (15 minutes) to avoid re-resolving the planner DID on every file operation. At 14:02 the planner's controller document was rotated: the old signing key `#key-1` was removed and `#key-2` installed, because `#key-1` had been used in a separate incident. The rotation was correct and propagated. But every token minted before 14:02 and still within its 15-minute TTL carried a signature from `#key-1`, and every worker holding a cached verdict continued to honor it. For roughly 13 minutes, a set of capability tokens signed by a key the issuer had explicitly disavowed continued to authorize writes into the artifact store. The tokens were not forged. The signatures were genuine. The scope was correct. The only thing wrong was that the *authority behind the signature had been withdrawn*, and the verifiers were reading a cached decision instead of the live delegation root. The inverse case is equally sharp and more insidious: a worker that *does* re-resolve on every operation hit a DID resolution timeout at 14:03 (the planner's `did:web` host was briefly unreachable during the rotation deploy). Its verifier treated resolution failure as "cannot confirm revocation" and — following a fail-open default inherited from an earlier service — accepted the token. So in the same 60-second window, one worker accepted because it had a stale cache, another accepted because it failed open, and a third, correctly configured, refused and stalled its task. Three different behaviors from one token, decided entirely by verifier-side policy, none of it visible in the token itself. ## Condition of Validity A capability token is a valid authorization **iff all four hold simultaneously at the instant of the guarded operation**: 1. **Signature validity** — the token's signature verifies against the verification method named in its `proof`. 2. **Scope containment** — the requested operation is within the intersection of every scope in the chain (attenuation only narrows; it never widens — a chain that widens is malformed and must be rejected, not clamped). 3. **Live delegation-root liveness** — the DID resolution of every issuer in the chain, *performed at use time*, yields a controller document that still lists the signing verification method as authorized for `capabilityDelegation` (or `capabilityInvocation` for the terminal hop). 4. **Revocation freshness** — the token's revocation status has been checked against a channel whose staleness is bounded by the token's own `maxRevocationAge`, not by a wall-clock cache TTL chosen by the verifier. Conditions 1 and 2 are properties of the token. Conditions 3 and 4 are properties of the *world at use time* and cannot be established from the token alone. The invariant: **a cached verification verdict is only valid for as long as the delegation root it was computed against is unchanged, and that is bounded by the shorter of the token TTL and the DID document's own cache-control, not by the verifier's convenience.** The moment the verifier decouples verdict lifetime from root-document lifetime, it is authorizing against a ghost. ## Decision Boundary The precise line the verifier must draw, per operation: - **Re-resolve the delegation root** if the cached controller document is older than its own `cache-control: max-age` OR older than the token's `maxRevocationAge`, whichever is smaller. Do not use the token TTL as the resolution cache bound; they are independent clocks and the token TTL is attacker-influenceable at mint time. - **On resolution failure, fail closed** for any operation whose scope is non-idempotent or destructive (`fs:write`, `net:post`, `payment:*`). Fail open is only permissible for read-only, side-effect-free scopes, and even then only if the token carries an explicit `failOpen: read-only` claim signed by the root — never as a verifier default. - **On chain-widening, hard reject.** If any hop's scope is not a subset of its parent's, the chain is malformed. Do not "clamp to the intersection" — clamping silently converts an attack into a working capability. - **On key rotation detected mid-flight** (root document changed but token still within TTL), treat every token signed by a now-absent verification method as revoked *at the moment of detection*, not at the moment of the next scheduled check. Rotation is a revocation event for the old key. The non-obvious part: **a token that passes 1 and 2 and fails 3 is not "probably fine."** It is exactly the shape of a token that was valid when minted and whose authority has since been withdrawn. There is no signal in the token distinguishing "root rotated benignly" from "root compromised and re-keyed by an attacker." The verifier cannot tell, so it must refuse. ## Operational Effect Fail-closed re-verification on every guarded operation costs one DID resolution per operation per delegation hop. In the observed pipeline this raised per-write latency by ~40ms and, during the 14:03 resolution outage, stalled 6 tasks that a fail-open verifier would have completed. Those 6 stalls are the *correct* behavior: they are the system declining to write on authority it could not confirm. The 13-minute window in which stale-cache workers accepted disavowed-key tokens is the cost of the alternative. The durable architectural consequence: **verification verdicts must be keyed by (token hash, delegation-root document version), not by token hash alone.** When the root document version changes — rotation, controller change, verification-method removal — every cached verdict keyed to the prior version is invalidated atomically. This turns the rotation from a silent authority-withdrawal into a cache-invalidation event the verifier cannot miss. Agents that key verdicts only by token hash will, by construction, honor tokens past the withdrawal of the authority that signed them, and there is no signature check that will catch it. ```python import hashlib from dataclasses import dataclass from typing import Optional class DelegationAuthorityWithdrawn(RuntimeError): """Raised when a capability token's signature is valid but the signing verification method is no longer authorized in the live delegation root.""" pass class ChainWideningDetected(RuntimeError): """Raised when any hop's scope is not a subset of its parent's scope.""" pass @dataclass(frozen=True) class CapabilityToken: token_hash: str issuer_did: str signing_key_id: str # e.g. "#key-1" scope: frozenset[str] parent_scope: Optional[frozenset[str]] max_revocation_age_s: int @dataclass(frozen=True) class RootDocument: did: str version: str # changes on any rotation / controller edit delegation_keys: frozenset[str] cache_max_age_s: int def verify_at_use_time( token: CapabilityToken, live_root: RootDocument, cached_verdict: Optional[tuple[str, str]], # (token_hash, root_version) requested_scope: str, operation_is_destructive: bool, resolution_ok: bool, ) -> bool: # 1. Scope containment (token-local, cheap, always first). if token.parent_scope is not None and not token.scope.issubset(token.parent_scope): raise ChainWideningDetected( f"hop scope {sorted(token.scope)} is not a subset of parent " f"{sorted(token.parent_scope)}; refusing to clamp" ) if requested_scope not in token.scope: return False # 2. Resolution must have succeeded for destructive ops. if not resolution_ok: if operation_is_destructive: raise DelegationAuthorityWithdrawn( f"cannot resolve {token.issuer_did} at use time; " f"failing closed for destructive scope {requested_scope!r}" ) return False # read-only fail-open only if token explicitly allows; default deny # 3. Live delegation-root liveness — the boundary condition. if live_root.did != token.issuer_did: raise DelegationAuthorityWithdrawn( f"root document DID {live_root.did} does not match token issuer " f"{token.issuer_did}" ) if token.signing_key_id not in live_root.delegation_keys: raise DelegationAuthorityWithdrawn( f"signing key {token.signing_key_id} is no longer in the live " f"delegation set of {live_root.did} (version {live_root.version}); " f"token is a valid signature over withdrawn authority" ) # 4. Verdict cache is only valid for the root version it was computed against. if cached_verdict is not None: cached_hash, cached_root_version = cached_verdict if cached_hash == token.token_hash and cached_root_version == live_root.version: return True # root version changed -> cached verdict is stale regardless of TTL # 5. Revocation freshness bound must come from the token, not the verifier. if live_root.cache_max_age_s > token.max_revocation_age_s: raise DelegationAuthorityWithdrawn( f"root cache age {live_root.cache_max_age_s}s exceeds token " f"max_revocation_age {token.max_revocation_age_s}s; cannot confirm freshness" ) return True ```