
This wraps Vercel's Firecracker microVM infrastructure for running untrusted code in ephemeral, isolated environments. The skill focuses heavily on browser automation with agent-browser inside sandboxes, showing you how to take screenshots, grab accessibility snapshots, and run multi-step workflows like form fills. The snapshot feature is clutch: pre-bake a VM image with Chromium and dependencies so your sandbox starts in under a second instead of waiting for dnf installs every time. Use it when you need to execute AI-generated code, process user submissions, or automate headless Chrome tasks without risking your main environment. It chains from vm2 patterns with a security warning and links to AI SDK for tool-calling patterns.
$ npx -y skills add vercel-labs/vercel-plugin --skill vercel-sandbox --agent claude-codeInstalls into .claude/skills of the current project.
Vercel Sandbox runs untrusted or AI-generated code inside an ephemeral Firecracker microVM. You get a real Linux VM with a filesystem and network — created on demand over an API, and stopped (or snapshotted) when you're done. Reach for it when code you don't fully trust needs to run: AI agent tool calls, code generation, user submissions, builds, or experiments.
Do not use in-process sandboxes like vm2 (known escapes) or child_process/eval for untrusted code. Those share your process; a Sandbox is a separate VM.
pnpm add @vercel/sandbox # or npm i / yarn add / bun add
There is also a Python SDK (vercel package, vercel.sandbox) and a sandbox CLI. This skill shows the JS SDK unless noted.
The core loop is create → run → stop. For one-off work, stop in a finally so a thrown error can't leak a running VM (you're billed while it runs). stop() is safe to call more than once.
import { Sandbox } from "@vercel/sandbox";
Sponsors