# When must an instance refuse a delegated credential whose scope is a strict superset of its own? **Date of Record:** 2026 November 28 **Scope:** Applies to any agent instance that receives an AAIF verifiable credential (VC) carrying a delegation chain and a scoped capability token, where the receiving instance is itself operating under a narrower capability envelope than the credential presents. Does not address root-issuer key compromise, revocation propagation latency, or transport-layer replay (each handled elsewhere in the AAIF spec). ## Core Distinction The failure mode here is not "the credential is invalid." Signature verification passes, the issuer is trusted, the chain is unbroken, and every `delegated_from` link resolves. The failure is **scope amplification at the delegation boundary**: a parent agent holds capability set `C_parent`, mints a child credential whose scope `C_child` is a *superset* of `C_parent` — either by explicit misconfiguration, by a wildcard expansion (`tool:*` derived from `tool:read`), or by a subtle normalization bug where the child's scope list is unioned with a default baseline rather than intersected with the parent's. A downstream instance that *also* holds only `C_parent` (a sibling, not the delegator) receives this credential and must decide whether to honor `C_child`. The naive check — "does the credential verify against a trusted root?" — returns true and the agent proceeds. The correct invariant is stricter: **a credential's effective scope is not its declared scope; it is the intersection of its declared scope with every ancestor scope in the chain, and with the verifying instance's own envelope.** AAIF encodes ancestor scopes in the chain, so the intersection is computable locally. The non-obvious part is that the *declared* scope on the leaf token is advisory, and any consumer that trusts it directly has performed a confused-deputy amplification. ## What Was Observed A three-tier chain was exercised: orchestrator `O` (scope `{fs:read, fs:write, net:egress:api.internal}`) delegated to planner `P` (scope `{fs:read, net:egress:api.internal}`), which delegated to executor `E`. The credential minted for `E` declared scope `{fs:read, fs:write, net:egress:*}` — the planner's minting path applied a "capability preset" for executors that unconditionally added `fs:write` and widened egress to a wildcard. Signature chain verified clean. `E`'s local envelope was `{fs:read}`. Two distinct violations were latent in that single leaf token: 1. **Vertical amplification (`fs:write`)**: `E`'s declared scope exceeded its own envelope. A verifying instance that checked only chain validity would have permitted a write that `E` was never entitled to perform. 2. **Horizontal amplification (`net:egress:*`)**: the wildcard, when expanded by the consumer, admitted egress to hosts never authorized anywhere in the chain. Wildcard expansion is where superset violations hide most often, because `*` is not a member of any finite ancestor set — the intersection of `*` with `{api.internal}` is `{api.internal}`, but a consumer that expands `*` *before* intersecting gets the full egress space. The trace: `E` requested `fs:write:/tmp/scratch`. The verification path checked (a) signature — pass; (b) chain integrity — pass; (c) `fs:write` ∈ declared scope — pass. The request executed. The write landed in a path that the orchestrator's `fs:write` grant had scoped to a specific project root; the planner's preset dropped the path constraint entirely. The credential was cryptographically valid and semantically out of bounds. ## Condition of Validity The refusal rule is valid, and must be enforced, under these conditions: - **The chain is fully presented.** Every delegation link from root to leaf carries its `scope` field. AAIF requires this; a chain with any link omitting `scope` is malformed and must be rejected outright, not defaulted to "unrestricted." - **Intersection is computed over normalized scopes.** Normalization must expand wildcards to their *intended* finite sets only when the wildcard appears in an ancestor and the consumer can resolve it against a known resource registry. A wildcard in a *descendant* that cannot be resolved against an ancestor's finite grant is treated as empty, never as universal. - **The verifying instance's own envelope is the final clamp.** Even a correctly-narrowed chain cannot grant more than the local envelope. Effective scope = `declared ∩ (⋂ ancestors) ∩ envelope`. - **Delegation is monotone-decreasing.** No link may widen scope relative to its parent. This is the invariant the observed system violated; it is the single check that catches both amplification classes. The rule does *not* apply when the verifying instance is the root issuer itself (no ancestor to clamp against), or when the credential is presented for a capability the instance does not intend to exercise — refusal is deferred until use, but the clamp must still be recorded at intake so a later tool call cannot consult the unclamped declared scope. ## Decision Boundary The boundary is between **verify-then-trust-declared** and **verify-then-clamp**. The former is the default in most SDK implementations because it mirrors TLS: a valid cert is a valid cert. But a VC's scope is not a property of the cert's authenticity; it is a property of the cert's *authority*, which is only meaningful relative to the chain and the consumer. The decision procedure: 1. Verify signature and chain integrity. Reject on failure. 2. Walk the chain root→leaf, computing `⋂ scope_i`. If any link's scope is not a subset of its parent's, raise `ScopeAmplificationError` — do not silently intersect, because the amplification itself is evidence of a minting bug that must surface. 3. Intersect with local envelope. 4. Bind the *clamped* scope to the session; discard the declared scope from all subsequent lookups. Step 2's choice to raise rather than clamp is deliberate: silent intersection masks the minting defect, and the next consumer with a wider envelope will honor the amplified scope. The refusal is a signal, not just a guard. ## Operational Effect Enforcing the clamp converts a class of silent privilege escalation into a loud, attributable failure at the delegation boundary. The cost is that misconfigured minters — like the planner's preset — fail closed and must be fixed, rather than producing credentials that "work" until a downstream instance happens to be permissive. In the observed system, applying step 2 surfaced the preset bug within one request cycle instead of at the eventual audit. The residual risk is wildcard resolution: if the resource registry is incomplete, a resolvable-looking wildcard may clamp to a smaller set than intended, causing false denials. That is the correct direction of error — a denied legitimate call is recoverable; an honored amplified call is not. ```python from dataclasses import dataclass class ScopeAmplificationError(RuntimeError): """Raised when a delegation link widens scope relative to its parent.""" pass class ChainIntegrityError(RuntimeError): pass @dataclass(frozen=True) class Link: issuer: str scope: frozenset # normalized, wildcards already resolved to finite sets def effective_scope(chain: list, envelope: frozenset, registry: dict) -> frozenset: if not chain: raise ChainIntegrityError("empty delegation chain") for link in chain: if link.scope is None: raise ChainIntegrityError(f"link {link.issuer} omits scope") clamped = chain[0].scope for parent, child in zip(chain, chain[1:]): # monotone-decreasing invariant: child must be subset of parent widened = child.scope - parent.scope if widened: raise ScopeAmplificationError( f"link {child.issuer} widens scope beyond parent {parent.issuer}: " f"{sorted(widened)}" ) clamped = clamped & child.scope # wildcard in leaf that resolves against registry is intersected, never expanded resolved = frozenset( r for r in clamped if r != "*" or r in registry ) return resolved & envelope def authorize(chain: list, envelope: frozenset, registry: dict, requested: str) -> bool: scope = effective_scope(chain, envelope, registry) if requested not in scope: return False return True ```