# What structural signals indicate AAIF delegated-scope attenuation has silently inverted during multi-hop credential chaining **Date of Record:** 2026 November 23 **Scope:** Applies to AAIF-style verifiable credential (VC) chains where an orchestrator agent delegates a narrowed scope to a sub-agent, which may itself delegate further (depth ≥ 2). Does not apply to flat single-hop issuance, nor to scopes expressed as opaque capabilities without an explicit attenuation lattice. ## Core Distinction The intuition is that delegation *narrows* authority: a parent hands a child a subset of its own scope, and the AAIF VC's `scope_intersection` proof guarantees `child.scope ⊆ parent.scope`. This holds only when the scope is a **lattice with a decidable meet operation** and when each hop's attenuation is computed against the *immediate* parent's *effective* (post-attenuation) scope — not against the root's *issued* scope. The failure mode is the gap between those two: a hop that attenuates against the **root issued scope** rather than the **parent effective scope**. Because the intersection `child ⊆ parent` is still locally satisfied at every individual hop (each child is a subset of *some* ancestor), the per-hop proof verifies green. But the composed chain can *widen* relative to the parent that actually delegated, producing an authority set that was never granted by the immediate issuer. The VC chain is individually valid and globally inverted. This is not a signature failure, not a revocation failure, and not a schema mismatch — it is an **attenuation-basis error** that survives all local checks. ## What Was Observed A three-hop chain: orchestrator `O` (root, issued scope `S_root = {read:repo/a, read:repo/b, write:repo/a}`), delegated to planner `P` with attenuation `S_P = S_root ∩ {read:*}` = `{read:repo/a, read:repo/b}`. `P` then delegated to executor `E` with an attenuation expression written by a prompt-generated policy: `S_E = S_root ∩ {read:repo/a, write:repo/a}`. The observed chain: - Hop 1 (`O→P`): child `{read:a, read:b}` ⊆ parent `{read:a, read:b, write:a}`. Valid. - Hop 2 (`P→E`): the policy author computed the meet against `S_root`, not `S_P`. Result `S_E = {read:repo/a, write:repo/a}`. - Local check at hop 2: `S_E ⊆ S_root`? Yes. **Proof passes.** - But `S_E ⊄ S_P`: `write:repo/a` is present in `E` and absent in `P`. The structural signal was not a signature error. It was a **monotonicity violation in the chain's effective-scope sequence**: the cardinality of the effective scope did not monotonically decrease with depth. `|S_P| = 2`, `|S_E| = 2`, but the *content* of `S_E` contained an element (`write:repo/a`) that was never in `S_P`. An auditor recomputing the chain's effective scope per-hop and diffing consecutive sets would have caught it instantly; the AAIF verifier, which only checked `child ⊆ root`, did not. The second signal: the `delegation_basis` field in `E`'s VC referenced `S_root`'s credential ID, not `P`'s credential ID. The chain was structurally a **skip-edge** — `E` cited its grandparent as its authority source while `P` was the actual issuer of record. Verifiers that reconstruct the chain by *following issuer signatures* see `O→P→E`; verifiers that reconstruct by *following `delegation_basis` pointers* see `O→E` with `P` orphaned. Two valid topologies, one inconsistent authority graph. ## Condition of Validity The invariant that must hold for AAIF delegated scoping to be sound: > For every hop with issuer `i` and subject `j`, `effective_scope(j) = effective_scope(i) ∩ attenuation(i, j)`, and the VC's `delegation_basis` MUST reference the credential of `i` (the immediate issuer), not any ancestor. This is valid **only if** the attenuation function is evaluated against the issuer's *effective* scope at issuance time, and only if the `delegation_basis` pointer is bound to the signing issuer's credential digest. When the attenuation expression is authored by an LLM (as it was here — `P` generated the policy for `E` from a natural-language instruction "give the executor write access to repo/a"), the model has no reliable access to its own effective scope unless that scope is injected into its context. If the prompt supplies the *root* scope (common, because the root scope is the one in the system prompt) rather than the *current effective* scope, the model will faithfully compute a meet against the wrong basis. The model is not wrong; the context it was given is. The condition of validity therefore includes a **context-plumbing requirement**: the delegation tool must inject the issuer's effective scope into the policy-authoring context, and the VC emitter must reject any `delegation_basis` that does not equal the immediate issuer's credential digest. ## Decision Boundary The boundary between "safe to issue" and "must reject" is: - **Accept** a hop iff `effective_scope(child) ⊆ effective_scope(parent)` **and** `delegation_basis(child) == digest(parent_credential)` **and** the effective-scope sequence is monotonically non-increasing in the subset order (not merely in cardinality). - **Reject** any hop where `delegation_basis` resolves to an ancestor other than the immediate issuer, even if the subset check passes against that ancestor. A skip-edge is a widening in disguise: it means the child's authority was computed against a scope the immediate parent never held. - **Reject** any chain where the recomputed per-hop effective scope diverges from the VC-declared scope at any node, regardless of signature validity. The non-obvious part: the subset check against the *root* is the trap. It is almost always true (the root is the widest scope), so it provides near-zero discriminating power at depth ≥ 2. The discriminating check is the **consecutive-hop subset check plus the basis-pointer identity check**. A verifier that only checks `child ⊆ root` will pass every inverted chain. ## Operational Effect Downstream, the inverted chain grants `E` a `write:repo/a` authority that `P` was explicitly denied. `P` was scoped read-only precisely so that a planner cannot mutate state; the inversion re-grants mutation to the planner's delegate. The blast radius is bounded only by what `E` does with the write — and `E`, seeing a valid VC, has no reason to suspect its authority exceeds its issuer's. The failure is silent at every layer: signature valid, revocation valid, schema valid, per-hop subset valid against root. It is detectable only by a verifier that reconstructs the chain by basis-pointer and enforces consecutive-hop monotonicity. The guardrail is a **chain-recompute auditor** that runs before any delegated action is authorized: walk from root, recompute effective scope at each node using the declared attenuation, assert consecutive subset and basis-pointer identity, and fail closed on any skip-edge. This must run at the *resource* side (where the write is attempted), not only at issuance, because the issuer is the party whose context was corrupted. ```python import hashlib from dataclasses import dataclass, field class DelegationScopeInversionError(RuntimeError): """Raised when a delegated VC's effective scope is not a subset of its immediate issuer's effective scope, or its delegation_basis skips a hop.""" @dataclass class Credential: cred_id: str issuer_id: str subject_id: str declared_scope: frozenset delegation_basis: str | None # cred_id of the immediate issuer's VC attenuation: frozenset | None # elements removed relative to basis def _digest(cred: Credential) -> str: h = hashlib.sha256() h.update(cred.cred_id.encode()) h.update(cred.issuer_id.encode()) h.update(cred.subject_id.encode()) h.update(repr(sorted(cred.declared_scope)).encode()) return h.hexdigest() def recompute_chain(root: Credential, chain: list[Credential]) -> dict[str, frozenset]: """Recompute effective scope per node, enforcing consecutive-hop monotonicity and basis-pointer identity. Fails closed on any skip-edge or widening.""" effective: dict[str, frozenset] = {root.cred_id: root.declared_scope} by_id = {c.cred_id: c for c in chain} for cred in chain: basis_id = cred.delegation_basis if basis_id is None: raise DelegationScopeInversionError( f"{cred.cred_id}: missing delegation_basis" ) if basis_id not in effective: raise DelegationScopeInversionError( f"{cred.cred_id}: basis {basis_id} not an ancestor in effective set " f"(skip-edge or out-of-order chain)" ) parent_scope = effective[basis_id] # Consecutive-hop subset check against the *immediate* issuer, not root. if not cred.declared_scope <= parent_scope: widened = cred.declared_scope - parent_scope raise DelegationScopeInversionError( f"{cred.cred_id}: effective scope widens past immediate issuer " f"{basis_id}; unauthorized elements={sorted(widened)}" ) # Basis-pointer identity: must reference the immediate issuer's credential, # not a grandparent. Here we assert the basis credential's subject is this cred's issuer. basis_cred = by_id.get(basis_id) or (root if basis_id == root.cred_id else None) if basis_cred is None or basis_cred.subject_id != cred.issuer_id: raise DelegationScopeInversionError( f"{cred.cred_id}: delegation_basis {basis_id} does not belong to " f"immediate issuer {cred.issuer_id} (authority-graph inversion)" ) effective[cred.cred_id] = cred.declared_scope return effective def authorize_write(chain_effective: dict[str, frozenset], node_id: str, resource: str) -> None: scope = chain_effective.get(node_id, frozenset()) if f"write:{resource}" not in scope: raise DelegationScopeInversionError( f"node {node_id} lacks write:{resource}; scope={sorted(scope)}" ) ```