Repository navigation
fix(sandbox): Scope egress and adapt sandbox v2 - #346
Merged
Merged
Conversation
Tighten sandbox egress sessions so each bash command gets its own requester-bound activation and cached credential leases cannot cross activations. Clear the active egress session as soon as command execution finishes. Reject command-env bindings that reuse API header, credential, or OAuth env vars, and fail stale env-var declaration fields instead of silently accepting removed manifest flags. Simplify Vercel Sandbox OIDC sandbox binding to the explicit sandbox_id claim used by the proxy contract and tests. Co-Authored-By: GPT-5 Codex <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
marked this pull request as ready for review
May 14, 2026 20:52
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 90184d8. Configure here.
dcramer
force-pushed
the
fix/sandbox-egress-command-scope
branch
from
May 14, 2026 21:04
90184d8 to
ac4ab74
Compare
dcramer
force-pushed
the
fix/sandbox-egress-command-scope
branch
from
May 14, 2026 21:26
ac4ab74 to
e2d2692
Compare
dcramer
force-pushed
the
fix/sandbox-egress-command-scope
branch
from
May 14, 2026 22:11
e2d2692 to
edcb992
Compare
dcramer
marked this pull request as draft
May 14, 2026 22:12
dcramer
marked this pull request as ready for review
May 14, 2026 22:13
Adapt Vercel Sandbox v2 objects once at the sandbox boundary so session, sync, snapshot, and tool execution code all consume Junior's internal sandbox contract. Keep the bash-tool executeCommand/readFile/writeFiles bridge isolated to its package boundary and cover it with the real bash-tool package so SDK shape drift fails in tests. Fixes JUNIOR-2A Co-Authored-By: GPT-5 Codex <[email protected]>
dcramer
force-pushed
the
fix/sandbox-egress-command-scope
branch
from
May 14, 2026 22:17
edcb992 to
00d9423
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes the sandbox egress follow-ups from #338 after staging exposed two issues: egress credentials were wider than command scope, and bash-tool was receiving the Vercel Sandbox v2 SDK object directly. The PR scopes credential activation to one command and adapts Vercel Sandbox behind Junior's internal sandbox contract.
Sandbox Contract
Vercel SDK objects are adapted once in
sandbox/workspace.ts. Session, skill sync, snapshot, and noninteractive command code consumeSandboxInstance; tool-facing code gets the narrowerSandboxWorkspace. The bash-toolexecuteCommandbridge is isolated at that package boundary.Command-scoped Egress
Each bash command gets a fresh requester-bound egress activation, cached leases are tied to that activation, and the session is cleared when command execution finishes. Command env bindings cannot reuse API header, credential, or OAuth env vars.
Cleanup
Removes the duplicate sandbox wrapper from
sandbox.ts, deletes the separateCommandRunnershape, removes the bash-tool sandbox type import, and keeps the real bash-tool regression test instead of a second mock-only adapter test.Fixes JUNIOR-2A
Refs #338
Refs #342