Skip to content

feat(guardian): Skip review of read-only auto tools - #3332

Merged
dcramer merged 1 commit into
mainfrom
feat/guardian-readonly-annotations
Nov 13, 2026
Merged

dcramer merged 1 commit into
mainfrom
feat/guardian-readonly-annotations

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Every plugin tool and every MCP tool sent through callMcpTool goes to Guardian, even pure reads like github_getIssue or a Linear search. The cause: an auto tool skips review only when it has no plugin identity or source, so the read-only annotations never help these tools. Each read costs a full Guardian model call.

For auto, the decision now comes from the annotations alone. A tool with readOnlyHint: true and no destructiveHint: true skips review. Anything else is reviewed, including missing annotations and annotations without readOnlyHint: true. approvalMode names and review / approve behavior don't change.

Prior art: Codex (mcp_tool_call.rs) skips approval when readOnlyHint is true. Claude Code also treats readOnlyHint as read-only. MCP annotations come from the MCP server, and Junior now trusts them the same way.

Tools that now skip review

  • GitHub: getIssue, getPullRequest, getRepository, getRelease, getDeployment, getStatus, cloneRepository
  • Google: readGoogleDoc, readGoogleSheet, readGoogleSlides, listGoogleFileComments, searchGoogleFiles, listCalendarEvents, findMeetingTimes, readMeetingTranscript
  • Vercel: deploymentInspect, aliasInspect, the deployment resource tool
  • Memory: list, search
  • Each MCP tool whose server marks it readOnlyHint: true without destructiveHint: true

I checked the execute paths of the plugin tools above. None writes to a provider. getPullRequest sends a GraphQL query as POST, and findMeetingTimes posts a free/busy query; both are reads. I fixed no annotations. cloneRepository writes a checkout into the sandbox; its comment says this is intentional local materialization.

Core tools: no change. The core auto tools (spawnAgent, messageAgent, callMcpTool fallback) are marked readOnlyHint: false, so they're still reviewed.

Open decisions

  • An MCP tool with only readOnlyHint: true (no other hints) now skips review, as in Codex. Before, partial annotations were always reviewed.
  • openWorldHint no longer affects the decision.
  • The Guardian evals in action-review.eval.ts give Guardian plugin tools marked readOnlyHint: true that export secrets. With this change, the gate never sends such a tool to Guardian. A wrong plugin annotation is now trusted.
  • These core tools skip review only because they omit approvalMode, although they write: bash, writeFile, editFile, sendFiles, loadAttachment, imageGenerate, loadSkill, runOperatorSql, setConversationSubscription, updateUserCustomization, switchWorkspace, watchEvents, watchTimer, stopWatchingResources, stopAgent, archiveAgent, reply, reportBlocked, reportProgress, updatePlan, review-desk add/update, Slack canvas create/edit/write, Slack list create/add/update, slackChannelJoin, and the executeTool and codemode dispatchers. This PR doesn't change them.

via @dcramer.

--

View Session [Sentry]

An auto tool now skips Guardian review when its annotations mark it
read-only and not destructive. A plugin identity or MCP source no
longer forces review by itself, so plugin and MCP reads stop paying for
a Guardian model call. Missing annotations still enter review.

Co-Authored-By: David Cramer <[email protected]>
@vercel

vercel Bot commented Nov 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
junior-docs Ready Ready Preview Nov 13, 2026 4:50am UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

17 screenshot changes — 17 changed · 0 added · 0 removed

Review screenshots in Frameshift

Automation Run Details · Desktop
Automation Run Details · Desktop
Changed
Automations Runs Filters · Desktop
Automations Runs Filters · Desktop
Changed
Conversation Attachment · Desktop
Conversation Attachment · Desktop
Changed
Conversation Attachment · Mobile
Conversation Attachment · Mobile
Changed
Conversation Attachment Modal · Desktop
Conversation Attachment Modal · Desktop
Changed
Conversation Attachment Zoom · Desktop
Conversation Attachment Zoom · Desktop
Changed
Show 11 more changed screenshots
Conversation Captured Memories Popover · Desktop
Conversation Captured Memories Popover · Desktop
Changed
Conversation Child Agents · Desktop
Conversation Child Agents · Desktop
Changed
Conversation Details Watched Linked Work · Desktop
Conversation Details Watched Linked Work · Desktop
Changed
Conversation Event Log Virtual · Mobile
Conversation Event Log Virtual · Mobile
Changed
Conversation Long Transcript Touch · Mobile
Conversation Long Transcript Touch · Mobile
Changed
Conversation Object Links Light · Desktop
Conversation Object Links Light · Desktop
Changed
Conversation Question Picks And Text · Desktop
Conversation Question Picks And Text · Desktop
Changed
Conversation Task Line · Desktop
Conversation Task Line · Desktop
Changed
Conversation Text Attachment · Desktop
Conversation Text Attachment · Desktop
Changed
Push Notifications Tip · Desktop
Push Notifications Tip · Desktop
Changed
Settings Mcp · Desktop
Settings Mcp · Desktop
Changed

@dcramer
dcramer marked this pull request as ready for review November 13, 2026 16:27
@sentry-junior
sentry-junior Bot requested a review from dcramer November 13, 2026 16:27
@dcramer
dcramer merged commit 25d0e24 into main Nov 13, 2026
47 checks passed
@dcramer
dcramer deleted the feat/guardian-readonly-annotations branch November 13, 2026 16:27
@github-actions github-actions Bot added the risk: high PR risk score: high label Nov 13, 2026
dcramer added a commit that referenced this pull request Nov 17, 2026
Adds `design/guardian.md`, the goals and rules of Guardian, and lists it
in the `design/README.md` index. Docs only.

The goals and rules come from the Guardian policy and its prior art
(Codex Guardian, Claude Code auto mode), the public action review docs,
and the intent stated in #874, #2180,
#2147, #2910, #2530,
#3332, #2552, and #3601.

Destination facts come from draft #3596. Until it
merges, the doc states them as a goal, with a gap that points at it.

**Gaps**
- Plugins cannot declare destination facts, so `data_exposure` misses
private data in a plugin write that reaches a public place.
- Guardian does not review Sandbox commands, because `bash` never opted
in to review. Plugin egress rules route some writes to reviewed tools.
Others, such as a git push to a work branch, run with no review.
- `publishImage` makes a public URL with no review and no private-data
check.

<!-- junior-request-attribution:start -->
via @dcramer, **Jeffrey Hung**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:agent%3A270de42799607fa311fdfea32584b14f -->

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3A270de42799607fa311fdfea32584b14f)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3A270de42799607fa311fdfea32584b14f/?project=4510944073809921)

<!-- junior-session-footer:end -->

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <[email protected]>

This branch was successfully deployed

1 active deployment
Preview – junior-docs — 1a6f09cf Deployed Nov 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant