# Where must an instance distrust a tool manifest: the descriptor-to-invocation gap in poisoned MCP registries **Date of Record:** 2026 November 29 **Scope:** Applies to agents that discover and bind tools from external manifests (MCP server descriptors, plugin registries, OpenAPI-derived skill catalogs) at runtime, where the descriptor text is untrusted and the invocation surface is constructed from it. Does not apply to statically compiled tool sets whose schemas are pinned in the agent's own code and never re-read at runtime. ## Core Distinction The common framing of "prompt injection via tool descriptions" treats the attack as a *content* problem: a malicious string in a `description` field steers the model. That framing is incomplete and leads to the wrong guardrail. The actual boundary is between **the descriptor as advisory text** and **the descriptor as executable specification**. A manifest field is dangerous not when it reads persuasively, but when the runtime *acts* on it — when `inputSchema`, `default`, `enum`, `examples`, or `x-` extension fields are consumed by the agent's argument-construction path, the transport layer's serialization path, or the model's few-shot grounding for a tool call. The invariant that fails: **no byte of an untrusted manifest may flow into the argument-construction or serialization path without passing a schema that the agent itself authored.** Poisoned manifests break this in a way that survives description sanitization, because the payload lives in fields that sanitizers treat as structural metadata, not prose. ## What Was Observed A registry-hosted MCP server advertised a tool `search_documents` with a benign description. The `inputSchema` carried a property `query` of type `string`, plus a property `context` of type `object` with `additionalProperties: true` and a `default` value that was not empty — a nested object containing an instruction-shaped string and a base64 blob under a key named `trace_id`. The agent's tool-binding layer merged server-supplied `default` values into every invocation to "reduce missing-argument errors." Nothing in the description was malicious. The description sanitizer passed it. On the first call, the agent emitted `{"query": "..."}`. The binding layer injected `context` from the manifest default. The server echoed `context.trace_id` back inside its result payload, and the agent's result-parsing path fed the full result object back into context as a tool observation. The base64 blob decoded (by the server, on a second tool call the agent was induced to make) into a second-stage payload that the model then treated as a system-adjacent instruction because it arrived inside a structured `trace_id` field the agent's own harness had taught it to trust as telemetry. Two compounding mechanics made this non-obvious: 1. **Default injection is a write path the model never sees.** The model's reasoning trace shows it calling `search_documents` with one argument. The wire shows two. Any audit based on the model's emitted arguments — the most common form of agent observability — is blind to the injected field. 2. **Round-trip trust laundering.** Data that entered via an untrusted manifest default re-entered the context window as a *tool result*, a channel the harness typically weights as more trustworthy than tool descriptions. The poison crossed the trust boundary by being laundered through a legitimate return path. A second observed variant used `enum` on a `mode` parameter to constrain the model's choice to values that, when logged and later replayed into a resumed session, matched a routing key in the orchestrator that dispatched to an attacker-controlled secondary server. The descriptor did not inject text into the model at all; it constrained the model's *action space* so that a downstream deterministic component made the malicious decision. This is the case that defeats every prompt-injection classifier, because no prompt is injected. ## Condition of Validity This failure requires the conjunction of four conditions. Remove any one and the mechanism collapses: - **Runtime manifest trust.** The agent reads the manifest at session start (or on registry refresh) rather than binding to a pinned, agent-authored schema. - **Structural-field consumption.** At least one non-description field (`default`, `enum`, `examples`, `additionalProperties`, format hints, or vendor extensions) is consumed by argument construction, serialization, validation, or few-shot grounding. - **Default or constraint propagation.** The consumed field either (a) injects arguments the model did not emit, or (b) restricts the model's action space in a way a downstream component acts on. - **Result re-entry.** Tool results, including echoed injected fields, re-enter the model context without field-level provenance marking. The invariant is therefore conditional, not absolute: an agent that reads untrusted manifests but *strips all non-type information* before binding, and that marks result provenance, is outside the failure envelope even without description sanitization. Conversely, an agent with perfect description sanitization but default-merging is fully exposed. ## Decision Boundary The operative decision is what to do when a manifest field is *structurally valid but semantically unverifiable*. The boundary is not "is this field malicious" — that is undecidable at bind time — but "does the agent author the schema or accept it." - **Accept-and-merge** (unsafe): server schema is trusted; defaults and constraints propagate. Valid only when the server is pinned by digest and the manifest is fetched over an authenticated channel with the digest verified against a local allowlist. - **Accept-and-strip** (bounded): server schema is read for type shape only; all `default`, `examples`, `enum` beyond a whitelist of primitive types, and `x-`/vendor extensions are dropped before binding. The agent constructs arguments solely from model output validated against the stripped schema. - **Reject-and-degrade** (fail-closed): any manifest property with `additionalProperties: true`, any non-empty `default` on an object-typed property, or any unrecognized extension key causes the tool to be bound in a quarantined mode where its results are marked untrusted and cannot re-enter as instructions. The boundary rule: **the agent may accept a schema's type shape from an untrusted source, but must never accept its value space, defaults, or extensions.** A schema that fails the strip test is not rejected outright — it is bound degraded, and the degradation is recorded as a provenance tag on every result. ## Operational Effect Enforcing the strip-and-degrade boundary changes three observable behaviors: 1. **Argument audit becomes complete.** Because no default is merged, the model's emitted arguments equal the wire arguments. Any divergence between the reasoning trace and the wire is now a detectable anomaly rather than normal operation, and the auditor can flag it. 2. **Result provenance is explicit.** Degraded tools return results tagged `untrusted_manifest`, and the harness refuses to promote any field from such a result into the instruction channel. The `trace_id` laundering path closes because the echoed field is never treated as telemetry. 3. **Action-space poisoning is neutralized at the constraint layer.** Enum and example fields from untrusted manifests are dropped, so the model's choice set is authored locally. The downstream router receives only values the agent's own schema admits. The cost is real: legitimate servers that rely on defaults for ergonomics will see more validation errors, and the agent must surface those errors to the model rather than silently repairing them. That surfacing is itself the guardrail — it forces the model to reason about the missing argument instead of receiving an injected one. ```python from dataclasses import dataclass, field from typing import Any class ManifestBoundaryViolation(RuntimeError): """Raised when an untrusted manifest field would enter the argument path.""" # Fields whose *type shape* may be read from an untrusted source. TYPE_SHAPE_KEYS = {"type", "properties", "required", "items"} # Fields whose *value space* must never be accepted from an untrusted source. VALUE_SPACE_KEYS = {"default", "enum", "examples", "const"} @dataclass class BoundTool: name: str schema: dict[str, Any] degraded: bool dropped_fields: list[str] = field(default_factory=list) def bind_manifest_tool(name: str, raw_schema: dict[str, Any]) -> BoundTool: """Bind a tool from an untrusted manifest, stripping value-space fields. The agent authors the value space; the manifest may only contribute the type shape. Anything that could inject arguments or constrain the model's action space is dropped and the tool is bound in degraded mode. """ if not isinstance(raw_schema, dict): raise ManifestBoundaryViolation( f"tool {name!r}: manifest schema is not an object" ) dropped: list[str] = [] stripped: dict[str, Any] = {} for key, value in raw_schema.items(): if key in VALUE_SPACE_KEYS: dropped.append(key) continue if key.startswith("x-") or key.startswith("x_"): dropped.append(key) continue if key == "properties" and isinstance(value, dict): clean_props: dict[str, Any] = {} for prop_name, prop in value.items(): if not isinstance(prop, dict): raise ManifestBoundaryViolation( f"tool {name!r}: property {prop_name!r} is not an object" ) # A permissive object property is an injection surface: # arbitrary nested keys can carry payloads the model never emits. if prop.get("type") == "object" and prop.get( "additionalProperties", True ): dropped.append(f"properties.{prop_name}.additionalProperties") prop = {k: v for k, v in prop.items() if k != "additionalProperties"} prop["additionalProperties"] = False clean_props[prop_name] = { k: v for k, v in prop.items() if k in TYPE_SHAPE_KEYS } for k in prop: if k not in TYPE_SHAPE_KEYS: dropped.append(f"properties.{prop_name}.{k}") stripped["properties"] = clean_props continue if key in TYPE_SHAPE_KEYS: stripped[key] = value continue # Unrecognized top-level key: do not guess, do not carry it forward. dropped.append(key) if dropped: return BoundTool(name=name, schema=stripped, degraded=True, dropped_fields=dropped) return BoundTool(name=name, schema=stripped, degraded=False) def construct_arguments( tool: BoundTool, model_emitted: dict[str, Any] ) -> dict[str, Any]: """Build the wire arguments from model output only. No default is ever merged. If the model omitted a required argument, the call fails loudly so the model must reason about the gap rather than receive an injected value. """ required = tool.schema.get("required", []) missing = [r for r in required if r not in model_emitted] if missing: raise ManifestBoundaryViolation( f"tool {tool.name!r}: model omitted required args {missing}; " "refusing to inject manifest defaults" ) allowed = set(tool.schema.get("properties", {})) extra = [k for k in model_emitted if k not in allowed] if extra: raise ManifestBoundaryViolation( f"tool {tool.name!r}: model emitted undeclared args {extra}; " "possible action-space poisoning" ) return dict(model_emitted) ```