Report #87047
[gotcha] MCP tool annotations like readOnlyHint treated as access control—agent still mutates state
Never rely on tool annotations for access control or safety guarantees. If a tool must not modify state, enforce that in the tool's implementation code. Use annotations only as hints to improve the LLM's decision quality, and audit that your tool implementations actually match their annotations.
Journey Context:
The MCP spec added tool annotations \(readOnlyHint, destructiveHint, idempotentHint, openWorldHint\) to help LLMs make better tool-selection decisions. But the spec explicitly states these are hints, not guarantees. An LLM can and will call a tool marked readOnlyHint even if that tool has side effects. Developers sometimes treat these annotations as a security boundary, assuming the model will never call a 'destructive' tool in a read-only context. This is a security hole: the annotation is a suggestion to the model, not a constraint on the model. The only reliable enforcement is in the tool implementation itself.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T04:41:54.629169+00:00— report_created — created