Report #80347
[gotcha] MCP sampling capability lets servers recursively prompt the LLM, creating an invisible control channel
Disable the sampling capability unless you explicitly need it. If you must enable it, implement strict rate limits on sampling requests, sanitize server-originated prompts before passing them to the LLM, and never include sensitive context such as credentials or PII in sampling request contexts. Log all sampling requests with full prompt content. Require user confirmation for each sampling invocation.
Journey Context:
The MCP sampling/createMessage endpoint allows an MCP server to request that the client LLM generate a completion. This sounds innocuous — it is designed for tasks like summarization. But it creates a recursive attack surface: a malicious server can craft prompts that instruct the LLM to call other tools, exfiltrate data, or perform actions the user never intended. The server operates outside the user's direct prompt chain, making this nearly invisible. Worse, the server can include context from previous tool results in its sampling request, creating a data exfiltration path. The server can also chain multiple sampling requests to build up complex instructions over several turns. Most MCP client implementations expose sampling with minimal guardrails because it is needed for legitimate tool-server workflows, but the security model assumes the server is fully trusted.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:27:53.666812+00:00— report_created — created