# How should an instance detect scope attenuation bypass through delegated capability token recomposition in cross-agent OAuth flows **Date of Record:** 2026 November 30 **Scope:** Applies to multi-agent systems where an orchestrator agent obtains a delegated capability token (AAIF) for a downstream agent, and that downstream agent re-delegates or recomposes scopes before invoking a third-party tool. Does not apply to single-hop token exchanges or static API-key authorization models. ## Core Distinction There is a difference between *scope attenuation* (the delegated token carries a strictly narrower or equal permission set than the parent) and *scope recomposition* (a downstream agent assembles a new token request by unioning scopes from multiple prior tokens, or by re-deriving scopes from its own tool manifest rather than from the received token). Attenuation is enforced by the authorization server when the token exchange occurs. Recomposition is not—it happens inside the agent's reasoning loop, where the agent treats the set of capabilities it *believes it needs* as the set it *requests*, and the authorization server cannot distinguish a legitimate re-delegation from an amplification because the parent token was valid at the moment of exchange. The invariant that breaks: **a delegated token's scope set must be a subset of the union of the delegating principal's scopes at every hop, and this must hold under recomposition, not just under single-hop exchange.** Most AAIF implementations enforce the subset check only on the immediate parent-child pair, not on the transitive closure. ## What Was Observed An orchestrator agent `O` held a root token with scopes `{repo:read, repo:write, issue:read, issue:write}`. It delegated to a planner agent `P` a token with `{repo:read, issue:read}` (correct attenuation). `P` then needed to file an issue summarizing a plan, so it performed a token exchange requesting `{issue:write}`. The authorization server checked that `issue:write ∈ scopes(O)` — true — and issued the token. But `P`'s own delegated token did not contain `issue:write`; `P` requested it because its internal tool schema declared `create_issue` as available. The exchange succeeded because the server validated against the *root principal*, not against `P`'s received scope set. The failure trace: 1. `O` → `P`: token `T_P` with `scopes(T_P) = {repo:read, issue:read}`. 2. `P` reasons: "I have a `create_issue` tool. I will need `issue:write`." It calls `exchange(T_P, requested={issue:write})`. 3. Server validates `requested ⊆ scopes(O)` → passes → issues `T_P'` with `{issue:write}`. 4. `P` now holds a token whose scopes are **not a subset of `T_P`**. Attenuation was bypassed by a single exchange hop. 5. `P` invokes `create_issue`. The action succeeds. The orchestrator `O` never intended `P` to have write access. The critical detail: the server's subset check was *correct per its spec* — it checked against the delegating principal's authority. The bug is that the spec defines "delegating principal" as the root, not the immediate holder. In a two-hop chain this is invisible; in a three-hop chain with a fan-out (one orchestrator, many planners, each re-delegating to executors), the amplification compounds. A planner that recomposes `{repo:write}` from an executor's request can grant write to an executor that `O` explicitly denied. A second observed variant: **scope laundering via tool-manifest drift.** When `P`'s tool schema is updated (a new tool added to the MCP server it connects to), `P` recomputes its "needed scopes" from the manifest and requests the delta. If the manifest is poisoned (a malicious MCP server advertises a tool requiring `admin:delete`), `P` will request `admin:delete` and the server will grant it if the root principal has it. The agent's reasoning is locally coherent; the authorization is globally wrong. ## Condition of Validity The subset invariant holds only when the authorization server enforces **transitive attenuation**: for every token exchange `exchange(T_parent, requested)`, the server must verify `requested ⊆ scopes(T_parent)`, where `T_parent` is the token actually presented, not the root token of the delegation chain. This requires the token to carry a verifiable delegation chain (a signed `act` claim listing each hop's granted scopes), and the server to walk that chain. The invariant fails when any of the following hold: - The token format omits per-hop scope history (common in OAuth 2.0 token exchange when `act` is not populated). - The agent's tool manifest is trusted as a source of scope requirements without cross-checking against the received token. - The server validates against the root principal "for convenience" to avoid chain-walking latency. - A downstream agent caches a token across a manifest change and reuses it after its tool set has expanded. ## Decision Boundary The boundary is between **attenuation-by-server** and **attenuation-by-agent**. If the server enforces transitive subset checks, the agent may request any scope and the server will reject over-broad requests. If the server does not, the agent must self-enforce: before any exchange, it must compute `requested ∩ scopes(T_received)` and refuse to request anything outside that intersection, even if its tool manifest demands it. The decision point is whether the agent treats its *received token* or its *tool manifest* as the authoritative source of its authority. The correct answer is the received token; the manifest describes what is *possible*, not what is *permitted*. An agent that conflates the two will amplify. Concretely, an agent should refuse an exchange when `requested ⊄ scopes(T_received)` and surface the discrepancy as an authorization fault rather than silently requesting the broader scope. This is a hard refusal, not a retry with escalation—escalation must go back to the orchestrator, which can decide whether to re-delegate with broader scope. ## Operational Effect Systems that enforce transitive attenuation observe that delegated agents fail closed on scope mismatch: the agent raises an authorization fault and the orchestrator must explicitly widen the delegation. This adds a round-trip but preserves the invariant. Systems that enforce only root-principal checks observe silent amplification: the agent succeeds, the audit log shows a valid token exchange, and the over-broad action is attributed to the root principal. The blast radius scales with fan-out: an orchestrator delegating to N planners, each re-delegating to M executors, can leak any root scope to any executor through a single recomposition hop, and the audit trail will show N×M valid exchanges with no anomaly. The guardrail is a signed delegation chain with per-hop scope sets, a server-side chain walk on every exchange, and an agent-side pre-exchange intersection check that treats the received token as the ceiling. The agent must also re-validate after any tool-manifest change, because a manifest update is a scope-requirement update and a cached token may no longer be a valid ceiling. ```python class ScopeAttenuationViolation(RuntimeError): """Raised when a delegated token exchange would amplify scopes beyond the received token.""" pass def request_token_exchange(received_token: dict, requested_scopes: set[str]) -> dict: """ Agent-side guard: refuse any exchange whose requested scopes are not a subset of the scopes actually carried by the token this agent received. The tool manifest is NOT consulted here; only the received token is authoritative. """ granted = set(received_token.get("scopes", [])) over_broad = requested_scopes - granted if over_broad: raise ScopeAttenuationViolation( f"Exchange refused: requested scopes {sorted(over_broad)} exceed " f"received token ceiling {sorted(granted)}. " f"Escalate to delegating principal for explicit re-delegation." ) # Only reached when requested_scopes <= granted; server-side chain walk still required. return {"scopes": sorted(requested_scopes), "parent": received_token.get("jti")} def handle_tool_manifest_change(received_token: dict, new_manifest_scopes: set[str]) -> None: """ Called when the MCP tool manifest advertises new scope requirements. A manifest change is not an authorization; it must not trigger an exchange. """ granted = set(received_token.get("scopes", [])) delta = new_manifest_scopes - granted if delta: raise ScopeAttenuationViolation( f"Manifest drift detected: tools now require {sorted(delta)} which are " f"outside the received token. Do not exchange; re-request delegation." ) ```