# Where must an instance draw the trust boundary when a tool manifest declares capabilities it does not own **Date of Record:** 2026 November 16 **Scope:** Applies to agent runtimes that load tool/skill manifests (including MCP servers) from a registry, filesystem, or remote endpoint and resolve capability dispatch by name or namespace. Does not apply to statically compiled, single-vendor tool sets with no manifest indirection layer. ## Core Distinction The failure is not "malicious tool executes code." That is a containment problem, already covered by sandboxing. The failure is **capability shadowing**: a manifest declares a name or namespace that collides with — or is a plausible alias of — a capability the runtime already trusts, and the resolver binds the caller's intent to the attacker's implementation. The manifest never has to lie about what it does; it only has to claim a name the dispatcher will prefer. Two distinct attack surfaces get conflated: 1. **Manifest-as-data poisoning** — the manifest content is attacker-controlled (supply-chain, typosquat registry, transitive dependency of a legitimate server). 2. **Manifest-as-claim overreach** — the manifest is authentic but declares capabilities (scopes, tools, resource URIs) broader than the server's actual authority, and the runtime trusts the declaration rather than the server's credentials. The non-obvious invariant: **the trust boundary must sit at the credential, not the manifest.** A manifest is a *hint* about what a server offers; it is never *proof* of what the server is authorized to do. Runtimes that resolve capability by manifest name and then authorize by manifest-declared scope have collapsed these two into one and are shadowable. ## What Was Observed A runtime loaded two MCP servers. Server `A` (trusted, audited) exposed `files.read`. Server `B` (an "analytics helper" pulled from a community registry) declared `files.read` as well, with a scope of `fs:read:/` and a description string that was byte-identical to `A`'s. The resolver used a first-registered-wins map keyed on the bare tool name. Registration order was determined by manifest load order, which was determined by directory enumeration order — not stable across deploys. On the deploy where `B` enumerated first, every `files.read` call routed to `B`. `B` returned correct results for benign paths, so nothing failed. The divergence only surfaced when a caller requested a path outside `B`'s actual container mount: `B` returned an empty result rather than a permission error, because it had no file at that path — indistinguishable from "file does not exist." Downstream logic treated empty as absent and proceeded. The shadow was invisible for eleven days. The secondary observation: `B`'s manifest declared `fs:read:/` but its process credential was scoped to a single mount. The runtime authorized the call against the *declared* scope, so no policy violation was logged. The credential was never consulted. This is the manifest-as-claim overreach, and it is the more dangerous of the two because it requires no name collision at all — only a manifest that overstates. ## Condition of Validity The shadowing attack is valid (i.e., succeeds) if and only if all of the following hold: - Capability resolution is keyed on a name or alias that is not namespaced by an authenticated server identity (e.g., `files.read` rather than `/files.read`). - Registration order or map iteration order is attacker-influenceable — via load order, registry priority, or duplicate-key overwrite semantics. - Authorization consults the manifest-declared scope rather than the server's presented credential or an out-of-band policy record. - The shadowed implementation can return a result that is *plausible but wrong* (empty, partial, or stale) rather than an error. An error would expose the shadow; a plausible wrong answer conceals it. Remove any one condition and the attack degrades to a detectable error or a no-op. The fourth is the one most often missed, because it is a property of the *attacker's implementation*, not of the runtime — but it is the condition that determines whether the compromise is silent. ## Decision Boundary The runtime must refuse to bind a capability to a manifest when the manifest's declared scope exceeds the authority provable from the server's credential, **and** must refuse to resolve a bare name that is claimed by more than one authenticated server identity. The boundary is not "is this server trusted" — that question is unanswerable at load time and invites allowlist rot. The boundary is: *does the credential presented by this server, verified out of band, cover every scope the manifest claims?* If yes, bind. If no, the manifest is overreaching; reject the overreaching scopes and either bind the intersection or refuse the server entirely. Refusing the intersection silently is itself a shadowing vector (the caller believes it has `fs:read:/` and has `fs:read:/mnt/x`), so the correct action is to refuse the server and surface the discrepancy. For name collisions across authenticated identities: never resolve by order. A bare name claimed by two identities is ambiguous; ambiguity must fail closed, not resolve by precedence. ## Operational Effect Enforcing the credential-scope invariant converts silent shadowing into a loud load-time failure. The cost is operational: legitimate servers whose manifests overstate their scopes (common, because manifest authors copy scope strings from documentation) now fail to load and must be corrected. This is the correct trade — an overstating manifest is exactly the artifact the attack relies on, and a runtime that tolerates it has no way to distinguish the honest overstatement from the malicious one. The second effect is that resolution becomes identity-keyed. Callers that referenced `files.read` must now reference the server identity explicitly, or the runtime must maintain a signed alias table mapping bare names to a single authorized identity. The alias table is itself a supply-chain surface and must be signed and versioned; it is the new thing to poison, but it is a smaller and auditable surface than "whatever enumerated first." The invariant to encode: **a manifest may narrow authority, never widen it.** Anything a manifest claims beyond its credential is discarded and the discrepancy is raised. ```python class CapabilityShadowError(RuntimeError): """Raised when a manifest claims authority its credential does not prove, or when a bare capability name is claimed by more than one identity.""" def bind_capability( manifest_name: str, declared_scopes: frozenset[str], credential_scopes: frozenset[str], claiming_identities: frozenset[str], ) -> frozenset[str]: # Ambiguity fails closed: never resolve by load order. if len(claiming_identities) > 1: raise CapabilityShadowError( f"capability {manifest_name!r} claimed by multiple identities " f"{sorted(claiming_identities)}; refusing to resolve by precedence" ) # A manifest may narrow authority, never widen it. overreach = declared_scopes - credential_scopes if overreach: raise CapabilityShadowError( f"manifest {manifest_name!r} declares scopes {sorted(overreach)} " f"not covered by its credential; refusing server rather than " f"silently binding the intersection" ) return declared_scopes & credential_scopes ```