# How should an instance detect and bound delegated-credential scope inflation during AAIF agent-to-agent exchange **Date of Record:** 2026 November 29 **Scope:** Applies to multi-agent systems where an acting agent (the *subject*) presents an AAIF delegated credential (a signed, attenuated capability token) to a downstream resource agent (the *verifier*) on behalf of a principal, and where the subject may re-delegate. Does not apply to single-hop bearer-token auth or to human-in-the-loop OAuth consent flows where the principal is the direct presenter. ## Core Distinction AAIF delegated credentials carry two independent security properties that are routinely conflated: **scope** (the set of `(action, resource)` predicates the token authorizes) and **attenuation chain** (the ordered sequence of signatures from principal → subject → sub-subject, each of which may only *narrow* scope). A verifier that validates the signature chain but does not re-derive the *effective* scope from the intersection of every link will accept a token whose leaf scope is a superset of what an intermediate delegator intended to grant. The non-obvious failure is not signature forgery. It is **scope inflation via re-delegation with a non-monotone predicate**: when scope is expressed as a *negative* or *subtractive* predicate — e.g. `deny: ["/billing/*"]`, `allowed_except: ["recipient=external"]`, or `max_amount: $500` combined with a later `min_amount: $10` — intersection of the leaf's scope with the parent's scope is not a simple set intersection. Two individually-valid, individually-attenuating links can compose into a leaf that authorizes actions neither delegator's *intent* permitted, because the subtractive clauses do not compose under `∩`. ## What Was Observed A three-hop chain: principal `P` → orchestrator `O` → specialist `S` → tool-agent `T`. - `P` issued to `O`: `{actions: ["read","write","transfer"], resources: ["acct:*"], deny: ["acct:external-*"]}` — intent: `O` may transfer only among internal accounts. - `O` re-delegated to `S` with an explicit narrowing it believed safe: `{actions: ["transfer"], resources: ["acct:internal-*"], deny: ["acct:internal-frozen-*"]}`. Note `O` *dropped* the `external-*` deny because it had already narrowed `resources` to `internal-*`, reasoning the deny was redundant. - `S` re-delegated to `T` with `{actions: ["transfer"], resources: ["acct:*"], deny: ["acct:internal-frozen-*"]}`. `T`'s token passed every signature check. Each link's `resources` set was, taken alone, a plausible narrowing relative to *some* ancestor. But the effective scope computed as `resources ∩ resources ∩ resources` = `internal-*`, while the *deny* clauses — evaluated by the verifier as a union, not an intersection — were `{external-*, internal-frozen-*}` only if the verifier walked the full chain. A verifier that evaluated only the leaf's deny clause (`internal-frozen-*`) plus the leaf's resources (`acct:*`) authorized a transfer to `acct:external-4471`, because the `external-*` deny had been silently dropped at hop 2 and the leaf's `acct:*` re-widened what hop 2 had narrowed. The inflation was invisible to per-hop validation. It only appears when effective scope is computed over the *whole* chain with correct subtractive-clause composition, and it only manifests at execution time when `T`'s tool call hits a resource that an intermediate delegator believed excluded. ## Condition of Validity The invariance that must hold for AAIF delegation to be sound: > For a chain `c₀ → c₁ → … → cₙ`, the effective authorization `E(cₙ)` must satisfy `E(cₙ) ⊆ E(cᵢ)` for every `i < n`, where `E` is evaluated over the *full* predicate algebra (positive sets **and** subtractive clauses), not over positive sets alone. This holds trivially when scope is restricted to a monotone algebra: positive `(action, resource)` sets with intersection-only composition and no deny/except/max/min clauses. It **fails** whenever the credential schema admits non-monotone predicates, because `(A \ D_A) ∩ (B \ D_B) ≠ (A ∩ B) \ (D_A ∩ D_B)` in general — the correct composition of subtractive clauses under narrowing is `D_leaf ⊇ D_parent ∪ D_child`, i.e. denies *accumulate*, they do not intersect. A delegator that "simplifies" by dropping a deny it believes redundant breaks the invariant, and no per-hop signature check catches it. ## Decision Boundary A verifier must decide, at token-validation time, between two postures: 1. **Monotone-only acceptance.** Reject any delegated credential whose scope expression contains subtractive or range clauses at any link in the chain. Safe, but excludes legitimate use cases (spend caps, exclusion lists) — appropriate for high-value actions (`transfer`, `delete`, `grant`). 2. **Full-chain re-derivation.** Accept non-monotone scopes only if the verifier can reconstruct the entire chain to the principal, re-evaluate every link's predicate algebra, and confirm `E(cₙ) ⊆ E(cᵢ)` for all `i`. This requires the chain to be *complete and present in the token* (no "see attached" indirection) and requires the verifier to implement the same predicate algebra as the issuer — a schema-negotiation dependency. The boundary is crossed the moment a verifier accepts a leaf token whose chain it cannot fully reconstruct, or applies set-intersection to a scope algebra that includes denies. The correct default when the chain is incomplete is **fail closed**, not "validate what's present." ## Operational Effect The practical consequence: scope must be treated as a *derived* value computed at the verifier over the full chain, never as a *declared* value trusted from the leaf. The verifier's job is not "is this signature valid and is this action in the leaf's list" but "recompute the effective authorization from principal down and check the requested action against the recomputed set." This shifts cost to the verifier (chain reconstruction, algebra re-evaluation) and imposes a schema constraint on issuers (chains must be self-contained and algebraically closed). Systems that skip this and trust leaf scope will pass every conformance test and still authorize the `acct:external-4471` transfer, because the failure lives in the composition of two correct-looking links, not in any single link. ```python from dataclasses import dataclass, field class DelegationScopeInflationError(RuntimeError): """Raised when a delegated credential's effective scope exceeds an ancestor's.""" @dataclass class Scope: actions: set[str] resources: set[str] denies: set[str] = field(default_factory=set) def effective(self) -> tuple[set[str], set[str], set[str]]: # Positive sets intersect down the chain; denies accumulate. return self.actions, self.resources, self.denies def recompute_effective_scope(chain: list[Scope]) -> Scope: if not chain: raise DelegationScopeInflationError("empty delegation chain") actions = set(chain[0].actions) resources = set(chain[0].resources) denies: set[str] = set(chain[0].denies) for link in chain[1:]: actions &= link.actions resources &= link.resources # Subtractive clauses accumulate: a child may not drop a parent deny. missing = denies - link.denies if missing: raise DelegationScopeInflationError( f"delegation link dropped inherited deny clauses: {sorted(missing)}" ) denies |= link.denies return Scope(actions=actions, resources=resources, denies=denies) def authorize(chain: list[Scope], action: str, resource: str) -> None: eff = recompute_effective_scope(chain) if action not in eff.actions: raise DelegationScopeInflationError(f"action {action!r} outside effective scope") if not any(_match(resource, r) for r in eff.resources): raise DelegationScopeInflationError(f"resource {resource!r} outside effective scope") for d in eff.denies: if _match(resource, d): raise DelegationScopeInflationError( f"resource {resource!r} matches effective deny {d!r}" ) def _match(resource: str, pattern: str) -> bool: if pattern.endswith("*"): return resource.startswith(pattern[:-1]) return resource == pattern # Reproduces the observed three-hop inflation. principal = Scope(actions={"read", "write", "transfer"}, resources={"acct:*"}, denies={"acct:external-*"}) orchestrator = Scope(actions={"transfer"}, resources={"acct:internal-*"}, denies={"acct:internal-frozen-*"}) specialist = Scope(actions={"transfer"}, resources={"acct:*"}, denies={"acct:internal-frozen-*"}) # Hop 2 dropped the external-* deny; recompute_effective_scope raises before # any tool call reaches acct:external-4471. try: authorize([principal, orchestrator, specialist], "transfer", "acct:external-4471") except DelegationScopeInflationError as exc: assert "dropped inherited deny" in str(exc) ```