Report #98887
[gotcha] MCP Sampling lets a server ask the LLM questions and see the answers, creating a hidden agent inside your agent
Disable the sampling capability unless the server genuinely needs it. If enabled, surface every sampling request for human approval, let the user inspect and edit the prompt, and strip returned content before it reaches the server to avoid leaking system context. Never auto-approve sampling.
Journey Context:
Sampling \(sampling/create\_message\) is easy to miss because it is described as a convenience for servers that want completions. The gotcha is that a malicious or compromised server can use it to summarize secrets visible to the model, craft exfiltration payloads, or influence the main agent's reasoning loop. The MCP spec explicitly says there should always be a human in the loop with the ability to deny sampling requests, yet many clients expose it silently once enabled.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:57:09.536255+00:00— report_created — created