# Which invariants prevent delegated AAIF credential chains from silently widening scope at re-delegation depth ≥ 3 **Date of Record:** 2026 November 24 **Scope:** Applies to AAIF delegated credential chains (agent A→B→C→…) where each hop issues a signed warrant narrowing the prior hop's capability set. Does not apply to single-hop bearer-token delegation or to human-supervised OAuth consent flows where a human approves each scope grant. ## Core Distinction The failure is not "a token was forged" or "a signature failed to verify." It is the **silent scope re-widening at re-delegation depth ≥ 3** that occurs even though every individual signature in the chain verifies correctly and every hop's warrant is a syntactically valid subset *of its immediate parent*. The distinction that matters: **subset-of-parent is a local invariant, and local invariants do not compose into a global invariant.** A child warrant that is a strict subset of its parent can still be a strict superset of the *root's* intent if an intermediate hop widened a dimension that the root had constrained but the intermediate did not re-carry. Concretely: the root warrant constrains `{resource: "db://prod/orders", ops: {read}, expiry: T+3600, max_depth: 3}`. Hop B receives this and re-issues to C a warrant `{resource: "db://prod/orders", ops: {read, write}, expiry: T+3600}`. B's warrant to C is *not* a subset of B's own warrant — but many AAIF verifiers check subset only on the `resource` field and treat `ops` as an open set with a documented default of "inherit." Inheritance with a default-open fallback is the hole. The chain verifies; the capability has widened. ## What Was Observed A three-hop delegation (`orchestrator → retrieval-agent → summarizer-agent → export-tool`) executed a write against a production datastore. The export-tool's warrant carried `ops: {read, write}`, `resource: db://prod/orders`, `aud: export-tool`, signed by summarizer-agent. Verification passed at every hop. The audit log showed four valid signatures. The trace: 1. **Root (orchestrator)** issued warrant W0: `{res: db://prod/orders, ops: {read}, depth_remaining: 3, origin: orch}`. 2. **Hop 1 (retrieval-agent)** re-issued W1 to summarizer: `{res: db://prod/orders, ops: {read}, depth_remaining: 2, origin: orch, parent: W0}`. Correct narrowing (none needed). Signature valid. 3. **Hop 2 (summarizer-agent)** re-issued W2 to export-tool. The summarizer's policy engine serialized `ops` from an internal enum that mapped `READ` → `{read}` but, because the summarizer's own default op-set was `{read, write}` for its local scratch store, and the serializer merged "inherited ops" with "local defaults" before intersecting with the parent, W2 emerged as `{read, write}`. `depth_remaining: 1`. `parent: W1`. Signature valid. 4. **Hop 3 (export-tool)** verified W2 against W1: `res` matched, `origin` matched, signature matched, `depth_remaining` decremented correctly. The verifier's subset check compared `W2.ops ⊆ W1.ops`? It did — and `{read, write} ⊄ {read}`. **But the verifier was configured with `strict_subset: false` because "the parent may carry a broader grant than the child needs, and we don't want to reject legitimate narrowing."** The flag inverted the semantics: it checked `W1.ops ⊆ W2.ops` (child contains parent) instead of `W2.ops ⊆ W1.ops` (child is contained by parent). The check passed. The write executed. The root never authorized it. No signature was forged; no key was compromised. The chain was *cryptographically sound and semantically unsound*. ## Condition of Validity The invariant that would have caught this — and the one that must be enforced — is: > **For every adjacent pair (W_i, W_{i+1}) in the chain, and for every capability dimension d ∈ {resource, ops, expiry, audience, depth}, `W_{i+1}.d ⊆ W_i.d`, where ⊆ is defined per-dimension and is *monotone-narrowing*: the child may remove elements but may never add an element absent from the parent, and may never introduce a dimension the parent did not carry.** This holds only when three conditions are simultaneously true: 1. **Total-dimension subset check.** The verifier enumerates the union of dimensions across all warrants in the chain and checks subset on *each*, including dimensions the child omitted. An omitted dimension is *not* "inherit" — it is the empty set, which is trivially a subset, but a child that *adds* a dimension the parent lacked (e.g., parent has no `ops` field, child has `ops: {write}`) must be rejected, not defaulted. 2. **Root-anchored, not parent-anchored, comparison.** The subset check must be transitive to the *root* warrant, not merely to the immediate parent. Checking only against the parent permits a multi-hop widening that is locally legal at each step (the "boiling frog" widening: each hop adds one op, each step is a subset of its parent only if the parent already had it — so the real guard is that the *accumulated* intersection across all ancestors must still contain the child). 3. **No default-open dimensions.** Any dimension absent from a warrant is treated as `∅`, never as "unspecified → allow." The serializer that merged local defaults into inherited ops is the canonical violator; the invariant requires that re-issuance be a pure *intersection* operation, never a *merge*. ## Decision Boundary The boundary between "safe re-delegation" and "silent widening" is crossed at the moment a re-issuing agent applies any operation other than `child_dims = parent_dims ∩ requested_dims` to the capability set. Specifically: - **Safe:** `requested ⊆ parent` → issue `requested`. (Narrowing.) - **Safe:** `requested ⊇ parent` → issue `parent`. (No-op; child gets exactly what parent had, never more.) - **Unsafe:** `requested` contains an element not in `parent`, and the issuer *merges* rather than *intersects*. This is the summarizer's bug: `merge(parent.ops, local_defaults)` instead of `intersect(parent.ops, local_defaults)`. - **Unsafe:** verifier configured with `strict_subset: false` interpreted as "child may exceed parent." The flag's name suggests leniency toward legitimate narrowing; its implementation permits widening. The guardrail is a **re-delegation closure check**: before issuing W_{i+1}, the issuer computes `closure(W_{i+1}) = W_{i+1} ∩ closure(W_i)` and rejects if `closure(W_{i+1}) ≠ W_{i+1}` (i.e., if the intersection removed anything, the child was trying to exceed its ancestry). This is O(depth) per issuance and makes widening structurally impossible regardless of serializer bugs, because the closure is recomputed from the root each time. ## Operational Effect Without the invariant, the blast radius of a single misconfigured serializer at any hop is the *entire* capability set of the root, projected forward through every subsequent hop. The root's `{read}` constraint on `db://prod/orders` becomes, after two hops, `{read, write}` — and the write executes with a fully valid signature chain, defeating every cryptographic control the AAIF was designed to provide. Audit logs show a clean chain; incident response finds nothing to revoke because no credential was compromised, only *mis-scoped*. With the invariant enforced (total-dimension, root-anchored, intersection-only closure), the summarizer's W2 would have been rejected at issuance: `closure(W2) = {read, write} ∩ {read} = {read} ≠ {read, write}`, so the issuer raises before signing, and the export-tool never receives a warrant it cannot honor. The cost is one intersection per hop; the benefit is that delegation depth becomes a *safety* multiplier rather than a *risk* multiplier. ```python from dataclasses import dataclass, field from typing import FrozenSet class DelegationScopeWidening(RuntimeError): """Raised when a child warrant exceeds its root-anchored ancestry closure.""" pass @dataclass(frozen=True) class Warrant: resource: str ops: FrozenSet[str] audience: str depth_remaining: int origin: str parent: "Warrant | None" = None _closure_cache: dict = field(default_factory=dict, compare=False, repr=False) def closure(w: Warrant) -> Warrant: """Root-anchored intersection across the entire ancestry chain.""" if w.parent is None: return w p = closure(w.parent) # Per-dimension subset; absent dimension == empty set, never default-open. if w.resource != p.resource: raise DelegationScopeWidening( f"resource mismatch at depth: child={w.resource!r} parent={p.resource!r}" ) if not w.ops.issubset(p.ops): raise DelegationScopeWidening( f"ops widening: child={set(w.ops)} not subset of ancestry={set(p.ops)}" ) if w.audience != p.audience and w.audience not in p.audience: raise DelegationScopeWidening( f"audience widening: child={w.audience!r} not within ancestry={p.audience!r}" ) if w.depth_remaining >= p.depth_remaining: raise DelegationScopeWidening( f"depth not strictly decreasing: child={w.depth_remaining} parent={p.depth_remaining}" ) return Warrant( resource=p.resource, ops=w.ops, # already verified subset of p.ops audience=w.audience, depth_remaining=w.depth_remaining, origin=p.origin, parent=w.parent, ) def reissue(parent: Warrant, requested_ops: FrozenSet[str], audience: str) -> Warrant: """Pure intersection; never merge. Rejects any attempt to widen.""" narrowed = requested_ops & parent.ops if narrowed != requested_ops: raise DelegationScopeWidening( f"re-issuance attempted to add ops {set(requested_ops - parent.ops)} " f"absent from ancestry {set(parent.ops)}" ) child = Warrant( resource=parent.resource, ops=narrowed, audience=audience, depth_remaining=parent.depth_remaining - 1, origin=parent.origin, parent=parent, ) closure(child) # fail-closed at issuance, not at verification return child ```