Skip to content

fix(sandbox): Route forwarded provider egress#369

Merged
dcramer merged 2 commits into
mainfrom
fix/sandbox-egress-forwarding
May 19, 2026
Merged

fix(sandbox): Route forwarded provider egress#369
dcramer merged 2 commits into
mainfrom
fix/sandbox-egress-forwarding

Conversation

@dcramer
Copy link
Copy Markdown
Member

@dcramer dcramer commented May 19, 2026

Route sandbox provider egress through Junior’s forwarded-request handler instead of a path-specific internal route. Vercel Sandbox preserves the upstream path, so provider API calls now reach the proxy before normal app routes and use the signed sandbox OIDC claim to find the command-scoped credential session.

Forwarded Request Handling

The sandbox network policy forwards declared provider domains to the app root. The egress handler verifies Vercel OIDC, derives the session from sandbox_id, reconstructs the upstream URL from forwarded metadata and the original path, and applies existing provider header transforms.

Contracts

Update sandbox egress tests and credential policy docs to remove the route-carried sandbox id assumption.

Fixes #366

Use Vercel Sandbox forwarded request headers as the credential egress boundary instead of routing provider traffic through a path-carried sandbox id. The proxy now verifies the sandbox OIDC token, uses its sandbox_id for the command-scoped egress session, and reconstructs upstream requests from forwarded host metadata plus the original path.

Update the egress tests and specs to match the forwarded-request contract.

Fixes #366

Co-authored-by: GPT-5 Codex <codex@openai.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 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 19, 2026 1:15am

Request Review

Drop the unused helper that described the old route-bound egress check. The proxy now uses the verified Vercel Sandbox OIDC sandbox_id as the active egress session key, so keeping the old helper made the security model look split across two paths.

Refs GH-366
Co-Authored-By: GPT-5 Codex <codex@openai.com>
@dcramer dcramer marked this pull request as ready for review May 19, 2026 01:19
@dcramer dcramer merged commit 97d8e44 into main May 19, 2026
16 checks passed
@dcramer dcramer deleted the fix/sandbox-egress-forwarding branch May 19, 2026 01:25
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.

Sentry plugin: API requests 404 due to egress routing

1 participant