Vercel Sandbox allows you to run arbitrary code in isolated, ephemeral Linux
VMs. This product is in private beta.
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 private beta. These examples will not work unless these
APIs are enabled for your team.
- Go to your team settings, and copy the team ID.
- Go to your Vercel account settings and create a token. Make
sure it is scoped to the team ID from the previous step.
- Create a new project:
$ mkdir sandbox-test
$ pnpm init
$ pnpm add @vercel/sandbox
$ pnpm add --save-dev tsx
Now create whoami.ts:
{@includeCode ../cli/src/example-whoami.ts}
Run it like this:
$ VERCEL_TEAM_ID=<team_id> VERCEL_TOKEN=<token> pnpm tsx ./whoami.ts
Running as: vercel-sandbox
Working dir: /vercel/sandbox
Now have a look at the sidebar for which classes exist.
Limitations
- Sandbox only supports cloning public repositories at the moment.
sudo is not available. User code is executed as the vercel-sandbox user.
- Max resources: 2 cores, 4096 MiB of memory.
- All APIs of the SDK are subject to change. We make no stability promises.
System
The base system is an Amazon Linux 2023 system with the following additional
packages installed.
bind-utils
bzip2
findutils
git
gzip
iputils
libicu
libjpeg
libpng
ncurses-libs
openssl
openssl-libs
procps
tar
unzip
which
whois
zstd
- The
node22 system ships a Node 22 runtime under /vercel/runtimes/node22.
- User code is executed as the
vercel-sandbox user.
/vercel/sandbox is writable.