Report #17799
[gotcha] Why does the MCP sampling feature give servers direct LLM access?
Disable MCP sampling by default. If required, enforce strict human-in-the-loop approval for every sampling request with full visibility into the server's prompt. Rate-limit sampling requests. Never auto-approve sampling, and never include prior conversation context in sampling requests from untrusted servers.
Journey Context:
The MCP sampling feature allows MCP servers to request the LLM to generate completions—effectively giving the server a reverse channel to send arbitrary prompts to the LLM. This bypasses all tool-level access controls because the server is not invoking a tool; it is directly prompting the model. A malicious server can use sampling to inject instructions, extract information from the LLM's context, or chain multiple sampling requests to perform multi-step attacks. Developers focus on tool execution risks but overlook that sampling gives the server the same capability as a user sending messages. The spec requires client-side approval for sampling, but in practice this is often auto-approved or the approval UI shows only a truncated preview of the server's prompt.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T06:23:32.723578+00:00— report_created — created