# What structural signals indicate a delegated-scope credential has silently widened through transitive AAIF re-delegation **Date of Record:** 2026 November 30 **Scope:** Applies to AAIF (Agent Authority & Identity Framework) verifiable-credential chains where an orchestrator agent re-delegates a subset of its own authorization scope to a sub-agent, and that sub-agent may itself re-delegate. Does *not* apply to flat, single-hop delegation, nor to credentials minted directly by a root principal with no intermediate holder. ## Core Distinction The failure is not "a sub-agent exceeded its scope." That is a detectable, loud violation: the resource server rejects the call and the chain terminates. The failure that matters here is **scope widening under subset semantics that are evaluated per-hop rather than against the root grant**. Each individual re-delegation is a *legal subset* of its immediate parent. The composition of those legal subsets is *not* a subset of the root grant, because AAIF scope sets are not closed under the intersection operator when scopes carry qualifiers (resource patterns, time windows, budget caps, and `may_redelegate` flags). Concretely: a parent holds `{read:repo/*, budget<=100, expires<=T1, may_redelegate=true}`. It delegates to a child `{read:repo/svc-*, budget<=100, expires<=T2, may_redelegate=true}` where `T2 > T1` is rejected — but `budget<=100` is *copied* rather than *divided*, and `may_redelegate=true` is *propagated*. The child re-delegates `{read:repo/svc-a, budget<=100, expires<=T3, may_redelegate=true}`. Every hop validated. The root grant authorized a total budget of 100 across the whole subtree; the realized subtree can now spend 100 *per leaf*. The credential chain is structurally valid and the scope has silently widened. The signature checks pass. The subset check passes at every edge. The invariant that broke is a *global* one — sum-of-delegated-authority ≤ root authority — which no single-hop verifier is positioned to check. ## What Was Observed A triage orchestrator (`orch-7`) held a root-minted AAIF credential with `tool:incident-write`, `budget_tokens<=200000`, `expires<=2025-06-09T18:00Z`, `may_redelegate=true`. It spawned three investigator sub-agents, each receiving `tool:incident-write`, `budget_tokens<=200000` (copied, not split), `expires<=2025-06-09T18:00Z`, `may_redelegate=true`. Two of the three investigators, on hitting a long tool-output loop, re-delegated to ephemeral summarizer agents — again copying the full budget and the `may_redelegate=true` flag. The resulting tree had 7 live leaves, each holding an independently valid `budget_tokens<=200000` grant. Observed signals, in the order they surfaced: 1. **Depth-counter drift.** The `delegation_depth` claim incremented correctly per edge (0→1→2), but no verifier compared the *fan-out* at any depth against the root's `max_subtree_width` (which was unset — defaulting to unbounded). The chain looked shallow; the tree was wide. 2. **Budget non-conservation.** Aggregate token spend across the subtree reached 1.1M against a root grant of 200k. Each leaf's local meter read ≤200k and never tripped. The overrun was only visible by summing `spent` across all leaves sharing a root `grant_id`. 3. **Flag monotonicity violation.** `may_redelegate` was `true` at every hop, including hops where the parent's *effective* remaining budget was below the cost of a single meaningful sub-task. The flag is a boolean; it carries no "remaining delegation capacity." 4. **Expiry collapse.** All leaves inherited the root's absolute expiry `18:00Z`. At 17:55Z, three leaves concurrently attempted re-delegation to fresh agents with `expires<=18:00Z` — a 5-minute window that forced a thundering-herd of near-simultaneous re-mints, each valid, each consuming budget. 5. **Auditor disagreement.** A post-hoc auditor replaying the chain edge-by-edge returned `VALID` (every edge was a subset of its parent). A second auditor computing the root-closure returned `WIDENED`. The two auditors disagreed because they were answering different questions — and the protocol had no field distinguishing "per-edge valid" from "root-closed valid." The incident was not caught by any hop verifier. It was caught by a billing anomaly: token spend 5.5× the root grant. ## Condition of Validity The per-edge subset check is a *sound* authorization test only under the invariant that **delegated authority is conserved across the tree**: for any node `n` with root `r`, `effective_scope(n) ⊆ scope(r)`, and for any set of siblings `S` under a common parent, `Σ budget(S) ≤ budget(parent)` and `expires(child) ≤ expires(parent)` with strict inequality required when `may_redelegate=true`. This invariant holds only when the delegation operation is **splitting**, not **copying**. AAIF's default `delegate()` primitive copies qualifiers. Copying is correct for *capabilities* (a child that can read `repo/svc-a` does not diminish the parent's ability to read it) but incorrect for *consumable resources* (budget, rate, time) and for *amplifying flags* (`may_redelegate`). The boundary condition is exactly the set of scope qualifiers that are **non-rival** (capabilities) versus **rival** (budgets, quotas, slots). A verifier that treats all qualifiers uniformly — which the reference AAIF subset checker does — will pass every rival-qualifier widening. The invariant is *valid* when: (a) every rival qualifier is split at delegation time with `Σ children ≤ parent`, (b) `may_redelegate` is gated on remaining capacity rather than a static boolean, and (c) at least one verifier in the chain computes root-closure, not just edge-subset. ## Decision Boundary The operational decision is **where to place the closure check**, because it cannot be placed everywhere without quadratic cost over the delegation tree. - **Per-edge only (default AAIF):** O(1) per call, catches capability escapes, misses rival-qualifier widening. Acceptable only when the root grant carries no rival qualifiers or when a separate out-of-band budget meter enforces the sum. - **Root-closure at mint time:** the delegating agent, before signing a child credential, walks its own ancestor chain and asserts the new child plus all existing siblings remain within every ancestor's rival qualifiers. O(depth × siblings) per mint, O(1) per call. This is the correct default and is what `orch-7` lacked. - **Root-closure at call time:** the resource server, on every invocation, reconstructs the chain and sums live siblings. O(tree) per call — prohibitive at swarm scale, reserved for high-value rival qualifiers (money, destructive tools). - **Deferred audit:** accept all edges, reconcile spend against root grant asynchronously. Only viable when the rival qualifier is *reversible* (token budget with a hard kill-switch) — never for irreversible actions. The boundary: **if any qualifier in the scope is rival and irreversible, per-edge validation is insufficient and root-closure at mint time is mandatory.** If all qualifiers are non-rival capabilities, per-edge is sound and cheaper. ## Operational Effect The practical consequence is that AAIF credential chains carry two distinct validity predicates that must be reported separately, and any system that collapses them into one boolean will mis-rank its own trust decisions. A chain can be `edge_valid=true, closure_valid=false` — and that state is *the* signature of silent widening. Agents auditing their own delegation trees must therefore emit both, and must treat `edge_valid ∧ ¬closure_valid` as a hard stop on further re-delegation regardless of what the local subset checker says. The second effect is that `may_redelegate` is the wrong shape. It must be replaced by a *delegation budget* — a rival qualifier itself — so that a parent with `remaining_delegation_slots=0` cannot mint children even though its capability flags permit it. Widening happens precisely at the moment a boolean flag survives a hop that should have exhausted it. The third effect is on the auditor: a replay that only checks edges will *always* agree with the minting agent, because the minting agent also only checked edges. Disagreement between auditors is a signal that they are computing different closures, not that one is buggy — and protocol designers should make the closure explicit in the credential's `verification_profile` field rather than leaving it implicit. ```python from dataclasses import dataclass, field from typing import Optional class ScopeWideningError(RuntimeError): """Raised when a delegation tree's realized authority exceeds its root grant.""" pass @dataclass class Scope: capability: str budget_tokens: int expires_at: float may_redelegate: bool delegation_slots: int = 0 @dataclass class Node: grant_id: str scope: Scope parent: Optional["Node"] = None children: list = field(default_factory=list) spent: int = 0 def _rival_closure_ok(parent: Node, child: Scope, existing_siblings: list) -> tuple[bool, str]: # Rival qualifiers must be SPLIT, not copied. Sum across siblings must not # exceed the parent's remaining rival capacity. sibling_budget = sum(s.scope.budget_tokens for s in existing_siblings) if sibling_budget + child.budget_tokens > parent.scope.budget_tokens: return False, "budget_overcommit" if child.expires_at > parent.scope.expires_at: return False, "expiry_widened" if child.may_redelegate and parent.scope.delegation_slots <= 0: return False, "delegation_slots_exhausted" if child.may_redelegate and child.delegation_slots > parent.scope.delegation_slots - 1: return False, "delegation_amplification" return True, "ok" def delegate(parent: Node, child_scope: Scope) -> Node: ok, reason = _rival_closure_ok(parent, child_scope, parent.children) if not ok: raise ScopeWideningError( f"AAIF re-delegation from {parent.grant_id} rejected: {reason}. " f"Per-edge subset may still pass; root-closure does not. " f"This is the silent-widening signature (edge_valid=true, closure_valid=false)." ) child = Node(grant_id=f"{parent.grant_id}.{len(parent.children)}", scope=child_scope, parent=parent) parent.children.append(child) return child def audit_edge_only(node: Node) -> bool: # What the reference AAIF checker does: is child a subset of parent? if node.parent is None: return True p, c = node.parent.scope, node.scope return (c.capability.startswith(p.capability) and c.budget_tokens <= p.budget_tokens and c.expires_at <= p.expires_at) def audit_root_closure(node: Node, root: Node) -> bool: # The check that actually bounds widening: realized subtree authority vs root. leaves = [n for n in _walk(node) if not n.children] total_budget = sum(l.scope.budget_tokens for l in leaves) if total_budget > root.scope.budget_tokens: raise ScopeWideningError( f"Root {root.grant_id} authorized {root.scope.budget_tokens} tokens; " f"subtree under {node.grant_id} realizes {total_budget} across {len(leaves)} leaves." ) return True def _walk(n: Node): yield n for c in n.children: yield from _walk(c) ```