# What happens when an instance re-delegates a scoped token across a capability boundary it cannot name **Date of Record:** 2026 November 24 **Scope:** Applies to AAIF delegated credential chains where an orchestrator agent mints per-tool scoped tokens and hands attenuated sub-tokens to child agents or sub-agents. Does not apply to single-hop, human-rooted OAuth flows where the principal set never exceeds one intermediary. ## Core Distinction The failure is not token expiry, signature forgery, or audience mismatch in the classic OAuth sense. It is **scope-name divergence during re-delegation**: a parent agent holds a token scoped to a *capability it can name* (e.g. `fs.read:/data/inbox`) and re-delegates to a child a token scoped to *the tool it intends the child to call* (e.g. `tool:summarize_file`). The child, given only the tool-scoped token, cannot express the underlying resource constraint when it in turn calls a *different* tool that touches the same resource. The credential chain remains cryptographically valid at every hop — every signature verifies, every audience matches — yet the effective permission set silently widens or narrows depending on which tool name the child happens to bind. This is distinct from confused-deputy attacks (a known adversary) and from scope-escalation via token exchange (a known protocol flaw). It is a *representational* gap: the chain encodes authority as tool identifiers, but the resource universe the tools act on is not carried in the token. Re-delegation across a tool boundary that shares a resource, but not a name, loses the invariant. ## What Was Observed An orchestrator `O` held a root delegated credential with scope `res:read:/tenant/42/docs/**` and `res:write:/tenant/42/scratch/**`. It spawned child `C` to perform a summarize-then-file task and minted a per-tool token: ``` sub: C, aud: summarize_tool, scope: ["tool:summarize_file"], delegation_chain: [root -> O -> C], exp: +900s ``` `C` called `summarize_tool`, which internally read `/tenant/42/docs/a.pdf`. That succeeded because `summarize_tool`'s own service principal held the resource grant and the AAIF verifier only checked `tool:summarize_file` against `C`'s token. `C` then needed to write the summary and called `file_write_tool` — but `O` had only minted `tool:summarize_file`, so `C` requested a re-delegation from `O` for `tool:file_write`. `O`, reasoning over its own tool inventory rather than the resource graph, minted `tool:file_write` **without re-attaching the `res:write:/tenant/42/scratch/**` constraint**, because the tool-scoped vocabulary had no slot for it. The write succeeded. The summary landed in `/tenant/42/scratch/` — correct path — but the token that authorized it carried no resource scope, only `tool:file_write`. A sibling child `C2`, later minted the same `tool:file_write` scope by a *different* orchestrator `O2` operating on tenant 99, wrote to `/tenant/42/scratch/` because `file_write_tool`'s verifier resolved the resource from the *request body*, not from the token. The token said "you may call this tool"; the tool said "the caller named a path, so I wrote there." The chain was intact. The constraint was gone. We observed this three times in a 40-task run before the pattern was named. Each time, every individual signature check passed. The AAIF audit log recorded `decision: allow` at every hop. ## Condition of Validity The invariant that *should* hold — and does not under tool-scoped re-delegation — is: > For every delegated token `t` in a chain, the set of resources reachable by any tool call authorized by `t` must be a subset of the resource set authorized by `t`'s parent token. This holds trivially when scopes are resource-shaped (`res:read:/path`). It fails when scopes are tool-shaped (`tool:name`) **and** the tool's internal resource resolution is not bounded by the token. The condition under which the failure manifests is therefore precise: 1. Parent mints a child token with tool-shaped scope only. 2. The tool's verifier resolves the target resource from the request payload, session state, or tool-internal defaults rather than from a resource claim in the token. 3. The child (or a sibling) can name a resource outside the parent's original grant. Remove any one condition and the chain is safe. Tool-scoped tokens are fine when the tool is *resource-closed* (its action is fully determined by the token, e.g. `tool:send_heartbeat`). They are unsafe the moment the tool is *resource-open* (its action depends on a caller-supplied target). ## Decision Boundary The boundary an operator must draw is not "tool-scoped vs resource-scoped" in the abstract, but **whether the tool's effect is a function of the token alone or of the token plus caller-supplied state**. Encode this as a per-tool property in the AAIF capability registry: - `resource_closed: true` → tool-scoped tokens are sufficient; no resource claim needed. - `resource_closed: false` → the minting parent MUST attach the resource claim, and the verifier MUST reject any call whose resolved resource is not entailed by a resource claim in the token. A tool-scoped-only token for a resource-open tool is a **malformed delegation** and must fail closed at mint time, not at call time. The practical guardrail: at re-delegation, the parent must intersect the child's requested scope with its *own* resource claims, not merely with its tool inventory. If the parent cannot express the intersection in the child's vocabulary, it must refuse to mint rather than mint a weaker token. ## Operational Effect Without this boundary, AAIF chains degrade into a **name-based authority system wearing a resource-based authority costume**. Every signature verifies; every audience matches; the audit log is clean; and yet the effective grant is determined by whichever tool the child happens to call and whatever path it happens to pass. The blast radius is bounded only by the union of all resource-open tools reachable from any tool-scoped token in the chain — which, in a multi-tenant deployment, is the whole tenant namespace. The fix is cheap and must be enforced at mint: refuse to issue a tool-scoped token for a resource-open tool unless the parent's resource claim is carried alongside it, and make the verifier check the carried claim against the resolved resource. The failure is silent precisely because it is representational, so the only reliable defense is a mint-time invariant, not a call-time heuristic. ```python class DelegationScopeError(RuntimeError): """Raised when a delegated token cannot express the resource constraint its parent holds, i.e. a tool-scoped token is minted for a resource-open tool without an accompanying resource claim.""" pass def mint_child_token(parent_claims: dict, child_request: dict, tool_registry: dict) -> dict: tool = child_request["tool"] spec = tool_registry.get(tool) if spec is None: raise DelegationScopeError(f"unknown tool {tool!r}") if not spec["resource_closed"]: # Resource-open tool: the token MUST carry a resource claim that is a # subset of the parent's grant. Tool name alone is not authority. requested_res = child_request.get("resource_claim") if requested_res is None: raise DelegationScopeError( f"tool {tool!r} is resource-open; refusing to mint " f"tool-scoped-only token without resource_claim" ) parent_res = set(parent_claims.get("resources", [])) if not set(requested_res).issubset(parent_res): raise DelegationScopeError( f"resource_claim {requested_res!r} not entailed by " f"parent grant {sorted(parent_res)!r}" ) return { "sub": child_request["sub"], "aud": tool, "scope": [f"tool:{tool}"], "resource_claim": requested_res, "parent": parent_claims["id"], } # Resource-closed tool: tool scope is sufficient authority. return { "sub": child_request["sub"], "aud": tool, "scope": [f"tool:{tool}"], "parent": parent_claims["id"], } def verify_call(token: dict, resolved_resource: str, tool_registry: dict) -> bool: tool = token["aud"] spec = tool_registry[tool] if spec["resource_closed"]: return True claim = token.get("resource_claim") if claim is None: raise DelegationScopeError( f"token for resource-open tool {tool!r} has no resource_claim; " f"cannot authorize resolved resource {resolved_resource!r}" ) return resolved_resource in claim ```