Skip to content

fix(sandbox): Bind egress proxy to VM session#354

Merged
dcramer merged 2 commits into
mainfrom
fix/sandbox-egress-oidc-context
May 15, 2026
Merged

fix(sandbox): Bind egress proxy to VM session#354
dcramer merged 2 commits into
mainfrom
fix/sandbox-egress-oidc-context

Conversation

@dcramer
Copy link
Copy Markdown
Member

@dcramer dcramer commented May 15, 2026

Sandbox credential egress now routes through the active Vercel Sandbox VM session id instead of the persistent sandbox name. This matches the Sandbox v2 SDK model where the sandbox name is used for workspace resume while the current session id identifies the running VM that issues forwarded firewall requests.

Proxy Token Verification

The egress proxy verifies the Vercel-signed token issuer and signature, then binds the token sandbox claim to the forwarding route id. It does not compare Sandbox proxy token audience, project, or team claims with deployment OIDC because those are separate token contexts and the public Sandbox proxy docs do not define that as the verifier contract.

Live Session Binding

Junior reads the egress id from sandbox.currentSession().sessionId through a live wrapper getter, so cached named sandboxes that resume into a new VM session refresh their forwarding route and command-scoped authorization with the new session id.

Credential Activation

Junior still requires an active command-scoped egress session before issuing requester-bound provider credentials. Missing public callback URL still fails sandbox setup before placeholder credentials can reach provider domains.

Fixes JUNIOR-2F

@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

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

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview, Comment May 15, 2026 6:08pm

Request Review

@dcramer dcramer force-pushed the fix/sandbox-egress-oidc-context branch from 09db2ef to 8ccf2eb Compare May 15, 2026 17:23
@dcramer dcramer force-pushed the fix/sandbox-egress-oidc-context branch from 8ccf2eb to df6e802 Compare May 15, 2026 17:30
@dcramer dcramer changed the title fix(sandbox): Derive egress OIDC trust from Vercel token fix(sandbox): Verify egress proxy tokens by sandbox May 15, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit df6e802. Configure here.

Comment thread packages/junior/src/chat/sandbox/egress-oidc.ts
@dcramer dcramer force-pushed the fix/sandbox-egress-oidc-context branch from df6e802 to ad26cf9 Compare May 15, 2026 17:45
@dcramer dcramer changed the title fix(sandbox): Verify egress proxy tokens by sandbox fix(sandbox): Bind egress proxy to VM session May 15, 2026
@dcramer dcramer force-pushed the fix/sandbox-egress-oidc-context branch from ad26cf9 to 6959b72 Compare May 15, 2026 17:50
Route sandbox credential egress through the active Vercel Sandbox VM session id.

Do not bind the proxy route to the persistent sandbox name.

Vercel's firewall proxy token identifies the forwarded sandbox request.

Junior keeps the sandbox name for workspace resume.

Use the active egress session to authorize requester-bound credentials.

Keep the missing callback URL setup failure so placeholder credentials cannot reach provider domains.

Fixes JUNIOR-2F

Co-Authored-By: GPT-5 Codex <noreply@openai.com>
Keep sandbox credential egress bound to the current Vercel Sandbox VM session when the SDK resumes a named sandbox. Refresh command-scoped credential authorization from the live session id instead of a value captured when the wrapper was created.

Tighten tests and comments so egress ids refer to forwarded VM sessions rather than persistent sandbox names.

Fixes JUNIOR-2F
Co-Authored-By: GPT-5 Codex <noreply@openai.com>
@dcramer dcramer marked this pull request as ready for review May 15, 2026 18:20
@dcramer dcramer merged commit 835b867 into main May 15, 2026
15 checks passed
@dcramer dcramer deleted the fix/sandbox-egress-oidc-context branch May 15, 2026 18:21
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