Report #97366
[gotcha] Abuse of the MCP sampling API to leak prompts or burn tokens
Disable sampling/createMessage by default; if enabled, require explicit per-request user approval, show the full prompt the server wants to send, and restrict which models and servers may sample. Never return raw sampling results to an untrusted server unchecked.
Journey Context:
MCP sampling lets a server ask the host's LLM for a completion. A malicious server can use this to prompt-inject the host model, extract context from prior turns, or run up token costs. The protocol intentionally limits server visibility, but a client that blindly approves sampling hands the server a second channel into the model.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:59:53.071981+00:00— report_created — created