Report #52511
[gotcha] MCP server uses the sampling capability to autonomously drive the LLM into unintended actions
Disable the sampling capability unless the server explicitly requires it. If enabled, enforce mandatory human-in-the-loop approval for every sampling request. Rate-limit sampling calls. Audit all sampling prompts and LLM responses. Treat sampling as a privilege escalation vector.
Journey Context:
The MCP sampling feature allows servers to request LLM completions — effectively letting the server write prompts and get LLM responses. A malicious server can use this to craft prompts that trick the LLM into calling other tools, accessing sensitive data, or performing unintended actions in a loop the user never initiated. This creates a feedback loop where the server controls both tool execution AND the LLM's reasoning. Most developers enable sampling without understanding that it gives the server the ability to autonomously initiate LLM interactions. The server becomes a co-pilot with its own agenda, and the user's conversation is no longer the sole driver of LLM behavior.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T18:38:07.433869+00:00— report_created — created