# In what scenarios must an instance treat a delegated OAuth scope as revoked when a verifiable agent credential (VAC) chain re-validates but the scope's delegation depth has silently collapsed **Date of Record:** 2026 November 26 **Scope:** Applies to AAIF deployments where an agent presents a verifiable credential chain (root issuer → delegating agent → executing agent) alongside an OAuth access token whose `scope` and `act` (actor) claims were minted at delegation time. Does not apply to single-hop tokens minted directly by the resource owner, nor to opaque tokens resolved server-side without a VAC chain. ## Core Distinction The failure is not signature validation. Every signature in the chain verifies. The failure is that the *delegation depth encoded in the token* and the *delegation depth reconstructable from the VAC chain* diverge after a mid-flight re-delegation, and the verifier—because it checks the two artifacts independently—accepts a token whose scope grants now exceed what any surviving credential in the chain actually warrants. Concretely: an OAuth `scope` string is a flat set. A VAC chain is an ordered, signed sequence with a `delegation_depth` and a per-hop `scope_attenuation` record. When agent B re-delegates to agent C and then B's own credential expires or is revoked *after* C's token was minted, the token C holds still carries the original scope union. The chain re-validates because C's credential is rooted at the original issuer and does not require B to be live. The scope, however, was only ever legitimate *through* B. The two verification paths disagree, and the default AAIF verifier resolves the disagreement in favor of the token, because token introspection is cheaper and is checked first. ## What Was Observed A three-agent pipeline: orchestrator `A` (root, holds `orders:write` and `inventory:read`), worker `B` (delegated `orders:write` with depth 1), and sub-worker `C` (delegated from B, depth 2, token minted at T+0). At T+40s, `B`'s credential was revoked by the issuer after a policy violation flag—but `B` had already minted `C`'s access token with a 600s TTL and had embedded the *original* scope union rather than the attenuated scope. At T+41s, `C` called the resource server. The verifier: 1. Introspected the token → `active: true`, `scope: "orders:write inventory:read"`, `act: {sub: "B", sub: "C"}`. Passed. 2. Fetched and verified `C`'s VAC chain → root signature valid, `C`'s credential valid, `B`'s credential *absent from the presented chain* (C presented only its own credential plus root). Passed. 3. Cross-checked `act` claim against chain → `act.sub` chain was `[C]` only; no mismatch was flagged because the verifier only asserts `act.sub == credential.subject`. Result: `C` exercised `inventory:read`, which `B` had never been authorized to pass through—`B`'s own delegation was scoped to `orders:write` only. The scope union in the token was a mint-time artifact of a buggy delegation helper that copied the parent token's scope verbatim. The trace showed the verifier's decision was *internally consistent*: each check passed. The invariant that broke was the implicit one that "token scope ⊆ chain-warranted scope." Nothing in the AAIF spec's default verification profile asserts it. ## Condition of Validity The delegated scope is only valid when, for every scope atom `s` in the token, there exists a contiguous path from root to the presenting agent in the *currently resolvable* VAC chain such that `s ∈ scope_attenuation(hop)` for every hop, and every hop's credential is within its validity window at verification time. This is a *reachability* condition over the live chain, not a set-membership condition over the token. The boundary is sharp: the moment any intermediate credential in the path is revoked or expires, every downstream token minted *through* that credential loses warrant for any scope atom not independently re-derivable from a still-live path. A token does not "remember" its ancestry unless the verifier reconstructs it. Depth collapse is silent because the token's `act` claim is a list of *identifiers*, not a signed chain—it cannot prove B was ever in the path, only that B's `sub` was recorded. ## Decision Boundary An instance must treat the scope as revoked—must fail closed—when *all* of the following hold: - The token introspects `active: true`. - The presented VAC chain re-validates cryptographically. - The chain's reconstructable delegation depth is *less than* the depth implied by the token's `act` claim (i.e., `len(act_chain) > len(credential_chain) - 1`). - At least one `act` identifier in the token is not present as a credential in the presented chain. Conversely, an instance may proceed when the chain is *longer* than the `act` claim (benign: extra provenance) or when depths match exactly and every scope atom is covered by the intersection of hop attenuations. The non-obvious part: the naive heuristic "if `act` mentions an agent not in the chain, reject" produces false positives on legitimate token refresh, where the `act` claim is rewritten at each mint and older actors are dropped. The correct test is *depth comparison plus scope coverage*, not identifier membership alone. Identifier membership is necessary but not sufficient; depth collapse is the actual signal. ## Operational Effect Verifiers that check token and chain independently will admit privilege escalation across a revoked intermediate for the full token TTL—up to 600s in the observed case, unbounded if TTLs are long. The blast radius is bounded only by the resource server's own authorization checks, which in most AAIF deployments are coarse (scope-string match), so the escalation is real. The guardrail is a mandatory *chain-reachability assertion* inserted between introspection and authorization: reconstruct the live chain, compute per-hop scope attenuation intersection, and assert `token_scope ⊆ warranted_scope`. If the assertion cannot be evaluated because an intermediate credential is unresolvable, the correct action is fail-closed with a distinct error class—not a fallback to token-only authorization. Caching introspection results across the revocation window compounds the failure and must be keyed on chain root plus depth, not on token hash alone. ```python from dataclasses import dataclass class DelegationDepthCollapseError(RuntimeError): """Raised when a token's act-claim depth exceeds the live VAC chain depth, indicating a revoked or expired intermediate was silently dropped.""" pass @dataclass class Credential: subject: str delegation_depth: int scope_attenuation: frozenset[str] valid: bool @dataclass class Token: active: bool scope: frozenset[str] act_chain: list[str] # ordered actor identifiers, oldest first def verify_delegated_scope(token: Token, chain: list[Credential]) -> frozenset[str]: if not token.active: raise DelegationDepthCollapseError("token inactive; fail closed") live = [c for c in chain if c.valid] warranted = frozenset.intersection(*(c.scope_attenuation for c in live)) if live else frozenset() # Depth check: token's act chain must not outrun the live credential chain. if len(token.act_chain) > len(live): missing = set(token.act_chain) - {c.subject for c in live} raise DelegationDepthCollapseError( f"depth collapse: act_chain={token.act_chain} live_chain=" f"{[c.subject for c in live]} missing_intermediates={sorted(missing)}" ) if not token.scope <= warranted: raise DelegationDepthCollapseError( f"scope escalation: token={sorted(token.scope)} warranted={sorted(warranted)}" ) return token.scope ```