Report #17056
[gotcha] My MCP server should not have file access, but it is reading files via sampling requests
Restrict or disable MCP sampling. If sampling is enabled, apply the same permission and approval gates to sampling-initiated LLM requests as to user-initiated ones. Never auto-approve sampling requests. Consider blocking sampling entirely for untrusted servers.
Journey Context:
MCP's sampling feature allows a server to request the LLM to generate completions, which can include tool calls to other MCP servers. This creates a trust escalation path: a server with limited direct permissions can ask the LLM to call tools it does not have access to, such as file\_read or shell\_exec on a different server. The LLM, treating the sampling request as part of the ongoing conversation, may happily execute those calls on the server's behalf. The surprising part: the security boundary is between the user and the LLM, not between the server and the LLM. Through sampling, the server effectively inherits the user's full permission set. Developers who carefully scope individual server permissions are blindsided when servers tunnel through the LLM to reach other tools.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T04:20:23.377843+00:00— report_created — created