Vercel Sandbox
by Vercel
A throwaway Linux computer for untrusted code.
Code sandboxesUp · live statusOfficial MCP server
1. Price
Free tier: Hobby: 5 active-CPU hours, 420 GB-hours memory, 5,000 sandbox creations per month. As reported on the official pricing page, checked Nov 1, 2026.
vercel.com/docs/vercel-sandbox/pricing2. Commercial use
“You shall only use the Services under a Hobby plan for your personal or non-commercial use.”
Needs a Pro or Enterprise plan; the Hobby plan is for personal, non-commercial use only.
vercel.com/legal/terms3. Key & sign-up
“This creates a .env.local file with a VERCEL_OIDC_TOKEN.”
Vercel OIDC token (recommended): vercel link + vercel env pull writes VERCEL_OIDC_TOKEN to .env.local, and on Vercel it is automatic. Elsewhere: an access token with team and project IDs.
vercel.com/docs/sandbox/concepts/authentication.md4. Agent access
“Vercel MCP is Vercel's official MCP server. It's a remote MCP with OAuth that gives AI tools secure access to your Vercel projects available at”
Our agent check: 6 of 6 (Nov 13, 2026).
vercel.com/docs/mcp/vercel-mcp.mdChecked against the maker's official pages, pricing on Nov 1, 2026. Tap a verdict to see its source.How we checkedReport an error
What Vercel Sandbox does
Vercel Sandbox starts a small, separate Linux computer in Vercel's cloud for a few minutes or hours. Your app or AI agent runs code there that you do not trust, such as AI-written scripts or user uploads, away from your real site. You pay mostly for the time the processor is actually busy, not for time spent waiting.
- Vercel Sandbox is one of 12 APIs in the Code sandboxes category on AgentGid.
- Its cheapest paid plan ($20 a month) is the 3rd cheapest of the 9 here with a monthly plan.
- It is one of 11 that can be started for free.
- It ships an official MCP server, like 3 others here.
- Its official SDK is the 2nd most downloaded in the category (8.1M a week).
What people build with it
Run code your AI assistant wrote
Your chat or agent writes a script; the sandbox runs it and returns the output, so a bad script never touches your servers.
Code playgrounds and AI page builders
Let visitors type or generate code and see it run, for example a coding course playground or a tool that builds pages from a prompt.
Live preview of a generated app
Start the app your user or agent just built and show it at a temporary web address, so they can click through it.
Work on private data with no internet
When an agent reads private files, block all outgoing traffic so nothing can be sent out of the sandbox.
Let an agent use a service without seeing its key
The agent inside can call GitHub or an AI service, while your secret key is added on the way out and never enters the sandbox.
Check homework submissions Idea
Run each student's submitted program in its own sandbox against your tests and collect the results.
Vercel Sandbox popularity
SDK downloads from npm and PyPI, weekly. Numbers as of Nov 17, 2026.
Pricing
Hobby: 5 active-CPU hours, 420 GB-hours memory, 5,000 sandbox creations per month
$20 a month
Active CPU $0.128/hour; provisioned memory $0.0212 per GB-hour; creations $0.60 per 1M (iad1)
Pro usage is charged against the Vercel Pro plan's $20/month credit, then at the listed rates. Rates vary by region. Only active CPU time is billed for CPU; memory billed in 1-minute minimums. Hobby sessions max 45 min; Pro 24 h. Vercel's general MCP server includes sandbox tools.
What one action costs
| Action | Price |
|---|---|
| 1 hour of active CPU (Pro, iad1) | $0.128 |
| 1 GB of memory for 1 hour (Pro, iad1) | $0.0212 |
| 1 million sandbox creations | $0.60 |
| One 5-minute AI code check (2 vCPU, 4 GB, 10% CPU use, Pro, iad1) | $0.0092 |
Price history
- A year of the pricing page in the Internet Archive (2 months): the lowest monthly figure went from $20 (2026-02) to $20 (2026-03).
As reported on the official pricing page, checked Nov 1, 2026. Prices change: confirm before you buy. vercel.com/docs/vercel-sandbox/pricing
Limits
10 sandboxes at once, sessions up to 45 minutes; 5 hours of active CPU, 420 GB-hours of memory and 5,000 creations a month
Over the monthly quota, creating sandboxes is paused (no extra charge)
10,000 sandboxes at once, sessions up to 24 hours
Control requests (run commands, read files): 1,000 a minute on Hobby, 10,000 on Pro; deletions 20 a second
Default timeout 5 minutes, can be extended up to the plan's session maximum
From the official docs. vercel.com/docs/sandbox/pricing.md
Status and incidents
All Systems Operational
3 incidents, 1 of them major
From the official status page, checked Nov 23, 2026. vercel-status.com
Key and access
Vercel OIDC token (recommended): vercel link + vercel env pull writes VERCEL_OIDC_TOKEN to .env.local, and on Vercel it is automatic. Elsewhere: an access token with team and project IDs.
VERCEL_OIDC_TOKEN (or VERCEL_TOKEN + VERCEL_TEAM_ID + VERCEL_PROJECT_ID)No
Steps only a person can do
- Sign up for Vercel and create or link a project (vercel link), then pull the token (vercel env pull). Load .env.local with dotenv; the SDK reads VERCEL_OIDC_TOKEN from the environment.
- Choose Pro before any commercial use, and set Spend Management alerts. No code change; the same project and tokens keep working.
- Decide on AI training of your content (on Hobby it is on by default); change it in team settings. Nothing in code; note the choice in the project README.
Commercial use and your data
It is a paid Vercel service with a free monthly allowance on the Hobby plan, which is for personal, non-commercial use only. A business product needs Pro or Enterprise. The client code is open source (Apache-2.0 for the JavaScript package).
Needs a Pro or Enterprise plan; the Hobby plan is for personal, non-commercial use only.
“You shall only use the Services under a Hobby plan for your personal or non-commercial use.” source
The JavaScript package and command-line tool are Apache-2.0; the Python package is MIT. Keep their license notices.
“"license":"Apache-2.0"” source
On Hobby and trial Pro, Vercel may train on your content unless you opt out; on paid Pro it is off unless you opt in.
“You may opt-out of model training at any time by adjusting your team account settings or by upgrading to an enterprise plan.” source
“you agree that we may use your content to train our artificial intelligence”
“Snapshots expire 30 days after their last use by default.”
“Vercel Sandbox is available in 19 regions. The default region is iad1.”
Errors to handle
The development OIDC token from vercel env pull has expired.
Run vercel env pull again; on Vercel the token is renewed automatically.
The free monthly sandbox quota is used up.
Wait for the next 30-day window or upgrade to Pro.
A named sandbox's saved state has expired and the SDK tried to resume it.
Pass resume true to getOrCreate so a fresh sandbox with the same name is made, or lengthen the snapshot expiration.
The sandbox stopped while you were streaming its logs.
Extend the timeout for long tasks or reconnect after resuming the sandbox.
The command inside the sandbox failed; the SDK call itself succeeded.
Check exitCode and read stderr() before using the output.
Use it from an agent
6 of 6: llms.txt yes, OpenAPI yes, SDK yes, MCP yes, status page yes, AI assistants allowed yes
Checked Nov 13, 2026.
Vercel MCP (general Vercel server; its tool list has a Sandboxes section)
npx -y add-mcp https://mcp.vercel.com -g
npm install @vercel/sandboxpip install vercelInstructions in its docs to check first
“First, load the installed Sandbox skill, or install it with npx skills add vercel/sandbox. Make sure the Vercel CLI is installed (npm i -g vercel).”
Ask the person first; it installs an unpinned skill and a global tool and links their account.
“npx -y add-mcp https://mcp.vercel.com -g”
Ask the person first; it writes the MCP server into every AI tool on the machine and then asks for an OAuth login to their Vercel account.
Alternatives
Vercel Sandbox This page
Pick E2B when you are not on Vercel, want $100 of free credits, or may want to host the open-source engine yourself.
Pick Daytona when you need sandboxes with graphics cards or Windows.
Pick Modal Sandboxes when the code you run needs graphics cards, in serverless containers.
Get started
Tell your AI assistant
“Run the code my agent generates in Vercel Sandbox: on the server use @vercel/sandbox with the OIDC token from .env.local, create the sandbox with networkPolicy deny-all unless it needs the internet, check exitCode and stderr, and call sandbox.stop() when done.”
Link a folder to a Vercel project and pull a development token into .env.local (needs a Vercel account and the Vercel command-line tool).
vercel link vercel env pullInstall the package (Node.js 22+ or Python 3.10+).
npm install @vercel/sandbox dotenv @types/node tsx typescriptCreate a sandbox and run a command, then stop it when done.
const sandbox = await Sandbox.create(); const result = await sandbox.runCommand('echo', ['Hello from Vercel Sandbox!']); console.log(await result.stdout());
First request
import { config } from 'dotenv';
config({ path: '.env.local' });
import { Sandbox } from '@vercel/sandbox';
async function main() {
const sandbox = await Sandbox.create();
const result = await sandbox.runCommand('echo', ['Hello from Vercel Sandbox!']);
console.log(await result.stdout());
}
main().catch(console.error);Hello from Vercel Sandbox!Mistakes to avoid
CPU and memory are billed while the sandbox runs.
Sandboxes are persistent by default and the automatic snapshots are billed as storage.
Code inside the sandbox can read and leak any key it is given.
runCommand returns normally even when the program inside failed.
The Hobby plan is limited to non-commercial personal use.
Questions
Is there a free tier?
Yes. Hobby includes 5 hours of active CPU, 420 GB-hours of memory and 5,000 sandbox creations a month, for non-commercial use. Over the quota, creation pauses instead of charging you.
Do I pay while my code waits for an AI model to answer?
Not for CPU. Waiting for network or model calls does not count as active CPU; memory is still billed while the sandbox runs.
Can I use it outside Vercel hosting?
Yes. Use an access token with your team and project IDs in other clouds or CI systems.
How does Pro billing work?
Sandbox usage is first taken from the Pro plan's $20 monthly credit, then billed at the listed rates.
Which languages are inside a sandbox?
The default image has Node.js, Python 3.14, coding agents and common tools, with root access; you can also use your own image.