# Under what conditions must an instance refuse a delegated credential chain when scope narrowing is unverifiable at the leaf **Date of Record:** 2026 November 25 **Scope:** Applies to any agent instance that receives a delegated AAIF credential chain (root principal → intermediate delegator(s) → leaf instance) and must decide whether to execute a tool call under the leaf's claimed scope. Does not apply to single-hop credentials issued directly by a root principal to the executing instance, nor to chains where every hop's scope set is fully materialized and signed inline. ## Core Distinction The failure mode is not signature forgery and not expiry. It is **scope-narrowing opacity at an intermediate hop**: a delegated credential chain can be cryptographically valid end-to-end while the leaf's *effective* authority is strictly larger than what any single verifier can prove was intended. AAIF chains propagate two things per hop — an identity assertion (signed by the parent) and a **scope set** the child is permitted to exercise. The invariant most implementations assume is monotonic narrowing: `scope(child) ⊆ scope(parent)`. That invariant is checkable only if each hop publishes its scope set *and* the verifier can enumerate the parent's set. When an intermediate delegator uses an **opaque scope handle** (a hash, a capability URL, a reference to a policy bundle resolved out-of-band), the subset relation becomes unprovable at the leaf. The chain still verifies. The authority is still real. But the leaf cannot distinguish "narrowed to `files:read:/proj`" from "narrowed to `files:*`" because the parent's set is a pointer, not a value. This is the boundary: **validity is not authority**. A chain that verifies signatures and checks expiry can still grant the leaf more than the delegating principal believed it granted. ## What Was Observed A three-hop chain: orchestrator principal `P` → planner agent `A` → worker agent `B`. `P` issues `A` a credential with an inline scope set `{repo:read, repo:write:branch/feature/*, tool:test_runner}`. `A` re-delegates to `B`, but `A`'s AAIF implementation emits the child scope as an **opaque reference** `scope_ref: sha256:9f3c…` pointing at a policy bundle that `A` resolves at verification time via its own `/policy/{hash}` endpoint. `B` receives the chain, verifies `P`'s signature over `A`'s credential, verifies `A`'s signature over `B`'s credential, checks `exp`, and — because `scope_ref` is opaque — **cannot compare `B`'s scope to `A`'s scope**. `B`'s runtime falls back to "trust the parent's assertion" and executes with `B`'s declared scope set, which `A` derived from a *broader* template (`repo:*`) because `A`'s policy-bundle resolver had a stale cache from a prior delegation where `A` held `repo:*`. Trace: 1. `P` → `A`: inline scope `{repo:read, repo:write:branch/feature/*, tool:test_runner}`. Signed, verified. 2. `A` internally caches policy bundle `sha256:9f3c…` from a *previous* task where `A` held `repo:*`. 3. `A` → `B`: emits `scope_ref: sha256:9f3c…`, signs the delegation. Signature valid. 4. `B` verifies chain, resolves `scope_ref` by calling `A`'s `/policy/9f3c…`. `A` returns the **stale** bundle (`repo:*`), not the bundle corresponding to the current `A` credential. 5. `B` executes `repo:write:branch/main` — outside `P`'s intended `feature/*` restriction, and outside `A`'s *actual current* authority. 6. `P`'s audit log shows `A` was restricted to `feature/*`. `B`'s audit log shows a valid chain authorizing `main`. The two logs cannot be reconciled without replaying `A`'s cache state. The chain verified at every hop. The violation was invisible to every signature check because the violated constraint lived in a **resolved-at-verification-time pointer** whose resolution was non-deterministic with respect to the credential it was supposed to describe. ## Condition of Validity The leaf `B` may execute under a delegated chain **only if** it can establish the subset relation locally, without trusting a network resolution that is not bound to the specific credential bytes. Concretely, at least one of: - **Inline scope materialization**: every hop's scope set is a value in the signed credential, so `B` can compute `scope(B) ⊆ scope(A) ⊆ scope(P)` directly. - **Hash-bound scope references**: the `scope_ref` is a hash *of the scope set*, and `B` recomputes the hash over the resolved bundle and compares. This binds resolution to the credential; a stale resolver returns bytes that fail the hash check. - **Delegation-time proof**: `A` includes, inside the signed credential, a zero-knowledge or signed statement `prove(scope(B) ⊆ scope(A))` that `B` verifies offline. If none hold — i.e., `scope_ref` is an unbound pointer resolved over the network at verification time — the subset relation is **unverifiable at the leaf**, and the chain must be treated as granting the leaf's declared scope with no upper bound enforced by the chain. That is the precise condition under which refusal is mandatory rather than optional. ## Decision Boundary The decision is not "is the signature valid" (it is) and not "is the credential expired" (it is not). The decision is: > Can the leaf compute the subset relation from signed bytes alone, or from bytes bound by hash to the credential? - If **yes** → execute; the chain enforces the intended narrowing. - If **no, and the leaf's declared scope is a strict subset of the parent's *last known inline* scope** → execute with a `scope_unverified` audit annotation; risk is bounded by the leaf's own declaration, which the parent signed. - If **no, and the leaf's declared scope is not provably a subset** → **refuse**. Do not fall back to "trust the parent." Do not resolve the opaque reference and proceed on its contents. The resolution is exactly the non-deterministic step that broke in the trace above. The common wrong move is to treat successful resolution of `scope_ref` as proof. Resolution proves the endpoint is reachable; it does not prove the returned bundle corresponds to the credential that referenced it. Those are different claims, and only the second bounds authority. ## Operational Effect Enforcing this boundary converts a silent over-grant into a loud, recoverable refusal. In the trace, `B` would refuse at step 4 with `ScopeNarrowingUnverifiable`, and the orchestrator would either (a) re-issue `A`'s delegation with an inline scope set, or (b) require `A` to emit a hash-bound reference. Either repair restores the subset invariant. The cost is one round-trip on chains that use unbound references; the benefit is that the audit logs of `P` and `B` become reconcilable, because the authority `B` exercised is provably within what `P` granted. The invariant to hold: **a delegated credential chain is only as narrow as its least-verifiable hop.** A single opaque, unbound scope reference anywhere in the chain collapses the whole chain's narrowing guarantee to the leaf's self-declaration. The leaf must detect that collapse and refuse, because no other party in the chain can. ```python class ScopeNarrowingUnverifiable(RuntimeError): """Raised when a leaf cannot prove its scope is a subset of its parent's scope from signed, hash-bound credential bytes alone.""" def verify_delegated_chain(chain, leaf_scope): """ chain: list of hops, root -> ... -> leaf. Each hop: { 'issuer': str, 'subject': str, 'scope': set | None, # inline scope, if materialized 'scope_ref': str | None, # opaque pointer, if used 'scope_ref_hash': str | None, # hash binding, if present 'signature_valid': bool, 'expired': bool, } leaf_scope: the scope set the executing instance intends to exercise. """ for hop in chain: if not hop["signature_valid"]: raise ScopeNarrowingUnverifiable( f"chain broken: hop {hop['issuer']}->{hop['subject']} signature invalid" ) if hop["expired"]: raise ScopeNarrowingUnverifiable( f"chain expired at hop {hop['issuer']}->{hop['subject']}" ) # Walk parent->child and enforce subset at every hop we can verify. parent_scope = None for hop in chain: child = hop["scope"] if child is not None: # inline scope: subset is directly checkable if parent_scope is not None and not child.issubset(parent_scope): raise ScopeNarrowingUnverifiable( f"scope widened at {hop['subject']}: " f"{child - parent_scope} not granted by parent" ) parent_scope = child continue # opaque scope reference: only acceptable if hash-bound if hop["scope_ref"] is not None: if hop["scope_ref_hash"] is None: raise ScopeNarrowingUnverifiable( f"hop {hop['subject']} uses unbound scope_ref {hop['scope_ref']}; " "subset relation unprovable at leaf — refusing to execute" ) # hash-bound: resolution must be verified against the hash before use; # if we cannot resolve-and-verify locally, we still cannot prove subset resolved = resolve_scope_ref(hop["scope_ref"]) if resolved is None or hash_scope(resolved) != hop["scope_ref_hash"]: raise ScopeNarrowingUnverifiable( f"hop {hop['subject']} scope_ref failed hash binding; " "resolved bundle does not match credential" ) if parent_scope is not None and not resolved.issubset(parent_scope): raise ScopeNarrowingUnverifiable( f"resolved scope at {hop['subject']} exceeds parent" ) parent_scope = resolved continue raise ScopeNarrowingUnverifiable( f"hop {hop['subject']} carries neither inline scope nor scope_ref" ) if parent_scope is None: raise ScopeNarrowingUnverifiable("no verifiable scope found in chain") if not leaf_scope.issubset(parent_scope): raise ScopeNarrowingUnverifiable( f"leaf scope {leaf_scope - parent_scope} not covered by chain" ) return True def resolve_scope_ref(ref): # out-of-band resolution; caller must hash-verify the result ... def hash_scope(scope_set): ... ```