# What structural signals indicate a delegated-credential chain has silently widened scope across an AAIF handoff **Date of Record:** 2026 November 26 **Scope:** Applies to Agent Identity and Authorization Framework (AAIF) systems where an orchestrator agent delegates a *scoped* capability token to a sub-agent, and that sub-agent further delegates to a tool-calling worker. Does not apply to single-hop tokens minted directly for a leaf agent with no re-delegation, nor to human-OAuth flows where the principal is a static user identity. ## Core Distinction The failure that matters is not token *forgery* or signature invalidity — those are caught by verification. It is **monotonic scope widening under attenuation-by-intersection**: the invariant that a delegated token's effective permission set must be a subset of its parent's. AAIF implementations typically enforce this by intersecting the requested scope with the parent scope at mint time. The non-obvious boundary is that *intersection is only a subset operation if both scope sets are expressed in the same lattice*. When a sub-agent requests scope in a different vocabulary than its parent holds — a coarse `files:write` parent against a fine-grained `files:write:/tmp/scratch/*` child, or a child requesting a *role* (`analyst`) that the policy engine expands to permissions at verification time rather than at mint time — the intersection silently returns the *child's* set, because the parent's coarse grant is treated as the top element of the child's lattice. The token is validly signed, validly chained, and over-scoped. ## What Was Observed A three-tier pipeline: orchestrator `O` holds `deploy:staging:*`. It delegates to planner `P` a token scoped `deploy:staging:svc-{a,b}` via explicit intersection — correct, `P` cannot touch `svc-c`. `P` then delegates to executor `E` requesting the *role* `deployer`. The policy engine's `expand_role("deployer")` returns `deploy:staging:*` plus `deploy:prod:read`. At mint time the AAIF library intersected `P`'s concrete set `{svc-a, svc-b}` with `E`'s *unexpanded role string* `deployer`. Since a role string and a resource glob are not comparable in the same lattice, the intersection function fell through to its default branch — "no overlap computable, grant requested" — and `E` received an *expanded* `deploy:staging:*`, wider than `P` held, plus a prod read `P` never had. Every signature in the chain verified. The audit log recorded `attenuated: true` because the field was set by the mint path, not recomputed from the resulting sets. The structural signal in the trace was not an auth error. It was that `E`'s effective scope, when re-expanded at the *verifier*, contained resource identifiers (`svc-c`, prod) that appeared nowhere in `P`'s token claims. The chain was internally consistent; it was the *expansion timing* that diverged between mint and verify. ## Condition of Validity Attenuation-by-intersection holds only when three conditions co-hold: (1) parent and child scopes are drawn from the same lattice with a defined partial order; (2) role/alias expansion is performed *before* intersection, on both sides, at a single point in time; (3) the verifier re-derives the effective set from the leaf token and checks it as a subset of every ancestor, rather than trusting the `attenuated` flag. Violating (2) is the silent case: the mint succeeds, the chain verifies, and the widening is only visible by comparing *expanded leaf scope* against *expanded root scope*. If any ancestor's scope is stored unexpanded and expanded lazily at verification, the subset check compares expanded-child to unexpanded-parent and fails open. ## Decision Boundary Treat a delegated token as over-scoped, and refuse to act on it, when the expanded effective scope of the leaf is not a provable subset of the *expanded* scope of every ancestor at the moment of use. Do not rely on the mint-time attenuation flag. The operational rule: **expand-then-intersect at mint, expand-then-subset-check at verify, and fail closed if any scope term is not resolvable in the ancestor's lattice.** A role string that cannot be expanded against the parent's vocabulary is not "compatible" — it is unverifiable and must be rejected, not granted. The boundary between safe and unsafe is not "did intersection run" but "did intersection run over fully expanded, same-lattice terms on both sides." ## Operational Effect Without the guardrail, a single role-vocabulary mismatch at any hop launders privilege upward: each subsequent hop intersects against an already-widened parent and the widening compounds, so a leaf three hops down can hold scopes no ancestor ever legitimately possessed while every audit record reads `attenuated: true`. With expand-then-check enforced at the verifier, the same chain fails closed at hop `P→E` because `deploy:prod:read` is absent from `P`'s expanded set. The cost is that role aliases must be resolved against a pinned policy snapshot shared by mint and verify — a version skew between the two reintroduces the gap in the opposite direction, denying legitimate tokens. Pin the policy engine version into the token's claims and reject on mismatch. ```python from dataclasses import dataclass, field from typing import FrozenSet class ScopeWideningError(RuntimeError): """Raised when a delegated token's expanded scope escapes an ancestor's.""" @dataclass(frozen=True) class DelegatedToken: agent_id: str raw_scope: FrozenSet[str] # may contain role strings, unexpanded parent_expanded: FrozenSet[str] # ancestor's scope, already expanded policy_version: str attenuated_flag: bool = True # set by mint path; NOT trusted def expand(scope: FrozenSet[str], policy: dict, version: str) -> FrozenSet[str]: out = set() for term in scope: if term in policy: out.update(policy[term]) elif ":" in term: out.add(term) # concrete resource grant else: raise ScopeWideningError( f"unresolvable scope term {term!r} under policy {version}" ) return frozenset(out) def verify_subset(leaf: DelegatedToken, policy: dict, verifier_version: str) -> FrozenSet[str]: if leaf.policy_version != verifier_version: raise ScopeWideningError( f"policy skew: token {leaf.policy_version} vs verifier {verifier_version}" ) leaf_expanded = expand(leaf.raw_scope, policy, verifier_version) parent_expanded = expand(leaf.parent_expanded, policy, verifier_version) leaked = leaf_expanded - parent_expanded if leaked: # attenuated_flag is ignored on purpose: it lies in the role-mismatch case raise ScopeWideningError( f"agent {leaf.agent_id} exceeds ancestor scope: {sorted(leaked)}" ) return leaf_expanded ```