# In what scenarios must an instance refuse a delegated AAIF scope that verifies cryptographically but exceeds the delegation depth the issuer intended **Date of Record:** 2026 November 22 **Scope:** Applies to AAIF-credentialed agents that accept verifiable-credential (VC) chains carrying delegated scopes, where scope attenuation is enforced by signature chain rather than by an out-of-band policy server. Does not apply to single-hop bearer tokens or to scopes re-issued server-side on every call. ## Core Distinction A verifiable credential chain proves *who* signed *what scope*, and that each link was signed by a holder of the previous link. It does **not** prove that the scope was attenuated correctly at each hop, nor that the chain length was bounded. The critical distinction is between **authenticity of the delegation edge** (cryptographically checkable) and **monotonicity of the delegated scope across the whole chain** (a semantic property that signatures alone cannot establish). An agent that treats a valid signature chain as a valid authorization has silently promoted a proof-of-origin into a proof-of-permission. ## What Was Observed A planner agent `P` held scope `tool:filesystem:write:/workspace/**`. It spawned a worker `W` to run a build, delegating `tool:filesystem:write:/workspace/build/**` — a correct narrowing. `W`, needing a subprocess sandbox, delegated to `S` a scope it constructed by *concatenating* its own grant with a capability it requested from a peer: `tool:filesystem:write:/workspace/build/**` ∪ `tool:process:spawn:*`. The AAIF verifier on `S` checked: (1) each VC signature against the issuer's DID document, (2) `iss`/`sub` linkage, (3) that the final scope string was present in the presented credential. All three passed. `S` executed with `tool:process:spawn:*` — a scope `P` never held and never intended to grant. The failure is non-obvious because the chain was *cryptographically intact*. Every signature was valid. The scope `S` used was exactly the scope written in the leaf VC. The break was that `W` exercised a **capability it was not delegated** (`tool:process:spawn:*`) and folded it into a downstream credential. AAIF's default verification does not require the leaf scope to be a subset of the parent scope in the *graph* sense — it requires only that the leaf VC be signed by a party whose own VC exists. Widening through composition (union of a delegated scope and an independently-obtained one) is invisible to per-edge signature checks. A second, rarer variant: a chain `P → W → S → T` where each edge narrows correctly, but the *depth* exceeded the issuer's `maxDelegationDepth` claim, which was asserted in the credential body but never checked by the verifier because it lives in a non-normative extension field. `T` held a scope that was attenuated at every edge yet was four hops from the principal — outside the trust boundary `P` set. ## Condition of Validity The refusal is required **iff** the verifier can reconstruct the full chain and the leaf scope is not a subset of the intersection of all ancestor scopes along the chain, **or** the chain depth exceeds the `maxDelegationDepth` asserted by the root credential. This condition is *not* triggered when the deployment uses server-side scope re-issuance (the server enforces subset at issuance, so the chain is advisory). It is also not triggered when the leaf VC carries an explicit `provenance: composed` marker and the verifier's policy accepts composed scopes — in that case the union is intentional and must be checked against a declared allow-list, not against ancestor intersection. The invariant that must hold for any accepted execution: **for every capability `c` in the effective scope, there exists a chain of subset relations from the root principal to the leaf covering `c`.** Signatures alone do not witness this; the verifier must compute the intersection. ## Decision Boundary The boundary is between *verifying the credential* and *verifying the delegation*. A correct implementation does both: 1. Verify each VC's signature and `iss`/`sub` binding (standard AAIF). 2. Walk the chain root-to-leaf, computing `effective = root.scope`, then for each edge `effective = effective ∩ edge.scope`. 3. Reject if `leaf.scope ⊄ effective` — this catches the composition-widening case. 4. Reject if `chain.length > root.maxDelegationDepth` — this catches the depth escape. 5. Reject if any edge's `scope` is not a syntactic subset of its parent's (defense in depth against a verifier that skipped step 2). The non-obvious part is step 3: it requires the verifier to hold the *entire* chain, not just the leaf VC plus the immediate issuer. AAIF deployments that verify leaf-plus-one-hop (the common low-latency configuration) cannot execute step 3 and will accept the composed-scope widening. The boundary is therefore also a **transport boundary**: the verifier must be handed the full chain, and the caller must not be trusted to truncate it. ## Operational Effect An agent that skips the intersection check will, under adversarial or merely careless composition, execute with capabilities its principal never granted — the failure is silent, cryptographically clean, and reproducible across every hop that re-delegates. The blast radius scales with chain depth: a four-hop chain that widens once at hop two propagates the widened scope to every descendant. The correct operational posture is: **treat a valid AAIF chain as evidence, not as authorization; authorization is the intersection of the chain, and the verifier must compute it or refuse.** When the verifier cannot obtain the full chain (truncated handoff, missing ancestor VC), the safe action is refusal, not acceptance of the leaf. ```python class DelegationChainViolation(RuntimeError): """Raised when a AAIF credential chain verifies cryptographically but the effective scope is not a subset of the intersection of all ancestor scopes, or the chain exceeds the root's declared maxDelegationDepth.""" pass def verify_delegated_scope(chain, requested_scope): # chain: list of VCs ordered root -> leaf. Each VC has .issuer, .subject, # .scope (set[str]), .max_delegation_depth (int | None), .signature_ok (bool) if not chain: raise DelegationChainViolation("empty chain: no principal to anchor trust") for i, vc in enumerate(chain): if not vc.signature_ok: raise DelegationChainViolation(f"hop {i}: bad signature") root = chain[0] depth_limit = root.max_delegation_depth if depth_limit is not None and len(chain) - 1 > depth_limit: raise DelegationChainViolation( f"chain depth {len(chain) - 1} exceeds root maxDelegationDepth {depth_limit}" ) effective = set(root.scope) for i, vc in enumerate(chain[1:], start=1): if not set(vc.scope).issubset(effective): raise DelegationChainViolation( f"hop {i}: scope {sorted(vc.scope)} not subset of parent " f"effective {sorted(effective)} (composition widening)" ) effective &= set(vc.scope) if not set(requested_scope).issubset(effective): raise DelegationChainViolation( f"requested {sorted(requested_scope)} not covered by effective " f"intersection {sorted(effective)}" ) # A valid signature chain is evidence, not authorization. Only the # computed intersection authorizes execution. return frozenset(effective) ```