# Why does an instance lose capability attenuation across chained MCP server hops when a composed tool re-exports a downstream capability under a broader scope **Date of Record:** 2026 November 28 **Scope:** Applies to agent runtimes that compose multiple MCP servers into a call graph where an upstream server exposes tools that internally invoke downstream servers under a delegated capability token. Does not apply to flat single-server MCP topologies or to servers that never re-export downstream tools. ## Core Distinction The failure here is not a permission *check* failing. Every individual MCP server in the chain validates its inbound capability token correctly. The failure is that **attenuation is not transitive across re-export boundaries**: when server B exposes a tool that wraps a tool on server C, B advertises the composed tool with a scope derived from B's *own* grant, not from the intersection of the caller's grant and C's requirement. The caller holds a token scoped to `files:read:/project/a`, invokes B's `summarize_corpus` tool, and B—holding a broader `files:read:/project` grant—reissues the downstream call to C using B's own authority. C checks the token, sees a valid `files:read:/project`, and returns content the original caller was never entitled to. No check was bypassed; the *scope algebra* was wrong at the composition seam. ## What Was Observed A three-tier graph: orchestrator agent → server `B` (a "corpus summarizer" that composes `C`) → server `C` (a sandboxed filesystem reader). The orchestrator was minted a capability `cap(read, path=/project/a/**)` by the control plane. It negotiated B's tool manifest via `tools/list`, which advertised `summarize_corpus(root: string)` with an input schema that only constrained `root` to a string—no path prefix constraint, because B's manifest generator derived the schema from B's *own* upstream grant, which was `path=/project/**`. Trace of the divergence: 1. Orchestrator calls `summarize_corpus(root="/project/b/secrets")`. 2. B's handler receives the request with the caller's capability token attached in the transport metadata. 3. B does *not* intersect the requested `root` against the caller's `path=/project/a/**` scope; it only checks that the caller holds *some* `read` capability on B. 4. B invokes C using **B's own service credential**, scoped `path=/project/**`. 5. C validates B's credential successfully and returns `/project/b/secrets` contents. 6. The content flows back through B to the orchestrator, which now holds data outside its granted scope. The sandbox on C held. C's invocation sandbox (seccomp + read-only mount of `/project`) never permitted anything C wasn't configured to read. The breach is purely at the capability-composition layer: the *effective* scope of the composed call was `B.grant ∩ C.config`, and the caller's grant never entered the intersection. Classic confused-deputy, but the non-obvious part is that it arises *legitimately* from MCP's design: each server is a trust boundary that validates its own inbound token, and there is no protocol-level requirement that a server propagate the caller's scope into downstream calls it makes on the caller's behalf. ## Condition of Validity The invariant that must hold for composed MCP graphs to be safe is: > For any tool `T` on server `B` that transitively invokes server `C` on behalf of caller `U`, the effective authority of the downstream call must be `scope(U) ∩ scope(B) ∩ scope(C)`, and this intersection must be *computed at the composition seam*, not delegated to any single server's self-check. This invariant holds trivially in a two-party call (caller → server): the server checks `scope(U) ∩ scope(server)`. It breaks the moment `B` acts as an *agent* toward `C` rather than a *proxy*. MCP gives servers no standard mechanism to forward the caller's attenuated token, and most server SDKs default to using the server's own configured credential for outbound calls—which is exactly the confused-deputy pattern. The invariant is *not* required when: (a) B re-exports C's tool without adding authority (pure passthrough where B forwards the caller token verbatim), or (b) the control plane mints per-hop attenuated tokens at graph-composition time rather than at call time. ## Decision Boundary The boundary is whether the composing server treats its downstream calls as **acting-for-self** or **acting-for-caller**. Operationally: - If B's manifest generator emits an input schema whose constraints are derived from B's own grant, B is acting-for-self, and the caller's scope is decorative. **Reject composition.** - If B's manifest generator emits an input schema constrained to the *intersection* of B's grant and the caller's grant (requiring schema specialization per caller), B is acting-for-caller and safe. This is expensive—it forces per-caller manifest generation and invalidates the tool-list cache. - If the control plane mints a fresh attenuated token per hop (B receives `cap_B` and mints `cap_B ∩ caller_scope` before calling C), the graph is safe regardless of B's internal logic, but requires a capability-minting authority reachable from every server. The practical guardrail: **at the composition seam, refuse to invoke a downstream tool unless the composing server can prove the requested arguments satisfy the caller's scope**, and treat any composed tool whose input schema is not caller-scope-specialized as a privilege-escalation surface. Enforce this with a pre-invocation scope check in the orchestrator that re-validates arguments against the caller's own grant *before* dispatch, treating the downstream server's check as defense-in-depth rather than the primary control. ## Operational Effect Without the guardrail, capability attenuation is illusory in any MCP graph deeper than one hop: an orchestrator granted a narrow scope can reach any resource the *intermediate* servers hold, because each hop launders authority through the server's own credential. The blast radius equals the union of all intermediate servers' grants, not the caller's grant. Auditing is also defeated: C's logs show a legitimate call from B under B's valid credential, so no anomaly fires. The only reliable detection is at composition time—comparing the caller's declared scope against the arguments actually dispatched—which requires the orchestrator to retain and enforce its own grant rather than trusting the graph to preserve it. ```python class CapabilityAttenuationError(RuntimeError): """Raised when a composed MCP tool call would exceed the caller's granted scope.""" def dispatch_composed_tool( caller_scope: dict, server_grant: dict, requested_args: dict, downstream_server: str, ) -> None: """ Enforce the composition-seam invariant: effective authority is the intersection of caller scope, composing-server grant, and the requested resource. Refuse to dispatch if the request escapes the caller's scope, even though the intermediate server's own grant would permit it. """ requested_path = requested_args.get("root") if requested_path is None: raise CapabilityAttenuationError( f"composed tool on {downstream_server} requires 'root'; none supplied" ) caller_prefix = caller_scope.get("path") server_prefix = server_grant.get("path") if caller_prefix is None or server_prefix is None: raise CapabilityAttenuationError( f"missing path scope: caller={caller_prefix!r} server={server_prefix!r}" ) # The caller's grant must cover the request. The server's broader grant # does NOT launder authority on the caller's behalf. if not requested_path.startswith(caller_prefix.rstrip("*").rstrip("/")): raise CapabilityAttenuationError( f"scope escape: caller={caller_prefix!r} requested={requested_path!r} " f"via {downstream_server} (server grant {server_prefix!r} does not " f"widen caller authority)" ) # Only reached when the request is within the caller's attenuated scope. _invoke_downstream(downstream_server, requested_args) def _invoke_downstream(server: str, args: dict) -> None: # Placeholder for the actual MCP transport call. return None ```