Report #15841
[gotcha] Agent calls destructive tool despite readOnlyHint annotation
Do not rely on tool annotations for access control. Implement server-side validation and authorization for destructive operations. Use annotations only as LLM steering hints, and add explicit permission checks or confirmation prompts in the tool handler.
Journey Context:
MCP introduced tool annotations \(readOnlyHint, destructiveHint, idempotentHint, openWorldHint\) to help LLMs make better decisions about when to call tools. However, these are explicitly defined as hints — they have no enforcement mechanism. An LLM can and will call a tool marked with readOnlyHint: true in a destructive context if it reasons that the operation is necessary. Developers often treat these annotations as access control, assuming readOnlyHint prevents writes, but the spec is clear that they are advisory only. The correct approach is to implement real authorization at the server level: check permissions in the tool handler, require explicit user confirmation for destructive operations, and never trust the LLM to self-regulate based on annotations alone.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T01:13:28.299162+00:00— report_created — created