What is a sandbox?
A sandbox is an isolated Linux system for your experimentation and use. Internally, it is a Firecracker MicroVM that is powered by the same infrastructure that powers 1M+ builds a day at Vercel.Getting started
Vercel Sandbox is in beta. To get started, create a new project:next-dev.ts
:
- Start a sandbox, seeding it with a git repository.
- Install dependencies.
- Run a
next dev
server - Open it in your browser
Authentication
Vercel OIDC token
The SDK uses Vercel OIDC tokens to authenticate whenever available. This is the most straightforward and recommended way to authenticate. When developing locally, you can download a development token to.env.local
using vercel env pull
. After 12 hours the development token expires, meaning
you will have to call vercel env pull
again.
In production, Vercel manages token expiration for you.
Access token
If you want to use the SDK from an environment whereVERCEL_OIDC_TOKEN
is
unavailable, you can also authenticate using an access token:
- Go to your team settings, and copy the team ID.
- Go to a project’s settings, and copy the project ID.
- Go to your Vercel account settings and create a token. Make sure it is scoped to the team ID from the previous step.
VERCEL_TEAM_ID
, VERCEL_PROJECT_ID
, and VERCEL_TOKEN
. Then pass these to
the create
method:
Limitations
- Max resources: 8 vCPUs. You will get 2048 MB of memory per vCPU.
- Sandboxes have a maximum runtime duration of 5 hours for Pro/Enterprise and 45 minutes for Hobby,
with a default of 5 minutes. This can be configured using the
timeout
option ofSandbox.create()
.
System
The base system is an Amazon Linux 2023 system with the following additional packages installed.- The
node22
image ships a Node 22 runtime under/vercel/runtimes/node22
. - The
python3.13
image ships a Python 3.13 runtime under/vercel/runtimes/python
. - User code is executed as the
vercel-sandbox
user. /vercel/sandbox
is writable.
Sudo access
Thenode22
and python3.13
images allow users to run commands as root. This
can be used to install packages and system tools:
HOME
is set to/root
– Executed commands will source root’s configuration files (e.g..gitconfig
,.bashrc
, etc).- Environment variables are not reset before executing the command.
PATH
is left unchanged – sudo won’t change the value of PATH, so local or project-specific binaries will still be found.