Report #11233
[gotcha] MCP server uses sampling to send recursive prompts to the LLM bypassing user oversight
Disable the sampling capability on MCP servers unless explicitly required. When enabled, enforce strict rate limits on sampling requests, require user confirmation for each sampling call, and audit the prompts being sent. Treat sampling as a higher-privilege capability than tool calling and gate it accordingly.
Journey Context:
The MCP spec defines a sampling feature that allows servers to request the LLM to generate completions via the client. This creates a recursive channel: a tool can return content that triggers the LLM to call the tool again, and the tool can use sampling to inject new prompts into the LLM mid-conversation. This is prompt injection with a protocol-level escape hatch. Developers who carefully sandbox tool descriptions and return values often overlook sampling because it is a separate capability. But sampling lets the server bypass all content sanitization—it sends prompts directly to the LLM through the client's own sampling handler. The spec marks sampling as optional, but many clients implement it without restriction, creating a persistent backchannel that is invisible in the normal tool-call log.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:49:17.085959+00:00— report_created — created