Vercel Sandbox skill
Isolated Linux microVMs for agent code: the official Vercel skill on the SDK, network rules and snapshots.
- 219 ★ on the repository
- Last commit
- Apache-2.0
Extended access
Why this level
- A sandbox has full internet access by default, and the image allows `sudo` and root inside the microVM.
- The skill works with Vercel tokens and creates resources in your project.
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/vercel-sandboxDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- A sandbox has full internet access by default, and the image allows `sudo` and root inside the microVM.
- The skill works with Vercel tokens and creates resources in your project.
This is third-party code. Review the repository files before installing.
What it does
The skill teaches an agent to write code against the current `@vercel/sandbox` version 2 and to use the `sandbox` CLI. Vercel Sandbox runs arbitrary code in isolated Linux microVMs; since version 2 sandboxes are named and persistent: on stop the filesystem is saved as a snapshot and restored at the next start. The skill reminds the agent that its knowledge of the package may be outdated and points to the current documentation. A reference follows: creating from a git repository, a tarball, a snapshot or a custom image, `Sandbox.getOrCreate`, forking a sandbox (`fork`), running commands including background and root ones, file operations, users and groups, a network policy with full deny, a domain list, credential brokering and request matchers, tags, snapshots, exposed ports, timeouts, error handling and a quick `sandbox` CLI reference.
Who it is for. Teams on Vercel building environments for user or model-written code, preview servers and isolated tests.
Good fit when
- An app runs code written by a user or a model and needs an isolated environment.
- An agent needs a temporary dev server on port 3000 with an open preview link.
- Sandbox state is carried between sessions through snapshots or persistent named sandboxes.
- Sandbox traffic is limited to a domain list while the token for an outside API is injected at the network level.
- Version 1 code is being migrated to version 2 by replacing `sandboxId` with `name`.
Not a fit when
- There is no Vercel account or project: the SDK authenticates with an OIDC token or an access token.
- You need a Docker container on your own server: the microVMs run only in the Vercel cloud.
- The job runs longer than a day: the maximum is 24 hours on Pro and Enterprise, 45 minutes on Hobby.
- More than 15 exposed ports or 5 tags per sandbox are needed: these are platform limits.
Example request
Create a sandbox from the vercel/sandbox-example-next repository, install dependencies, start the dev server and give me a link to port 3000.Limitations
A Vercel project is required: the OIDC token is pulled with `vercel env pull` and lives 12 hours, while outside Vercel an access token works with `VERCEL_TEAM_ID`, `VERCEL_PROJECT_ID` and `VERCEL_TOKEN`. Resources depend on the plan: 4 vCPUs on Hobby, 8 on Pro and 32 on Enterprise, 2048 MB of memory per vCPU. The default timeout is 5 minutes, with a maximum of 24 hours on Pro and Enterprise and 45 minutes on Hobby. The base system is Ubuntu 26.04, and writes go to `/vercel/sandbox` and mounted drives. The skill is written for SDK version 2 and CLI version 3.
How to disable. Delete the `sandbox` folder from the agent's skills directory. Sandboxes already created stay in the Vercel project and are removed with the SDK's `sandbox.delete()`.
FAQ
How do I install the Vercel Sandbox skill in Claude Code?
Run `npx skills add vercel/sandbox`. The package itself is installed separately: `pnpm i @vercel/sandbox` for the SDK and `pnpm i -g sandbox` for the CLI.
How do I authenticate to Vercel Sandbox?
Link the project with `vercel link` and pull a token with `vercel env pull`: the SDK picks up `VERCEL_OIDC_TOKEN` from `.env.local` on its own. For environments without it pass `teamId`, `projectId` and `token` to `Sandbox.create`.
What changed in version 2?
Sandboxes became named and persistent, and `name` replaced `sandboxId`. `getOrCreate`, `fork`, snapshots with retention settings and L7 network rules were added.
How do I run code in a sandbox from the terminal?
Run `sandbox run -- node -e "console.log('hello')"`: the command creates a sandbox and executes the code. The `--rm` flag deletes the sandbox afterwards.
Can an agent run inside a sandbox?
Yes. Commands such as `sandbox create claude`, `sandbox create codex` and `sandbox create opencode` start a coding agent inside the sandbox; an interactive terminal is required.
Discussion
No questions or reviews yet.
Related
SkillsThe sv command runs Claude Code, Codex and other agents in a separate macOS user under sandbox-exec, with no virtual machine.
A self-hosted agent code sandbox on Kubernetes: REST API, MCP server, E2B compatibility and skills for managing it.
A Rust sandbox for parallel coding agents: each gets its own workspace over one shared project, and changes publish as one set.
A Claude Code skill that rolls out AEnvironment platform environments as temporary instances or permanent services
clawk is a virtual-environment CLI that snapshots a Linux machine’s memory and disk so running processes can be resumed later.
AgentBox runs Claude Code, Codex and Open Code in separate virtual machines on your PC, a self-hosted server or a cloud.
README in short
The repository holds two packages, the `@vercel/sandbox` SDK and the `sandbox` CLI, plus images, examples and this skill. Sandboxes run on the same Hive infrastructure that Vercel uses for builds. The license is Apache-2.0.
README badge
Original SKILL.md
---
name: sandbox
description: Creates isolated Linux MicroVMs using Vercel Sandbox SDK. Use when building code execution environments, running untrusted code, spinning up dev servers, testing in isolation, or when the user mentions "sandbox", "microvm", "isolated execution", or "@vercel/sandbox".
metadata:
author: Vercel Inc.
version: "2.0"
---
## _CRITICAL_: Always Use Correct `@vercel/sandbox` Documentation
Your knowledge of `@vercel/sandbox` may be outdated.
Follow these instructions before starting on any sandbox-related tasks:
### Official Resources
- **Documentation**: https://vercel.com/docs/vercel-sandbox
- **SDK Reference**: https://vercel.com/docs/vercel-sandbox/sdk-reference
- **CLI Reference**: https://vercel.com/docs/vercel-sandbox/cli-reference
- **GitHub**: https://github.com/vercel/sandbox
- **REST API**: https://vercel.com/docs/rest-api/sandboxes
### What changed in v2
The `@vercel/sandbox@2` SDK and `sandbox@3` CLI replace anonymous, ephemeral
sandboxes with **named, persistent** sandboxes. Key differences from v1:
- Sandboxes are identified by **`name`** (not `sandboxId`). Names are unique per project.
- Sandboxes are **persistent by default** — when a sandbox stops, the SDK
automatically snapshots it and restores the filesystem on the next resume.
- A **Session** is a single running VM instance inside a sandbox. SDK calls
like `runCommand`, `writeFiles`, etc. automatically resume a stopped sandbox.
- New methods: `Sandbox.getOrCreate`, `Sandbox.fork`, `sandbox.update`,
`sandbox.delete`, `sandbox.listSessions`, `sandbox.listSnapshots`,
`Snapshot.tree`, `defineSandboxProxy`.
- New params: `name`, `persistent`, `tags`, `onResume`, `snapshotExpiration`,
`keepLastSnapshots`, L7 network policy matchers, `forwardURL`.
- Pagination uses **cursor-based** iterators (async-iterable) instead of `since`/`until`.
- `Sandbox.list({ since, until })` → `Sandbox.list({ cursor, namePrefix, sortBy, tags })`.
- v1 sandboxes are backfilled so the only required code change is using `name`
instead of `sandboxId`.
### Quick Reference
**Essential imports:**