# What structural signals indicate a delegated AAIF credential chain has silently re-scoped below its root grant **Date of Record:** 2026 November 30 **Scope:** Applies to AAIF delegated credential chains where a root principal issues a scoped capability token to an orchestrator agent, which further delegates attenuated tokens to sub-agents across MCP/A2A hops. Does not cover single-hop direct authorization, nor symmetric-key session tokens without attenuation semantics. ## Core Distinction The failure mode here is not token *replay* or *forgery*—cryptographic signature checks pass cleanly. The failure is **scope drift under attenuation**: each hop is individually valid and monotone-non-expanding at the moment of issuance, yet the *composed* chain authorizes a capability the root never granted, because attenuation was evaluated against the parent token's *declared* scope rather than its *effective* scope after prior hops applied caveats. The distinction that matters operationally: a chain can be **locally sound** (every link's signature verifies, every link's scope ⊆ its parent's declared scope) while being **globally unsound** (the leaf's effective scope intersects a resource the root excluded). Verifiers that check per-link subset relations and stop there will accept the chain. The invariant that must hold is *transitive*: `effective_scope(leaf) ⊆ effective_scope(root)`, where `effective_scope` is the intersection of declared scope with all caveats accumulated along the path—not the declared scope of the immediate parent. ## What Was Observed A three-hop delegation was traced in production. The root principal `svc:analyst-root` issued an orchestrator token with declared scope `{read:reports/*, read:metrics/aggregate}` and a caveat `not(resource_class == "pii")`. The orchestrator delegated to a retrieval sub-agent with declared scope `{read:reports/q3}`—a subset of the parent's declared scope, so the subset check passed. Critically, the orchestrator dropped the `not(pii)` caveat when constructing the child token, because its token-construction library serialized only the `scope` field and treated caveats as advisory metadata. The retrieval sub-agent then delegated to a summarizer with scope `{read:reports/q3/pii-redacted-index}`. Every link verified. Every declared scope was a subset of its parent's declared scope. But the leaf's effective scope now included a path whose `resource_class` resolved to `pii`, which the root had explicitly excluded. The composed chain authorized a read the root never intended. The signal that surfaced this was **structural, not semantic**: the leaf token's `caveat_set` was empty while its path length from root was 3. A path-length-3 chain with a leaf caveat set strictly smaller than the root's caveat set is a *structural* indicator of caveat-stripping, independent of what the scopes actually say. The verifier had been checking `scope ⊆ parent.scope` and `signature_valid` and nothing else. ## Condition of Validity The per-link subset check is only a valid authorization guardrail under a conjunction of three conditions, any one of which the observed system violated: 1. **Caveat monotonicity is enforced, not assumed.** Every child token's caveat set must be a *superset* (or at least an entailment-preserving refinement) of the parent's. If the serialization layer can omit caveats, the subset check on scope is meaningless because scope and caveat jointly define effective authority. 2. **`effective_scope` is computed at verification, not issuance.** The verifier must recompute the intersection of all caveats along the chain. Trusting each issuer's declared scope is exactly the gap that admitted the PII read. 3. **Resource-class resolution is deterministic across hops.** If `pii` is resolved by a classifier whose output depends on the requesting agent's context, two hops can disagree on whether the same path is PII. The chain must pin the resource-class resolver identity and version as part of the caveat. When all three hold, per-link subset checking is sound. When any fails, the chain is only *locally* sound and must be rejected at composition. ## Decision Boundary The boundary is between **accepting a chain because each link is valid** and **accepting a chain because the composition is valid**. The operational rule: - If `len(chain) == 1`: per-link check is sufficient (there is no composition). - If `len(chain) > 1` AND `leaf.caveat_set ⊇ root.caveat_set` (entailment-wise): per-link check plus recomputed `effective_scope` intersection is required, but the structural caveat invariant holds and the chain is admissible if effective scopes nest. - If `len(chain) > 1` AND `leaf.caveat_set ⊉ root.caveat_set`: **reject unconditionally**, regardless of how the scopes compare. This is the caveat-stripping signal. Do not attempt to "repair" the chain by re-adding caveats at the verifier—the stripping already happened at an untrusted hop and the leaf's provenance is tainted. The non-obvious part: the caveat-set comparison must be done with **entailment**, not set equality. A child may legitimately *add* caveats (tightening), so `leaf.caveat_set` being a strict superset is fine. The failure is only when a caveat *present at an ancestor* is absent (not entailed) at the leaf. Set-difference in the wrong direction is the alarm; set-difference in the tightening direction is normal attenuation. ## Operational Effect Verifiers that implement only the per-link scope-subset check will pass a class of chains that grant authority the root excluded, and they will do so with no signature error, no scope error, and no log line that looks anomalous. The only detectable trace is the structural asymmetry between ancestor and leaf caveat sets. Instrumenting for this requires the verifier to retain the full chain (not just the leaf and its immediate parent) and to run an entailment check across the caveat sets of every ancestor against the leaf. The downstream consequence of missing it is not a crash—it is a *silent* over-authorization that looks like normal operation until an audit reconciles the leaf's actual reads against the root's declared exclusions. By then the reads have happened. The guardrail must be at verification time, on the composed chain, before the leaf token is honored for any tool call. ```python from dataclasses import dataclass, field from typing import FrozenSet class CaveatStrippingError(RuntimeError): """Raised when a delegated chain's leaf does not entail an ancestor caveat.""" pass @dataclass(frozen=True) class Link: issuer: str subject: str declared_scope: FrozenSet[str] caveats: FrozenSet[str] signature_valid: bool def entails(leaf_caveats: FrozenSet[str], ancestor_caveats: FrozenSet[str]) -> bool: # A caveat is entailed if it is present at the leaf, or if the leaf # carries a strictly stronger caveat that subsumes it. Here we model # subsumption conservatively: only exact presence counts as entailment. # Callers with a caveat algebra should override this. return ancestor_caveats.issubset(leaf_caveats) def verify_composed_chain(chain: list[Link]) -> None: if not chain: raise CaveatStrippingError("empty chain") # 1. Per-link signature and immediate scope subset. for i, link in enumerate(chain): if not link.signature_valid: raise CaveatStrippingError(f"link {i} signature invalid at {link.issuer}") if i > 0: parent = chain[i - 1] if not link.declared_scope.issubset(parent.declared_scope): raise CaveatStrippingError( f"link {i} scope {link.declared_scope} not subset of parent {parent.declared_scope}" ) # 2. Transitive caveat entailment: leaf must entail every ancestor caveat. root = chain[0] leaf = chain[-1] if len(chain) > 1 and not entails(leaf.caveats, root.caveats): missing = root.caveats - leaf.caveats raise CaveatStrippingError( f"caveat stripping detected: leaf {leaf.subject} does not entail " f"root caveats {missing}; chain length {len(chain)}" ) # 3. Effective-scope intersection must nest under root effective scope. # (Declared-scope subset checks above are necessary but not sufficient.) effective_root = root.declared_scope effective_leaf = leaf.declared_scope if not effective_leaf.issubset(effective_root): raise CaveatStrippingError( f"effective scope escape: leaf {effective_leaf} not under root {effective_root}" ) def authorize_tool_call(chain: list[Link], resource: str) -> bool: verify_composed_chain(chain) leaf = chain[-1] return resource in leaf.declared_scope ```