sandbox
Vercel Sandbox is an ephemeral compute primitive designed to safely run untrusted or user-generated code.
by vercelTypeScript
Commit activity
Last 12 weeks · 73 commits
Community health
3 of 6 standards met
Recent PRs & issues
Summary Upgrade Ubuntu and Amazon Linux Node.js images to 22.23.3, 24.22.0, and 26.12.0. Pin the universal image to Node.js 24.22.0 using the versioned tarball instead of resolving the latest Node.js 24 release during builds. Add patch changesets for the affected image packages. Verification Passed: Docker Bake configuration assertions for all six Node.js targets and their major/version tags. Passed: with assertions confirming the pinned version matches and the Dockerfile uses the versioned tarball. Passed: . Passed: . Images were not built or pushed.
Package: 3.8.0 The default sandbox user (uid 1000: on the runtime, on the universal image) runs with every Linux capability () as well as passwordless sudo. The docs already say this, so this is a feature request, not a security report. Removing sudo is not enough to make a command unprivileged: with the user can still delete a root-owned file in a root-owned folder. Removing sudo also removes the host's own root access, because uses the same sudo. A user from has no capabilities, but a program that must run as the default user (for example an agent bridge) cannot use it. Reproduction ( 3.8.0, ). prints . With sudo, create (mode 600) in a root-owned folder (mode 755). Then run without sudo: exit 0, and the file is gone. The same on a second file, run under the line below, prints and fails with "Permission denied". Request.** An option on (or on ) that runs the command with no capabilities and no-new-privileges. The workaround today is to wrap the program in . _Generated by Claude Code_
Recent fixes
Why supports command stdin (, , ), but the mock didn't, so code using it couldn't be tested without a real sandbox. The mock runs commands through just-bash, which takes stdin up front. So writes are buffered and the command runs once stdin is closed. It can't respond to input as it arrives, which the README notes as a limitation. Validation Offsets, resends and closes return the same status codes as the real API: an offset past the bytes written is 409, new bytes after close are 400, and writes to an exited command are 404. Kill, session stop and end a command still waiting for stdin. rejects on abort instead of hanging. New compat tests pass against the mock. The real-sandbox variants need integration credentials and weren't run locally.
Every sandbox now supports stdin write offsets, so the SDK no longer needs the fallbacks for ones that don't: always sends an offset, instead of switching to unsafe writes when a response lacks . If it can't learn the current offset, it fails before writing rather than assuming 0. A 504 no longer triggers an extra empty request to find the bytes written; the timeout response already includes them.
The Sandbox skill covers sandbox forks but leaves agents without a path for persistent files shared across runs. Add a short choice between and , followed by an example that seeds a drive, forks it, and mounts the worker's writable copy. The example follows the GA Drives guide's initialization rule: write to a read-write mount before forking. It also keeps the sandbox in the drive's region and stops each sandbox after writing. Concurrent readers use ; each mount sees the files as they stood when that sandbox mounted it. The docs say many readers can mount snapshots but give no numeric reader limit. Checked the example's APIs and behavior against the live Drives guide and SDK reference on October 18. passed. A live run with Sandbox credentials was not available in this worktree.
Repository: vercel/sandbox. Description: Vercel Sandbox is an ephemeral compute primitive designed to safely run untrusted or user-generated code. Stars: 212, Forks: 45. Primary language: TypeScript. Languages: TypeScript (98.7%), Dockerfile (1%), HCL (0.3%), JavaScript (0%), Shell (0%). License: Apache-2.0. Homepage: https://vercel.com/docs/vercel-sandbox Latest release: sandbox@4.9.0 (1d ago). Open PRs: 26, open issues: 12. Last activity: 1h ago. Community health: 62%. Top contributors: marc-vercel, github-actions[bot], QuiiBz, erulkey, AndyW22, Schniz, LukeSheard, valerian-roche, TooTallNate, robherley and others.