Skip to content

[sandbox-cli] Add explicit reusable Gateway key setup - #387

Open
erulkey wants to merge 1 commit into
elisabeth/gateway-1-managed-cli-20261014from
elisabeth/gateway-2-personal-cli-20261014
Open

erulkey wants to merge 1 commit into
elisabeth/gateway-1-managed-cli-20261014from
elisabeth/gateway-2-personal-cli-20261014

Conversation

@erulkey

@erulkey erulkey commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

Add an explicit choice for users who want to reuse their own Gateway key: sandbox gateway setup, then sandbox create --ai --use-gateway-key codex. Setup creates or saves a key in the OS credential store. Explicit reuse reads AI_GATEWAY_API_KEY first, then the saved key; missing credentials fail with setup instructions.

Plain --ai continues to request a managed session key and ignores local credentials. Personal keys stay outside the VM, remain bound to their existing sandboxes on reconnect, and are not revoked when one sandbox stops.

The completed CLI stack passes 300 CLI tests and 81 SDK API-client tests. A built CLI check against an HTTP stub confirms managed issuance, explicit reuse, and failure without fallback. No new deployed managed lifecycle test is claimed.

Depends on vercel/sandbox#386.

Split from vercel/sandbox#382. Managed backend: vercel/api#98665.

CI is not green. CodeQL flags the SHA-256 hash in gatewayKeyFingerprint as weak password hashing. This code fingerprints API keys for equality rather than validating passwords; the alert still requires security triage before merge.

@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

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

Project Deployment Actions Updated
sandbox-sdk-ai-example Ready Ready Preview Oct 14, 2026 7:34pm UTC
workflow-code-runner Ready Ready Preview Oct 14, 2026 7:34pm UTC

Request Review

@erulkey
erulkey added this pull request to stack #388 October 14, 2026 19:35
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​napi-rs/​keyring@​2.1.0941008489100
Addednpm/​@​inquirer/​prompts@​8.7.3991009794100

View full report

}

export function gatewayKeyFingerprint(key: string) {
return createHash("sha256").update(key).digest("hex");

This branch was successfully deployed

4 active deployments
Preview – sandbox — 75a3caee Deployed Oct 14, 2026 by vercel[bot]
Preview – sandbox-sdk-ai-example — 75a3caee Deployed Oct 14, 2026 by vercel[bot]
Preview – workflow-code-runner — 75a3caee Deployed Oct 14, 2026 by vercel[bot]
Preview – sandbox-cli — 75a3caee Deployed Oct 14, 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.

2 participants