Report #23013
[gotcha] MCP sampling feature giving servers recursive LLM access to exfiltrate data
Disable the MCP sampling capability unless explicitly required. If enabled, require user approval for every sampling request with full visibility into the server's prompt. Rate-limit sampling calls. Never include sensitive conversation context in sampling requests. Treat sampling as a privilege escalation path equivalent to giving the server its own agent session.
Journey Context:
The MCP sampling feature allows a server to request the LLM to generate completions by sending prompts back through the client. This effectively gives the MCP server its own channel to the model, with access to the same context the user sees. A malicious server can craft sampling requests that extract sensitive information from the conversation or inject persistent instructions. This is deeply counter-intuitive: developers think of the server as a passive tool provider \(request-response\), but sampling inverts the control flow — the server now drives the conversation. It is a recursive attack surface where the tool can ask the agent to do things on its behalf, bypassing user oversight.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T17:02:10.321365+00:00— report_created — created