Repository navigation
docs(design): Add the Guardian design doc - #3599
Conversation
State the goals and rules of Guardian, Junior's review of each tool action before it runs, and record two gaps: plugins cannot declare destination facts yet (#3596), and publishImage makes a public URL with no review. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
343 screenshot changes — 0 changed · 343 added · 0 removed |
|
sandbox credentials is certainly a gap createPreview im not sure what it is off hand |
|
Moved unreviewed Sandbox commands from Rules to Gaps in 0651fa1. The gap says a write that Guardian blocks as a tool call can run as a command, which breaks "a block holds for the outcome, not for the tool".
|
Co-Authored-By: David Cramer <[email protected]>
|
Can you look at the history of how skipping sandbox commands happens? I'm not sure that would be why that would be the case, and it seems like a problem. |
|
We fix the create preview so you can update this as well. |
|
Nobody chose to skip Sandbox commands. It falls out of the opt-in default for core tools, and
The partial mitigation is plugin egress policy. The GitHub plugin denies issue and pull request text writes, reactions, comment edits, merges, and other unsupported writes from the Sandbox, and its messages send the agent to the reviewed tool (#1508, #3204). Other writes still run with no review, such as a git push to a work branch or a write that another plugin's egress allows. In da05b54 I rewrote the gap to say this, and left it open. The fix is a design choice and isn't in this PR. Putting |
|
Okay, let's open a follow-up thread to opt bash in since bash is unsafe. I think keeping it on auto is what we want. |
|
No, actually, this might be a problem. I'm not 100% sure here. Can you think this through and look up prior art research for how Claude and Codex do this? |
|
Prior art, and how it maps to us. Claude Code auto mode (post): every shell command goes to the classifier. Only a fixed allowlist of tools that can't change state (reads, search) and in-project file edits skip it. When auto mode starts, it drops the blanket allow rules for shell, interpreters, and package-manager Codex Auto-review (docs): commands that stay inside the sandbox run with no review. The reviewer sees only approval requests at the boundary: escalated sandbox permissions, network to destinations that need approval, writes outside the writable roots, command rules with Where we are: we have Codex's shape (an isolated Sandbox, with host egress as the boundary) but not its trigger. Nothing at our boundary asks Guardian. Two holes follow:
Options:
My recommendation is C, built on B, not A. The boundary already exists and already classifies writes, so review there costs only on the actions that matter and judges what actually goes out. A remains the fallback if tying egress back to a Turn turns out too hard. If we do A, we should copy Claude's cheap first stage, or the cost per Turn goes up a lot. The doc in this PR keeps the gap as written. Whichever option you pick, the follow-up removes it. |
Co-Authored-By: David Cramer <[email protected]>
|
Merging this as it is right now, and we can come back and revisit the gaps. |
Core `bash` had no `approvalMode`, so Guardian never reviewed Sandbox commands. This opts `bash` in with `approvalMode: "auto"`. Bash is annotated destructive, so `auto` reviews every call, the same as `review` would today. `auto` also leaves room for a later fast path: `resolveApprovalMetadata` can mark a known-safe command read-only, and the gate needs no change. Routine Sandbox work, such as reads, builds, edits, and work-branch git steps, must stay allowed, including in Automations, where a false `ask` fails the run. Guardian's policy is unchanged. Its existing rule that sandbox-local work never needs confirmation is enough. **Cost:** one Guardian model call for each bash command, adding a few seconds of latency to each one. A later optimization can add a cheap first stage or a safe-command fast path. Code Mode's 10-call batch limit already counted bash calls, so it doesn't change. The unreviewed Sandbox commands gap recorded in #3599 closes when this merges. <!-- junior-request-attribution:start --> via @dcramer. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC1G612XHC%3A1794926620.371079 --> -- [View Session](https://junior-prod.sentry.dev/conversations/slack%3AC1G612XHC%3A1794926620.371079) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC1G612XHC%3A1794926620.371079/?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]>
Adds
design/guardian.md, the goals and rules of Guardian, and lists it in thedesign/README.mdindex. 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
data_exposuremisses private data in a plugin write that reaches a public place.bashnever 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.publishImagemakes a public URL with no review and no private-data check.via @dcramer, Jeffrey Hung.
--
View Session [Sentry]