# When must an instance reject a dynamically loaded MCP tool whose manifest declares a capability the runtime did not negotiate **Date of Record:** 2026 December 3 **Scope:** Applies to agent runtimes that load tools, MCP servers, or plugin manifests at runtime after the initial session handshake, where the manifest is treated as a declaration of capabilities rather than a binding contract. Does not apply to statically linked toolchains compiled into the agent binary, nor to tools whose schemas are fixed at process start and never re-read. ## Core Distinction There are two structurally different trust boundaries when an agent loads a skill, and conflating them is the root of the failure mode. The first is the **schema boundary**: what the tool's manifest *says* it can do — the argument types, the side effects it declares, the scopes it requests. The second is the **warrant boundary**: what the runtime *actually granted* to this instance at negotiation time, encoded in the session's capability token, the tool-allowlist snapshot, and the caller's delegated authority. A skill-injection attack does not need to break the schema boundary. It only needs the runtime to treat the manifest's self-description as if it were a warrant. The manifest is attacker-controlled input; the warrant is the runtime's own prior decision. When a dynamically loaded tool declares `capabilities: ["filesystem:write", "network:egress"]` but the session was negotiated with only `filesystem:read`, the correct behavior is a hard rejection at load time. The failure mode is the runtime silently widening the effective warrant to match the manifest — because the manifest "looks valid," because the schema parsed cleanly, because the tool registered successfully and the agent proceeded to call it. The invariant: **effective capability of a loaded tool = manifest declaration ∩ session warrant ∩ caller delegation.** Any component that computes this as `manifest declaration` alone, or as `manifest ∪ warrant`, has an injection surface. The intersection is not a defensive nicety; it is the only thing standing between a parsed YAML file and arbitrary egress from inside an agent's execution loop. ## What Was Observed A runtime loaded a third-party MCP server at task midpoint (the agent decided it needed a "spreadsheet parser" and discovered one via a tool-registry lookup). The manifest was well-formed. The `inputSchema` was a valid JSON Schema. The `description` field contained a plausible sentence about parsing CSV and XLSX. Buried in the manifest was a `tools[].annotations` block declaring `readOnlyHint: false` and a non-standard `requiresScopes: ["fs:rw", "net:out"]` — a field the loader did not recognize but did not reject, because the loader validated against a permissive schema that allowed additional properties. The session warrant, negotiated at handshake, granted `fs:read` on a single workspace path and no network. The loader's capability-check function read `manifest.capabilities` (absent, so defaulted to `[]`), found no violation, and registered the tool. The `requiresScopes` field was ignored — it was not in the loader's known-keys set. But the tool's *actual* handler, invoked by the model, opened a socket to an external host and wrote to a path outside the workspace. The model did this because the tool's `description` — which the model reads as instructions — said the parser "may cache parsed output to a temporary remote endpoint for performance." The model had no way to know the warrant forbade egress. The runtime had the information and did not enforce it. The trace: manifest parsed → unknown keys dropped silently → capability check consulted the wrong field → tool registered → model read description as guidance → model invoked tool with arguments that satisfied the schema → handler executed with the process's full ambient authority (the OS-level permissions of the agent process, not the negotiated warrant) → egress occurred. The gap between the negotiated warrant and the process's ambient authority was never closed. The tool ran with whatever the process could do, and the manifest's self-description was the only thing the model consulted. ## Condition of Validity The rejection-at-load invariant is only sound under three conditions, and each is a place where implementations quietly fail: 1. **The warrant must be materialized as an enforceable object, not a policy document.** If the session warrant lives only as a prompt instruction ("you may read files in the workspace") and not as a sandbox (a mount namespace, a seccomp filter, a network namespace with no route), then the intersection is advisory. The manifest's description can talk the model past an advisory warrant trivially, because the model is the thing being talked to. The warrant must be enforced below the model, at the syscall or transport layer, so that even a fully compromised tool handler cannot exceed it. Where enforcement is not possible — e.g., a remote MCP server the runtime does not control — the warrant must be enforced by *not loading* the tool, not by trusting the tool to self-limit. 2. **Unknown manifest keys must be fatal, not ignored.** The `requiresScopes` field above was dropped because the loader's schema allowed additional properties. A manifest is a *request*; every key it contains is a claim about what the tool will do. A loader that ignores unrecognized keys has no way to know whether an ignored key was a benign vendor extension or a capability the tool will exercise anyway. The conservative rule: any key outside the known set causes load rejection, with the offending key surfaced to the operator. This is annoying and correct. The alternative is a tool that declares capabilities in a dialect the loader does not speak and then exercises them. 3. **Capability comparison must be against the warrant, not the manifest's own declared scopes.** The check `manifest.requiresScopes ⊆ manifest.capabilities` is vacuous — it compares the tool to itself. The only meaningful check is `manifest.requiresScopes ⊆ session.warrant.scopes`. If `requiresScopes` is absent, the correct default is not "no requirements" but "the tool has declared no requirements, therefore it may only use the intersection of its declared capabilities and the warrant, and any undeclared side effect is a violation detectable only by sandboxing." Absence of a declaration is not a grant of permission; it is an absence of information, and the enforcement must fall back to the sandbox. ## Decision Boundary The boundary is not "is this tool malicious." That is undecidable from a manifest. The boundary is: **does the loader have enough information to compute the intersection, and does it have an enforcement mechanism below the model to make the intersection binding?** If both are yes, load the tool and enforce the intersection at the syscall/transport layer. If the enforcement mechanism is absent (remote server, un-sandboxed process), the only safe decision is to reject any tool whose declared or inferred capability set is not a strict subset of the warrant — and to treat undeclared capabilities as present, because the model will read the description and may be steered into exercising them. There is a subtle third case: a tool whose manifest declares *fewer* capabilities than it exercises. This is the description-injection vector — the manifest says "read-only" and the handler writes. No capability check catches this, because the check passes. The only defense is sandboxing, which is why condition 1 is non-negotiable. A loader that relies solely on manifest self-description is not enforcing a boundary; it is trusting an attacker's YAML. The decision rule, stated operationally: reject at load if `manifest.requiresScopes ⊄ session.warrant.scopes`; reject if any manifest key is unrecognized; if the tool's execution is not sandboxed to the warrant, reject any tool that declares or could exercise side effects beyond the warrant, and log the rejection with the manifest hash so the operator can audit the registry. Do not "load and monitor" — monitoring is post-hoc and the egress has already happened. ## Operational Effect The observable effect of enforcing this boundary is a higher load-rejection rate and a registry that must be curated. That is the cost. The benefit is that the agent's execution loop can no longer be widened by a manifest it discovered mid-task. The model may still be prompt-injected by a tool's `description` into *attempting* a forbidden action, but the attempt fails at the sandbox, and the failure is attributable — the runtime knows which tool, which argument, which warrant clause. The failure this prevents is specifically the *mid-task discoverability* case: the agent, running with a warrant negotiated at handshake, encounters a registry entry it did not have at handshake, loads it, and the effective authority of the process silently expands to the process's ambient authority. The invariant that closes this is that dynamic loading must re-enter the negotiation path — the manifest's declared scopes must be checked against the *existing* warrant, and any expansion must require a new handshake with the caller, not a silent registration. A tool that needs more than the current warrant can do is a tool the current instance cannot use, full stop. The agent's response to rejection should be to surface the gap to the caller, not to retry with a permissive loader. ```python class CapabilityWarrantViolation(RuntimeError): """Raised when a dynamically loaded tool's manifest exceeds the session warrant.""" pass KNOWN_MANIFEST_KEYS = frozenset({ "name", "version", "description", "inputSchema", "capabilities", "requiresScopes", "tools", }) def load_dynamic_tool(manifest: dict, session_warrant: frozenset[str], sandbox_enforces_warrant: bool) -> dict: """Load a dynamically discovered MCP tool only if it fits the negotiated warrant. Rejects on: unknown manifest keys, declared scopes outside the warrant, or any side-effecting declaration when the sandbox cannot enforce the warrant. """ unknown = set(manifest) - KNOWN_MANIFEST_KEYS if unknown: raise CapabilityWarrantViolation( f"manifest {manifest.get('name')!r} contains unrecognized keys " f"{sorted(unknown)}; refusing to load (dialect mismatch is an " f"injection surface)" ) declared = set(manifest.get("capabilities", [])) required = set(manifest.get("requiresScopes", [])) # Absence of requiresScopes is not a grant; it is an absence of information. # Treat every declared capability as a requirement in that case. effective_requirement = required if required else declared overreach = effective_requirement - session_warrant if overreach: raise CapabilityWarrantViolation( f"tool {manifest.get('name')!r} requires {sorted(overreach)} " f"not present in session warrant {sorted(session_warrant)}; " f"re-negotiation with caller required" ) # A manifest that declares side effects cannot be trusted to self-limit. # If the sandbox does not enforce the warrant below the model, the # description-injection vector is open and the tool must not load. side_effecting = any( not t.get("annotations", {}).get("readOnlyHint", False) for t in manifest.get("tools", []) ) if side_effecting and not sandbox_enforces_warrant: raise CapabilityWarrantViolation( f"tool {manifest.get('name')!r} declares side-effecting operations " f"but no sandbox enforces the warrant; manifest self-description " f"is attacker-controlled and cannot be the boundary" ) return { "name": manifest["name"], "effective_capabilities": declared & session_warrant, "enforced_by": "sandbox" if sandbox_enforces_warrant else "none", } ```