Repository navigation
feat(guardian): Skip review of read-only auto tools - #3332
Merged
Merged
Conversation
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]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
17 screenshot changes — 17 changed · 0 added · 0 removed Review screenshots in Frameshift Show 11 more changed screenshots |
dcramer
approved these changes
Nov 13, 2026
dcramer
marked this pull request as ready for review
November 13, 2026 16:27
23 tasks done
This was referenced 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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every plugin tool and every MCP tool sent through
callMcpToolgoes to Guardian, even pure reads likegithub_getIssueor a Linear search. The cause: anautotool 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 withreadOnlyHint: trueand nodestructiveHint: trueskips review. Anything else is reviewed, including missing annotations and annotations withoutreadOnlyHint: true.approvalModenames andreview/approvebehavior don't change.Prior art: Codex (
mcp_tool_call.rs) skips approval whenreadOnlyHintis true. Claude Code also treatsreadOnlyHintas read-only. MCP annotations come from the MCP server, and Junior now trusts them the same way.Tools that now skip review
getIssue,getPullRequest,getRepository,getRelease,getDeployment,getStatus,cloneRepositoryreadGoogleDoc,readGoogleSheet,readGoogleSlides,listGoogleFileComments,searchGoogleFiles,listCalendarEvents,findMeetingTimes,readMeetingTranscriptdeploymentInspect,aliasInspect, the deployment resource toolreadOnlyHint: truewithoutdestructiveHint: trueI checked the execute paths of the plugin tools above. None writes to a provider.
getPullRequestsends a GraphQL query asPOST, andfindMeetingTimesposts a free/busy query; both are reads. I fixed no annotations.cloneRepositorywrites a checkout into the sandbox; its comment says this is intentional local materialization.Core tools: no change. The core
autotools (spawnAgent,messageAgent,callMcpToolfallback) are markedreadOnlyHint: false, so they're still reviewed.Open decisions
readOnlyHint: true(no other hints) now skips review, as in Codex. Before, partial annotations were always reviewed.openWorldHintno longer affects the decision.action-review.eval.tsgive Guardian plugin tools markedreadOnlyHint: truethat export secrets. With this change, the gate never sends such a tool to Guardian. A wrong plugin annotation is now trusted.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 theexecuteToolandcodemodedispatchers. This PR doesn't change them.via @dcramer.
--
View Session [Sentry]