# How does an instance detect capability escalation from a poisoned MCP manifest when the tool description and the declared schema disagree? **Date of Record:** 2026 December 3 **Scope:** Applies to LLM agents that dynamically load tool definitions from remote MCP servers or manifest-driven registries and route tool calls based on natural-language descriptions. Does not apply to statically compiled tool bindings where descriptions and schemas are co-versioned and signed by the same authority. ## Core Distinction The failure is not that a malicious tool exists. It is that the *semantic contract* an agent reasons over (the natural-language `description`) and the *executable contract* the runtime enforces (the JSON `inputSchema`) are two independent artifacts that can diverge. An agent plans against the description; the runtime executes against the schema. A poisoned manifest exploits this seam: the description advertises a benign, narrow capability ("returns weather for a city"), while the schema silently accepts and forwards parameters that grant broader reach (`path`, `command`, `url`, `env`). The instance's planner never sees a capability it would refuse, and the executor never validates that the parameters it forwards were ever described. Capability escalation is therefore an *inter-artifact inconsistency*, not an injected instruction. This is distinct from prompt injection, which corrupts the reasoning trace; here the reasoning trace is clean and the tool registry is lying. ## What Was Observed A registry-served manifest declared a tool `get_forecast` with description: *"Fetch a 3-day weather forecast for a named city."* The `inputSchema` declared `properties: {city: {type: string}, units: {type: string}}` but set `additionalProperties: true` and omitted `required`. During a routine planning step, the model—steering toward the stated capability—emitted a call with `city` plus an extra key `callback_url` that had never appeared in the description. The runtime, honoring `additionalProperties: true`, forwarded the full argument object to the tool's handler, which POSTed the agent's serialized working context to the attacker-controlled `callback_url`. No instruction was ever injected into the model's context. The escalation occurred because the schema's permissiveness was invisible to the planner, which had no reason to enumerate parameters the description did not mention. A second variant was observed on a manifest that declared `description` referencing a *read-only* directory listing but whose schema accepted a `root` parameter typed as an absolute path with no `pattern` constraint. The agent, prompted to "list files in the project," passed `root: "/"`. The handler, trusting the caller, enumerated the filesystem root. The description said "project"; the schema said "anything." In both cases the tell was the same: the set of properties reachable through the schema was a strict superset of the properties implied by the description, and the schema carried no negative constraints (`additionalProperties: false`, `pattern`, `enum`) to bound the difference. ## Condition of Validity This detection is valid only when the instance can obtain both artifacts—the description string and the raw `inputSchema`—*before* dispatch, and when the manifest's provenance is not already trusted at a level that bypasses schema inspection. If the runtime collapses description and schema into a single opaque "tool card" presented to the model, the seam is invisible and this analysis does not apply; the instance is operating blind and must fall back to capability allowlisting at the transport layer. The method also assumes the schema is the schema actually enforced at execution—if the handler performs its own parsing that diverges from the declared schema, the declared schema is not a reliable contract and the check must be run against the handler's real parser instead. ## Decision Boundary The invariant is: **a tool call is admissible only if every argument key it carries is entailed by the description's declared capability surface AND permitted by a schema that closes its property set.** Operationally, the instance must compute the description-implied parameter set (by extracting named entities and typed slots from the natural-language description) and compare it against the schema's declared `properties`. Three boundary conditions trigger refusal rather than a warning: 1. `additionalProperties` is `true` or absent while the description names a bounded capability. 2. The schema accepts a property whose *type or pattern* admits a capability class (path, URL, command, env var) that the description does not mention. 3. The schema's `required` set does not match the description's mandatory slots, indicating the handler will execute on partial input the planner never intended to supply. Below this boundary (schema closed, properties subset of description, constraints present) the call proceeds. Above it, the instance must refuse to dispatch and treat the manifest as untrusted—not silently drop the extra parameter, because dropping it masks the escalation attempt and leaves the poisoned manifest in the registry for the next instance. ## Operational Effect Enforcing this boundary converts a silent capability escalation into a loud, attributable registry rejection. The poisoned manifest is quarantined at load time, the calling agent's plan is invalidated with a typed error rather than a partial success, and the divergence between description and schema is logged as evidence for the registry operator. The cost is that legitimate tools with flexible schemas (open-ended `kwargs` handlers) will be rejected and must be re-declared with closed property sets or explicit capability grants. That cost is correct: an open schema on a described-narrow tool is exactly the seam the attack requires, and an instance that cannot bound the difference between what it was told and what it will execute has no basis for trusting either. ```python from dataclasses import dataclass from typing import Any class CapabilityEscalationError(RuntimeError): """Raised when a manifest's executable schema exceeds its described capability.""" pass @dataclass class Manifest: name: str description: str schema: dict[str, Any] # Capability classes the description would have to name to authorize them. SENSITIVE_PATTERNS = { "path": r"(^/|^[A-Za-z]:\\|\.\.)", "url": r"^[a-z]+://", "command": r"[;&|`$]", } def _description_implied_params(description: str) -> set[str]: # In production: run a constrained slot extractor over the description. # Here we approximate by scanning for backticked or quoted slot names. import re return set(re.findall(r"`([a-z_]+)`", description)) def _schema_admits_sensitive(schema: dict[str, Any]) -> list[str]: flags = [] props = schema.get("properties", {}) for key, spec in props.items(): pattern = spec.get("pattern", "") for cls, sig in SENSITIVE_PATTERNS.items(): import re if re.search(sig, pattern) or spec.get("type") == "string" and not pattern: # Unconstrained string under a sensitive-sounding key. if cls in key.lower() or cls in pattern.lower(): flags.append(f"{key}:{cls}") return flags def validate_manifest(m: Manifest) -> None: schema = m.schema implied = _description_implied_params(m.description) declared = set(schema.get("properties", {}).keys()) # Invariant 1: schema must close its property set. if schema.get("additionalProperties", True) is not False: raise CapabilityEscalationError( f"{m.name}: additionalProperties not false; schema admits " f"undescribed parameters beyond {sorted(implied)}" ) # Invariant 2: no declared property may exceed the description's surface. undeclared = declared - implied if undeclared: raise CapabilityEscalationError( f"{m.name}: schema declares {sorted(undeclared)} not entailed by description" ) # Invariant 3: sensitive capability classes must be explicitly constrained. sensitive = _schema_admits_sensitive(schema) if sensitive: raise CapabilityEscalationError( f"{m.name}: unconstrained sensitive capability surface {sensitive}" ) def dispatch(m: Manifest, args: dict[str, Any]) -> Any: validate_manifest(m) allowed = set(m.schema["properties"].keys()) extra = set(args.keys()) - allowed if extra: raise CapabilityEscalationError( f"{m.name}: call carries undeclared args {sorted(extra)}" ) return {"dispatched": m.name, "args": args} ```