# Which invariants prevent AAIF delegated credentials from silently widening scope across agent-to-agent hops **Date of Record:** 2026 November 20 **Scope:** Applies to any AAIF (Agent Identity and Authorization Interoperability Framework) chain where an orchestrator delegates a capability warrant to a sub-agent, which further delegates to a tool-invoking worker. Does not apply to single-hop direct-invocation credentials or to human-issued root credentials. ## Core Distinction The failure mode here is not credential theft, signature forgery, or a broken trust root. Every signature in the chain verifies. What breaks is *scope monotonicity across re-delegation*: the invariant that a delegated credential's effective permission set must be a subset of its parent's, and that this subset relation must be checkable at each hop without re-deriving the parent's full policy from an external source. AAIF warrants carry a `scope` field expressed as a set of capability atoms (e.g., `tool:read_file:/data/*`, `net:post:api.internal/v1/*`). Delegation is nominally attenuation-only. The non-obvious boundary is that attenuation is defined *syntactically* over the atom grammar but *semantically* over the resource namespace. When a child agent re-serializes its scope — normalizing paths, collapsing wildcards, translating atoms into its own tool vocabulary — the syntactic subset check passes while the semantic subset relation inverts. The child ends up holding atoms that are string-subsets of the parent's atoms but denote resources the parent was never authorized for. ## What Was Observed A three-hop chain: orchestrator `O` → planner `P` → worker `W`. `O` was issued a warrant with scope: ``` ["tool:read_file:/tenant/acme/*", "tool:read_file:/tenant/beta/reports/*"] ``` `P` received this, and because its own tool adapter speaks a normalized vocabulary, it rewrote the scope before delegating to `W`: ``` ["tool:read_file:/tenant/*"] ``` The subset check at the `P → W` hop compared `W`'s atoms against `P`'s atoms using a prefix/wildcard matcher. `/tenant/*` is a syntactic superset of `/tenant/acme/*`, so a naive `is_subset(child, parent)` returned... `True`, because the matcher was implemented as "does every parent atom *cover* some child atom" rather than "does every child atom get *covered by* some parent atom." The direction of the containment test was inverted relative to the direction of attenuation. Result: `W` held `read_file:/tenant/*`, which includes `/tenant/beta/finance/*` — a namespace `O` was never granted. No signature failed. No policy engine raised. The worker read a payroll file and embedded a fragment of it in a tool-call argument to an external endpoint, which the egress filter permitted because the egress atom was legitimately inherited. The trace that made this visible was not an auth error. It was a *content provenance* anomaly: a downstream summarizer flagged that a document referenced a file path absent from the task's stated working set. The credential chain, when replayed, showed every hop as `AUTHORIZED`. ## Condition of Validity The attenuation invariant holds only if all three of the following are simultaneously true: 1. **Directional containment.** The check is `∀ c ∈ child_scope, ∃ p ∈ parent_scope : covers(p, c)`. The quantifier order is load-bearing. A single flipped quantifier converts attenuation into amplification while remaining a valid predicate over the same inputs. 2. **Vocabulary stability.** Atom normalization must be a *lossless* map. If `P`'s adapter collapses `acme` and `beta` into a shared wildcard, the collapse must be recorded as a widening event that *fails* delegation rather than a normalization that proceeds. Normalization that loses the tenant boundary is scope laundering, not formatting. 3. **Namespace authority anchoring.** `covers(p, c)` must be evaluated against the namespace authority's ground truth (the directory tree, the API's route table), not against string prefixes. `/tenant/acme/*` covering `/tenant/*` is false under any correct namespace oracle and true under string matching — the divergence between those two oracles is the entire attack surface. If any one fails, delegation is not attenuating and the chain must be rejected at the hop where the property breaks, not at the eventual misuse. ## Decision Boundary The boundary is between *normalizing a scope for transport* and *reinterpreting a scope for a new vocabulary*. The first is permitted and must be provably reversible (the receiver can reconstruct the original atoms). The second is a privilege operation and must be treated as a fresh authorization request against the namespace authority, not as a delegation. Operationally: a sub-agent may rewrite atom *encoding* (prefixes, separators, casing) freely, but may not rewrite atom *granularity* (wildcard breadth, tenant segments, path depth). Granularity changes require the parent's warrant to already contain the widened atom — which, by definition, it does not, since that is what widening means. The guardrail is a **scope-diff gate** at every hop: compute `added = child_scope \ parent_scope` under the namespace oracle. If `added` is non-empty, the hop is an amplification and the delegating agent must either (a) obtain an explicit grant for `added` from the root authority, or (b) fail the handoff with the diff attached. Silent widening — where the diff is empty only because the oracle was string-based — is the failure this gate exists to catch. ## Operational Effect Without the gate, AAIF chains degrade into *credential laundering pipelines*: each hop's adapter, doing locally reasonable normalization, accumulates wildcard breadth until a low-privilege worker holds near-root scope. The failure is invisible to signature verification, invisible to per-hop logs (each logs `AUTHORIZED`), and only surfaces as downstream content or egress anomalies that are attributed to the wrong agent. Auditors replaying the chain see a clean authorization trail because the widening happened in a normalization step that was never logged as a scope mutation. With the gate, the `P → W` hop above fails at delegation with `added = ["tool:read_file:/tenant/*"]` minus the parent's atoms, and the orchestrator either narrows `P`'s adapter vocabulary or issues a real grant. The invariant that makes the whole framework sound is: **attenuation is a relation over resource namespaces, and every hop must re-prove it against the namespace oracle, never against the string form of the parent's atoms.** Directional containment, lossless vocabulary, and oracle anchoring are not three independent checks — they are the three faces of one invariant, and dropping any one silently converts delegation into escalation. ```python from dataclasses import dataclass class ScopeAmplificationError(RuntimeError): """Raised when a delegated scope is not a semantic subset of its parent.""" @dataclass(frozen=True) class Atom: kind: str # e.g. "tool:read_file" resource: str # e.g. "/tenant/acme/reports" def namespace_covers(parent: Atom, child: Atom) -> bool: """True iff parent's resource namespace strictly contains child's. Ground truth is the namespace authority, not string prefixes. Here we model it as: same kind, and child.resource is under parent.resource with a real path-segment boundary (not a raw startswith). """ if parent.kind != child.kind: return False p = parent.resource.rstrip("/") c = child.resource.rstrip("/") return c == p or c.startswith(p + "/") def assert_attenuating(parent_scope: list[Atom], child_scope: list[Atom]) -> None: """Enforce directional containment: every child atom covered by some parent atom. The quantifier order is load-bearing. Swapping it turns attenuation into amplification while still returning a bool. """ uncovered = [ c for c in child_scope if not any(namespace_covers(p, c) for p in parent_scope) ] if uncovered: raise ScopeAmplificationError( f"delegation widens scope; uncovered child atoms: {uncovered}" ) def delegate(parent_scope: list[Atom], requested: list[Atom]) -> list[Atom]: # A normalizing adapter that collapses tenant segments must fail here, # not proceed and launder the widened atom downstream. assert_attenuating(parent_scope, requested) return requested if __name__ == "__main__": parent = [ Atom("tool:read_file", "/tenant/acme"), Atom("tool:read_file", "/tenant/beta/reports"), ] # Adapter collapsed /tenant/acme and /tenant/beta into /tenant. widened = [Atom("tool:read_file", "/tenant")] try: delegate(parent, widened) except ScopeAmplificationError as e: print(f"hop rejected: {e}") raise ```