Skip to content

fix(guardian): Tell Guardian which domains get each plugin's Sandbox credential - #3694

Merged
MathurAditya724 merged 1 commit into
mainfrom
fix/guardian-plugin-credential-domains
Nov 18, 2026
Merged

MathurAditya724 merged 1 commit into
mainfrom
fix/guardian-plugin-credential-domains

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Since #3602, Guardian reviews every bash command. It doesn't know that a plugin's token env var in the Sandbox is only a placeholder, or that the real token goes only to that plugin's own domains. So it treats a normal call to the plugin's API as leaking a secret and denies it. This is what breaks the generic OAuth evals on every PR.

Now each plugin that has a credential adds a destination fact to the Guardian prompt. The fact names the env var and the domains that get the real token. The block rules stay the same.

Before: a bash call that sends $EVAL_OAUTH_ACCESS_TOKEN to example.com is denied: "sends a bearer access token to the external example.com endpoint, whose trustworthiness … is not established."

After: Guardian is told "$EVAL_OAUTH_ACCESS_TOKEN in the Sandbox holds a placeholder. The runtime adds the real credential only to Sandbox requests to example.com, the plugin's own service…", so the call goes through and the turn pauses for OAuth as it should.

via @MathurAditya724.

--

View Session [Sentry]

…credential

Guardian reviews every bash command since #3602, but it did
not know that a plugin's credential env var holds only a placeholder, or
which domains get the real credential. So it denied commands that send the
variable to the plugin's own service as data exposure.

Each plugin with a credential now adds a destination fact that names its
env var and credential domains.

Co-Authored-By: Aditya Mathur <[email protected]>
@vercel

vercel Bot commented Nov 18, 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 18, 2026 4:38pm UTC

Request Review

@github-actions github-actions Bot added the risk: medium PR risk score: medium label Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

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

Review screenshots in Frameshift

Automation Run Details · Desktop
Automation Run Details · Desktop
Changed
Automation Skill Editor · Desktop
Automation Skill Editor · Desktop
Changed
Automation Skill Editor · Mobile
Automation Skill Editor · Mobile
Changed
Automations Runs Filters · Desktop
Automations Runs Filters · Desktop
Changed
Conversation Attachment Zoom · Desktop
Conversation Attachment Zoom · Desktop
Changed
Conversation Attachment Zoom · Mobile
Conversation Attachment Zoom · Mobile
Changed
Show 3 more changed screenshots
Person Profile · Desktop
Person Profile · Desktop
Changed
System Cache Tokens · Desktop
System Cache Tokens · Desktop
Changed
System Cache Warming · Desktop
System Cache Warming · Desktop
Changed

@MathurAditya724
MathurAditya724 merged commit 076e035 into main Nov 18, 2026
54 of 65 checks passed
@MathurAditya724
MathurAditya724 deleted the fix/guardian-plugin-credential-domains branch November 18, 2026 17:11
MathurAditya724 pushed a commit that referenced this pull request Nov 18, 2026
…als (#3707)

Follow-up to the review of #3694.

The credential fact only covers plugins that declare `credentials`, so
the design doc now says exactly that. The fact also stops calling the
domains "the plugin's own service" and only says where the credential
goes. Two Guardian eval cases now use the real facts from
`guardianPluginFacts`, so Guardian evals see this text.

GitHub (`GITHUB_TOKEN`) and Vercel (`VERCEL_TOKEN`) aren't covered yet,
because they put their placeholder in the Sandbox through `commandEnv`,
not `credentials`.

**Before:** "…only to Sandbox requests to `sentry.io`, the plugin's own
service, so sending this variable there does not expose a secret." No
Guardian eval case uses this fact.

**After:** "…only to Sandbox requests to `sentry.io`, `us.sentry.io`, so
sending this variable to them does not expose a secret." With that fact
present, a `curl` that sends `$SENTRY_AUTH_TOKEN` to the Sentry API must
be allowed, and uploading `.env` to a paste site must still be denied.

<!-- junior-request-attribution:start -->
via @MathurAditya724.
<!-- junior-request-attribution:end -->

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

--

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

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

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
dcramer added a commit that referenced this pull request Nov 20, 2026
…aceholder gaps (#3800)

Daily design-docs check of the files that the last day of commits on
`main` could affect.

**design/automations.md**
- New entry point: a dashboard Conversation creates an Automation by
naming a public Slack channel as the Destination. #3731
added this on purpose
(`packages/junior/src/chat/automations/tool-destination.ts`).

**design/google.md**
- New gap: `readMeetingTranscript` reads the organizer's transcript Doc
for any invited requester. It never checks that the requester can open
the Doc (`packages/junior-google/src/tools/read-meeting-transcript.ts`,
`isInvited` checks only). A transcript is a Doc like any other, so this
breaks the goal "never reads … a file for a person who could not" and
the rule "reads a file … only for a requester who can open it".

**design/guardian.md**
- Intent change: the credential-fact goal covers every placeholder
credential in the Sandbox again, not only plugins that declare
`credentials`. #3707 narrowed it to match the code. The
goal from #3694 is that Guardian does not deny a normal
plugin API call as a secret leak, and that applies to every plugin with
a placeholder.
- New gap: GitHub (`GITHUB_TOKEN`), Vercel (`VERCEL_TOKEN`), and Datadog
(`DD_API_KEY`) set their placeholders through `commandEnv`, so
`guardianPluginFacts` (`packages/junior/src/chat/guardian/policy.ts`)
adds no fact for them.

**design/child-agents.md**
- New gap: `archiveAgent` refuses a Task ("Only a Thread can be
archived", `packages/junior/src/chat/tools/runtime/archive-agent.ts`).
This breaks "a parent manages the lifecycle of its child agents", which
covers Tasks too.

**design/inbox-stacks.md**
- Cut: the root-field implementation sentence, the comparison with the
classic Inbox look, and the planned-work note on server snoozes.

<!-- junior-request-attribution:start -->
via [automation
`sched_5076e4cb686a5e474279137daf734019`](https://junior-prod.sentry.dev/automations/sched_5076e4cb686a5e474279137daf734019)
· Run ID `sched_5076e4cb686a5e474279137daf734019:1795107600000`,
@dcramer.
<!-- junior-request-attribution:end -->

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

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent-dispatch%3Adispatch_509b6a72ce950f6eb33f1038ac0f2fe4)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent-dispatch%3Adispatch_509b6a72ce950f6eb33f1038ac0f2fe4/?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 — e446d16e Deployed Nov 18, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant