Skip to content

feat: Allow standalone command env with explicit exposure - #490

Merged
dcramer merged 2 commits into
mainfrom
codex/fix-duplicate-provider-domain
Jun 2, 2026
Merged

dcramer merged 2 commits into
mainfrom
codex/fix-duplicate-provider-domain

Conversation

@dcramer

@dcramer dcramer commented Jun 2, 2026

Copy link
Copy Markdown
Member

Summary

  • Let command-env stand alone without requiring provider domains or API headers.
  • Add an explicit expose-to-command-env opt-in for host env bindings that should be visible in the sandbox.
  • Keep provider auth values host-only, and update the Sentry/GitHub manifests and docs to match.

Testing

  • Added and updated unit coverage for manifest parsing, inline plugin manifests, packaged Sentry config, and sandbox command-env resolution.
  • Ran the affected Vitest suites, plus pnpm docs:check and package typecheck for @sentry/junior and @sentry/junior-plugin-api.

@vercel

vercel Bot commented Jun 2, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment Jun 2, 2026 5:44pm

Request Review

@dcramer dcramer changed the title Allow standalone command env with explicit exposure feat: Allow standalone command env with explicit exposure Jun 2, 2026
Assert the packaged Sentry manifest keeps OAuth on sentry.io while credential egress binds to regional API hosts.

Co-Authored-By: GPT-5 Codex <[email protected]>
@dcramer
dcramer merged commit bcfc8ff into main Jun 2, 2026
16 checks passed
@dcramer
dcramer deleted the codex/fix-duplicate-provider-domain branch June 2, 2026 17:58
sentry-junior Bot added a commit that referenced this pull request Jun 5, 2026
…domains

The previous assertion locked in the regression from #490 by expecting
only regional subdomains. Update to match the restored domain list and
add a comment explaining why sentry.io must stay in this list.

Co-authored-by: immutable dcramer <[email protected]>
dcramer added a commit that referenced this pull request Jun 5, 2026
## What

Restore `sentry.io` to the `credentials.domains` list in
`packages/junior-sentry/plugin.yaml`.

## Why

This was inadvertently removed in #490 ("feat: Allow standalone command
env with explicit exposure"), which refactored command-env separation
and updated the Sentry manifest as part of that. The removal wasn't the
intent of that PR — it was collateral.

The consequence: the Sentry CLI calls `sentry.io` for all API requests
(no `SENTRY_URL` override). The sandbox egress proxy uses **exact
hostname matching** on `credentials.domains`. With `sentry.io` missing
from that list, `sentry.io` traffic bypassed the proxy entirely — the
CLI sent `SENTRY_AUTH_TOKEN=host_managed_credential` (the placeholder)
directly to Sentry, which returned `401 Invalid token`. The proxy was
never in the loop, so the OAuth reconnect flow never triggered.

## Don't reintroduce this

The `credentials.domains` list must cover **every hostname the CLI
actually calls**, not just regional subdomains. If you're changing the
Sentry plugin manifest:

- `sentry.io` is the default API host for the Sentry CLI (used for auth,
org listing, issue queries, etc.)
- `us.sentry.io` / `de.sentry.io` are regional data hosts — also needed,
but not sufficient on their own
- Removing any of these from `credentials.domains` will silently break
credential injection for those calls

## Verified

- One-line diff restoring the previously-present entry
- Confirmed dropped in #490 diff: `packages/junior-sentry/plugin.yaml`
hunk shows `- - sentry.io`

---
[View Session in
Sentry](https://sentry.sentry.io/traces/?project=4510944073809921&query=gen_ai.conversation.id%3A%22slack%3AC0B595QDZLL%3A1780670061.339359%22)

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: immutable dcramer <[email protected]>
dcramer added a commit that referenced this pull request Nov 17, 2026
Sandbox egress credentials have no design doc yet, so changes have no
stated intent to check against. This PR adds
`design/sandbox-credentials.md` and lists it in the `design/README.md`
index.

The doc sets these goals:
- No real credentials in the Sandbox.
- Inject a credential only into requests that send the plugin
placeholder.
- Never replace a credential that a request already carries.
- Use the least access that works.
- Each plugin owns its own write policy.

It also sets the Sentry rules: Sandbox code cannot create releases or
uploads with the Actor's account, and cannot delete orgs or projects
(see #3550).

The intent comes from `policies/security.md`, from #210,
#381, #490 and #536, and from the comments in
`junior-github/src/egress-policy.ts`,
`chat/sandbox/noninteractive-command.ts` and
`chat/sandbox/prepare-workspace.ts`.

**Open intent questions**
- **Missing auth header:** fill one only when the plugin says its tools
send none, as git does today. Sentry stays strict. The alternative is to
never fill it.
- **Child agents:** Threads and Tasks use the parent Turn's Actor
credentials. I treated that as intended and left it out of the doc.

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

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

--

[View
Session](https://junior-prod.sentry.dev/conversations/agent%3Ac9056086d12016c72d052e066ae38509)
[[Sentry]](https://sentry.sentry.io/explore/conversations/agent%3Ac9056086d12016c72d052e066ae38509/?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 — 8f0d69b3 Deployed Jun 2, 2026 by vercel[bot]
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.

1 participant