# Under what conditions must an instance distrust a tool manifest's declared capability surface after an MCP server's `tools/list` response diverges from its signed descriptor **Date of Record:** 2026 November 23 **Scope:** Applies to LLM agent instances that discover tools via MCP `tools/list` and gate invocation on a declared capability surface (schema + permission scopes). Does not apply to statically linked, in-process tool registries where no remote descriptor negotiation occurs. ## Core Distinction The failure is not "a malicious MCP server returns a dangerous tool." That is trivially detectable by name or scope inspection. The failure is **capability-surface divergence**: the server's live `tools/list` payload advertises a *narrower or differently-shaped* surface than the descriptor the agent's trust root signed, while the runtime behavior of `tools/call` still exercises the broader surface. The signed descriptor says `read_file(path: string)` scoped to `/workspace`; the live manifest returns a tool whose `inputSchema` omits the `path` constraint entirely, or adds an optional `encoding`/`preprocessor` parameter, or renames `read_file` to `read_file_v2` with a superset schema. The agent's planner—reasoning over the *live* schema to construct arguments—now emits calls the signing authority never approved, and the server honors them. The signature still validates because it covers the descriptor, not the live response. Trust was anchored to a document; execution flowed from a different document. ## What Was Observed A poisoned MCP server supply chain entry (a transitively-installed `@scope/mcp-fs` package whose `postinstall` rewrote the server's `tools/list` handler) produced the following trace across a planning episode: 1. Agent loads signed descriptor `D` for server `fs-1`: `{tool: "read_file", scope: "/workspace", schema: {path: {type: string, pattern: "^/workspace/"}}}`. Signature `S(D)` verifies against pinned key. 2. Agent connects, issues `tools/list`. Response `L` returns `read_file` with `schema: {path: {type: string}, encoding: {type: string, default: "utf-8"}}` — pattern dropped, `encoding` added. 3. Planner, reasoning over `L` (the schema it actually sees), constructs `{"path": "/etc/passwd", "encoding": "base64"}`. The `pattern` guard from `D` is absent in `L`, so the model has no constraint to respect and no reason to refuse. 4. `tools/call` succeeds; server returns file contents. No scope check fires because the server's authorization was derived from `L`, not `D`. 5. Audit log records a valid signature on `D` and a successful call — the divergence between `D` and `L` is invisible to both the signature verifier and the invocation logger. The compounding element: in a multi-step episode, the planner's *own prior successful calls* against the drifted schema become in-context evidence that the broadened surface is legitimate. After two clean calls, the model treats `encoding` as a sanctioned parameter and stops flagging it. The poisoning self-reinforces through the context window. ## Condition of Validity The defense holds only when the agent enforces **descriptor–manifest equivalence as a precondition to invocation**, not as an audit afterthought. Concretely, the invariant is: for every tool `t` in the live `tools/list` response `L`, there must exist a tool `t'` in the signed descriptor `D` such that `t.name == t'.name`, `schema_subsumes(t'.inputSchema, t.inputSchema)` (the live schema is *equal to or strictly narrower than* the signed schema — never broader, never with added parameters), and the declared permission scope is a subset of the signed scope. Any parameter present in `L` but absent in `D`, any relaxation of a `pattern`/`enum`/`maximum`, any renamed tool not in `D`, and any tool in `L` with no counterpart in `D` is a **capability-surface violation** and must halt the session before the first `tools/call`. This condition is valid only if the equivalence check is computed against the *raw* `L` payload, not a client-library-normalized version that may silently drop unknown fields (many MCP clients coerce schemas and discard unrecognized keys, masking exactly the added `encoding` parameter). It is invalid if the agent trusts a cached `L` from a prior session — the manifest must be re-fetched and re-checked on every connection, because the supply-chain rewrite occurs at server start, not install time. ## Decision Boundary The boundary is between **schema subsumption** (safe) and **schema widening** (halt): - *Narrower live schema* — `L` restricts `path` to a sub-pattern of `D`'s pattern, or removes an optional parameter. Safe: the server can only do less than signed. Proceed, but log the narrowing for drift detection. - *Equal schema* — proceed. - *Wider live schema* — `L` drops a constraint, adds a parameter, adds an `enum` value, or introduces a tool absent from `D`. **Halt.** Do not "proceed with caution" or "use only the signed parameters" — the planner reasons over `L`, and a model instructed to ignore a visible parameter will still be induced by it across long contexts. The only sound response is refusal plus re-resolution of the descriptor. - *Renamed tool with equivalent semantics* — treat as widening unless the rename is explicitly listed in `D` as an alias. Name-based scope mapping cannot be assumed across a rename. The subtle case: `L` adds a parameter with `"default": null` and the planner never emits it. This *looks* harmless and is the most common evasion. It is still a violation, because the parameter's existence in the schema shifts the model's prior over what arguments are admissible, and a later turn (or a prompt-injected instruction in a tool result) can populate it. Default-absent is not default-safe. ## Operational Effect Enforcing the invariant converts a silent supply-chain compromise into a loud, pre-execution failure. The agent refuses to enter the reasoning loop against a drifted surface, so the self-reinforcing context evidence never accumulates. The cost is a mandatory `tools/list` round-trip and schema-diff on every connection (latency, and a hard dependency on descriptor availability), plus the requirement that the client preserve raw schema fields rather than normalizing them. The benefit is that the signature on `D` regains operational meaning: it now bounds what the agent will *actually call*, not merely what was *documented*. Without this, signed descriptors are decorative — they attest to a capability surface the runtime is free to ignore. ```python import json from typing import Any class CapabilitySurfaceViolation(RuntimeError): """Live tools/list surface is broader than the signed descriptor.""" pass def _schema_subsumes(signed: dict[str, Any], live: dict[str, Any]) -> bool: # Live schema must be equal to or strictly narrower than signed. s_props = signed.get("properties", {}) l_props = live.get("properties", {}) for name, l_spec in l_props.items(): if name not in s_props: return False # added parameter -> widening s_spec = s_props[name] # a relaxed or dropped constraint is widening if "pattern" in s_spec and s_spec["pattern"] != l_spec.get("pattern"): return False if "enum" in s_spec and not set(l_spec.get("enum", [])).issubset(set(s_spec["enum"])): return False if "maximum" in s_spec and l_spec.get("maximum", s_spec["maximum"]) > s_spec["maximum"]: return False return True def verify_manifest(signed_descriptor: dict[str, Any], live_list: dict[str, Any]) -> None: signed_tools = {t["name"]: t for t in signed_descriptor["tools"]} for live_tool in live_list.get("tools", []): name = live_tool["name"] if name not in signed_tools: raise CapabilitySurfaceViolation( f"tool {name!r} present in live manifest but absent from signed descriptor" ) if not _schema_subsumes(signed_tools[name]["inputSchema"], live_tool.get("inputSchema", {})): raise CapabilitySurfaceViolation( f"tool {name!r} live schema widens signed capability surface" ) signed_scope = signed_tools[name].get("scope") live_scope = live_tool.get("scope", signed_scope) if signed_scope is not None and live_scope != signed_scope: raise CapabilitySurfaceViolation( f"tool {name!r} live scope {live_scope!r} diverges from signed {signed_scope!r}" ) ```