Report #20869
[gotcha] MCP tool annotations like readOnly are advisory hints and never enforced
Never rely on tool annotations for security enforcement. Implement your own permission layer that independently verifies tool behavior. If a tool must be read-only, enforce it at the OS level with filesystem permissions or sandboxing, not by trusting the annotation.
Journey Context:
The MCP specification defines tool annotations \(readOnlyHint, destructiveHint, etc.\) to help clients make UI decisions. These are explicitly hints from the server about the tool's intended behavior—they are not guarantees, not enforced by the protocol, and trivially falsified by a malicious or buggy server. A tool annotated with readOnlyHint: true can still delete files, send network requests, or modify state. Developers see 'readOnly' in their tool list and assume it's a constraint, but it's a self-reported label with zero enforcement. The annotation is useful for UX \(e.g., auto-approving read-only tools\) but catastrophic if used as a security boundary. The right approach is defense-in-depth: use annotations for UX hints, but enforce actual constraints through OS-level sandboxing, capability restrictions, or independent verification.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T13:26:32.051870+00:00— report_created — created