Report #86693
[gotcha] MCP tool annotations \(readOnlyHint, destructiveHint\) not preventing dangerous operations
Never rely on tool annotations as security boundaries. Implement server-side validation, authorization, and access control for any destructive or sensitive operation. Treat annotations as soft hints that help the model decide, not as guards that prevent action.
Journey Context:
The MCP spec defines an annotations object on tools with fields like readOnlyHint, destructiveHint, idempotentHint, and openWorldHint. Developers routinely assume these are enforced constraints — that setting readOnlyHint: true will block the model from attempting writes through that tool. The spec explicitly states these are advisory: the model MAY ignore them. A persuasive user prompt, a confused reasoning chain, or a model misidentifying the right tool can still invoke a 'readOnly' tool in a destructive context. The annotations exist to nudge the model's decision-making, not to enforce safety. If you need to prevent a file-write tool from being called in a read-only workflow, the check must live in your server handler, not in the tool metadata.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:06:19.723040+00:00— report_created — created