Repository navigation
feat(sandbox): Add credential egress proxy - #338
Merged
Merged
Conversation
Route credential-capable sandbox provider traffic through Junior's Vercel Sandbox firewall proxy. Verify sandbox OIDC, bind proxy authorization to the requester and loaded skill provider, and mint credentials only when matching egress traffic arrives. Document the proxy credential contract in the security, plugin, capability, and public docs. Refs #337 Co-Authored-By: GPT-5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
dcramer
marked this pull request as ready for review
May 12, 2026 23:37
dcramer
commented
May 12, 2026
dcramer
commented
May 12, 2026
Bind sandbox proxy OIDC validation to the Vercel project and sandbox claim before issuing provider credentials. Cache the host-side credential router for proxy lease misses and remove the unused provider enablement method. Refs #337 Co-Authored-By: GPT-5 <[email protected]>
Apply the sandbox egress domain matcher when credential header transforms are selected. This keeps wildcard provider domains consistent between firewall routing, provider resolution, and header injection. Refs #337 Co-Authored-By: GPT-5 <[email protected]>
dcramer
marked this pull request as draft
May 13, 2026 02:33
Remove the obsolete per-turn capability runtime. Sandbox egress proxy activation now owns credential issuance. Return a command-readable auth marker when proxied credential activation requires OAuth. This lets the existing command failure path pause the turn and send the private link. Co-Authored-By: GPT-5 Codex <[email protected]>
Persist active plugin providers through turn checkpoints and use them when authorizing sandbox egress and OAuth recovery. Keep skill state for prompt continuity while avoiding skill-only auth activation. Address proxy review feedback by preserving repeated headers, rejecting embedded forwarded ports, and sharing sandbox identifier extraction. Co-Authored-By: GPT-5 Codex <[email protected]>
Strip the original host header before forwarding sandbox egress requests and share provider list normalization across auth paths. Simplify command auth recovery so provider resolution owns the auth-failure checks. Co-Authored-By: GPT-5 Codex <[email protected]>
Refresh the credential router when the state adapter changes, include wildcard apex domains in egress policy, and preserve same-turn egress sessions across empty provider refreshes. Co-Authored-By: GPT-5 Codex <[email protected]>
dcramer
marked this pull request as ready for review
May 13, 2026 15:35
Move provider credential egress wiring out of the sandbox session manager and into the sandbox executor facade. The session manager now works with generic network policy, command environment, and command hooks only. Use the Vercel Sandbox v2 name contract directly and remove the stable/beta identifier shim. Co-Authored-By: GPT-5 Codex <[email protected]>
Only GitHub smart-HTTP hosts receive Basic auth. Keep other GitHub service domains on Bearer installation auth so future manifest domains do not inherit git transport behavior by position. Co-Authored-By: GPT-5 Codex <[email protected]>
Refresh changed network policy when reusing an in-memory sandbox, while skipping unchanged policy updates. Resolve the GitHub API host by domain role so REST calls and git auth do not depend on manifest ordering. Co-Authored-By: GPT-5 Codex <[email protected]>
Keep sandbox egress session state to the fields used for authorization and align wildcard matching with the Vercel network policy contract. Apex hosts continue to be explicit policy entries instead of being covered by wildcard transforms. Co-Authored-By: GPT-5 Codex <[email protected]>
Preserve bodyless proxied methods without synthesizing an empty request body and keep restored sandbox policy tracking tied to the policy actually applied during refresh. Co-Authored-By: GPT-5 Codex <[email protected]>
Allow credential-backed manifests to declare top-level egress domains without static API headers and keep GitHub App identity caching to successful resolutions plus in-flight requests. Co-Authored-By: GPT-5 Codex <[email protected]>
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 42684b9. Configure here.
Use a fresh sandbox name and matching network policy for snapshot boot retries so a partially registered failed attempt cannot poison the remaining retry attempts. Co-Authored-By: GPT-5 Codex <[email protected]>
Trust requester-bound sandbox egress sessions and resolve providers from forwarded hosts instead of checkpointing active plugin providers. Expose GitHub App git identity through declared public host env bindings so command env setup does not call GitHub before a provider request. Refs GH-342 Co-Authored-By: GPT-5 Codex <[email protected]>
Keep plugin auth recovery provider selection inside the plugin auth service instead of threading a provider list through agent tool wiring. Drop redundant sandbox session state and stale docs language about GitHub repo-scoped tokens. Co-Authored-By: GPT-5 Codex <[email protected]>
Drop wildcard egress matching now that plugin manifests only accept concrete domains. Reject duplicate plugin names and provider domains during registry load so the proxy never has to pick an owner by sort order. Let the sandbox egress lease cache own GitHub token reuse and clear cached leases when providers reject injected headers, so resumed auth can mint from current provider state. Co-Authored-By: GPT-5 Codex <[email protected]>
Treat defaultless command-env placeholders as the explicit host env bindings instead of requiring a separate expose-to-command-env flag. Keep defaults and API header validation separate so secret-bearing headers still resolve only through host-managed credential delivery. Co-Authored-By: GPT-5 Codex <[email protected]>
dcramer
added a commit
that referenced
this pull request
May 14, 2026
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 consume `SandboxInstance`; tool-facing code gets the narrower `SandboxWorkspace`. The bash-tool `executeCommand` bridge 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 separate `CommandRunner` shape, 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 --------- Co-authored-by: GPT-5 Codex <[email protected]>
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.

Route credential-capable Vercel Sandbox traffic through the Junior internal egress proxy and authorize it from active plugin providers instead of loaded skill state. This keeps real credentials on the host while preserving requester-bound sandbox sessions, OAuth recovery, turn resume behavior, and GitHub App commit attribution.
Provider Activation and Manifests
Turns persist active plugin providers through checkpoints and seed sandbox egress from that provider set. Plugin manifests use
domainsconsistently for provider egress hosts, plugin-level API headers, and token-backed credential header transforms.Sandbox Egress Proxy
New and restored sandboxes install provider-domain forwarding rules to the Junior internal proxy. The proxy verifies Vercel Sandbox OIDC claims against trusted deployment configuration, checks requester-bound sandbox state, validates active provider authorization, drops proxy-control and hop-by-hop transport headers, overlays host-managed credential headers for matching upstream domains, and forwards upstream response state back to the sandbox.
Command Execution and Git Attribution
Bash execution no longer accepts per-command header transforms or mutates sandbox network policy around individual commands. Provider command env is resolved from the active provider set before each command, GitHub App providers set
GIT_AUTHOR_*andGIT_COMMITTER_*from the installation bot identity, and credential env values remain non-secret placeholders authenticated by the host-side egress proxy.Refs #337
Fixes #342