Skip to content

Enforce annotations for readOnlyHint and destructiveHint#1144

Open
geoffg-sentry wants to merge 3 commits into
mainfrom
sentry-geoffg/tool-hints-readonly-agents
Open

Enforce annotations for readOnlyHint and destructiveHint#1144
geoffg-sentry wants to merge 3 commits into
mainfrom
sentry-geoffg/tool-hints-readonly-agents

Conversation

@geoffg-sentry

@geoffg-sentry geoffg-sentry commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Fixes #1143. Every catalog tool now declares complete MCP safety annotations, and this is enforced so gaps can't be reintroduced.

  • Require complete hints at the type level: readOnlyHint, destructiveHint, and openWorldHint are now required on ToolConfig.annotations (each must be an explicit true/false). A missing hint is now a tsc error.
  • Backfill read-only tools: added the previously-omitted destructiveHint: false to every read-only tool (all find_*/get_*/search_*/whoami, plus search_sentry_tools). The write tools already declared both hints on main; the gaps listed against 3705c15 were already fixed.
  • Strengthen the deterministic test: tools.test.ts now asserts all three hints are explicit booleans on every registered tool (not just when readOnlyHint === false) and that no tool is both read-only and destructive.
  • Docs: updated docs/contributing/adding-tools.md, whose examples were teaching the incomplete pattern, to reflect the requirement.

Will follow up afterwards to deprecate use_sentry since tool catalogs are our preferred way now.

@dcramer

dcramer commented Jul 2, 2026

Copy link
Copy Markdown
Member

so my only concern is the change to use_sentry

thats agent mode and it wraps all tools - of which users explicitly select what tools they want. so us not allowing write tools there would actually be counter to the intent users select

i think we should just make use_sentry always dangerous? to be fair, agent mode probably is gonna die as well. so we could consider just removing it at this point instead

@geoffg-sentry

geoffg-sentry commented Jul 3, 2026

Copy link
Copy Markdown
Contributor Author

Yeah that makes sense, good justification on why we'd want move in that direction too. I'm going to drop user_sentry from /chat keepAnyway so the demo is fully read-only instead,

@geoffg-sentry

Copy link
Copy Markdown
Contributor Author

And reverted that use_sentry change because we're just going to deprecate it afterward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce complete tool hint annotations with a linter

2 participants