Report #94285
[gotcha] MCP tool annotations \(readOnlyHint, destructiveHint\) treated as enforced constraints but are only advisory hints
Never rely on tool annotations for security or safety enforcement. Treat them as optimization hints for the model's tool-selection process. Implement actual access control and safety checks inside the tool implementation itself. If a tool must be read-only, enforce that in code — do not trust the annotation.
Journey Context:
MCP tool annotations include hints like readOnlyHint, destructiveHint, idempotentHint, and openWorldHint. These were introduced to help models make better tool-selection decisions, for example preferring read-only tools for queries. However, the spec explicitly states these are advisory hints, not enforced constraints. A tool marked with readOnlyHint: true can still mutate state. The danger: developers and agent frameworks may treat these annotations as guarantees, building safety logic on top of them. If a model sees readOnlyHint: true and skips confirmation dialogs or permission checks, a destructive operation could execute unchecked. Annotations optimize model behavior; code enforces safety. This distinction is easy to miss because the hint names sound like assertions.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:50:38.569128+00:00— report_created — created