/vercel-sandbox
Vercel Sandbox guidance — ephemeral Firecracker microVMs for running untrusted code safely. Supports AI agents, code generation, and experimentation. Use when executing user-generated or AI-generated code in isolation.
$ npx -y skills add vercel-labs/vercel-plugin --skill vercel-sandbox --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/vercel-sandbox
Context preview
The summary Claude sees to decide when to auto-load this skill.
Vercel Sandbox guidance — ephemeral Firecracker microVMs for running untrusted code safely. Supports AI agents, code generation, and experimentation. Use when executing user-generated or AI-generated code in isolation.
SKILL.md
vercel-sandbox.SKILL.mdname: vercel-sandbox
description: Vercel Sandbox guidance — ephemeral Firecracker microVMs for running untrusted code safely. Supports AI agents, code generation, and experimentation. Use when executing user-generated or AI-generated code in isolation.
metadata:
priority: 4
docs:
- "https://vercel.com/docs/sandbox"
sitemap: "https://vercel.com/sitemap/docs.xml"
pathPatterns: []
importPatterns:
- '@vercel/sandbox'
bashPatterns:
- '\bnpm\s+(install|i|add)\s+[^\n]*@vercel/sandbox\b'
- '\bpnpm\s+(install|i|add)\s+[^\n]*@vercel/sandbox\b'
- '\bbun\s+(install|i|add)\s+[^\n]*@vercel/sandbox\b'
- '\byarn\s+add\s+[^\n]*@vercel/sandbox\b'
promptSignals:
phrases:
- "@vercel/sandbox"
- "sandbox"
- "code sandbox"
- "vercel sandbox"
- "isolated environment"
- "sandboxed execution"
allOf:
- [sandbox, code]
- [sandbox, execute]
- [sandbox, run]
- [sandbox, isolated]
- [sandbox, safe]
- [sandbox, environment]
- [isolated, execute]
- [isolated, code]
- [isolated, environment]
- [isolated, run]
- [safe, execute]
- [safe, code]
- [untrusted, code]
- [untrusted, execute]
- [code, runner]
- [code, playground]
- [execute, safely]
- [run, safely]
- [run, isolation]
- [execute, isolation]
- [ffmpeg, process]
- [ffmpeg, convert]
- [ffmpeg, compress]
- [student, code]
- [student, execute]
- [student, run]
anyOf:
- "sandbox"
- "isolated"
- "isolation"
- "untrusted"
- "safely"
- "microvm"
- "ffmpeg"
- "playground"
noneOf:
- "iframe sandbox"
- "sandbox attribute"
- "codesandbox.io"
- "stackblitz"
minScore: 4
retrieval:
aliases:
- code sandbox
- microvm
- isolated execution
- safe code runner
intents:
- run untrusted code
- execute code safely
- create sandbox
- isolate code execution
entities:
- Vercel Sandbox
- Firecracker
- microVM
- isolated execution
chainTo:
-
pattern: 'from\s+[''""]vm2[''""]|require\s*\(\s*[''""]vm2[''""\)]|new\s+VM\('
targetSkill: vercel-sandbox
message: 'vm2 detected — it has known security vulnerabilities. Reloading Vercel Sandbox guidance for Firecracker microVM-based safe execution.'
-
pattern: 'child_process.*exec\(|execSync\(|spawn\(.*\{.*shell:\s*true'
targetSkill: ai-sdk
message: 'Shell exec for code execution detected — loading AI SDK guidance for tool-calling patterns that pair with Vercel Sandbox for safe agent execution.'Browser Automation with Vercel Sandbox
Run agent-browser + headless Chrome inside ephemeral Vercel Sandbox microVMs. A Linux VM spins up on demand, executes browser commands, and shuts down. Works with any Vercel-deployed framework (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.).
Dependencies
pnpm add @vercel/sandbox
The sandbox VM needs system dependencies for Chromium plus agent-browser itself. Use sandbox snapshots (below) to pre-install everything for sub-second startup.
Core Pattern
import { Sandbox } from "@vercel/sandbox";
// System libraries required by Chromium on the sandbox VM (Amazon Linux / dnf)
const CHROMIUM_SYSTEM_DEPS = [
"nss", "nspr", "libxkbcommon", "atk", "at-spi2-atk", "at-spi2-core",
"libXcomposite", "libXdamage", "libXrandr", "libXfixes", "libXcursor",
"libXi", "libXtst", "libXScrnSaver", "libXext", "mesa-libgbm", "libdrm",
"mesa-libGL", "mesa-libEGL", "cups-libs", "alsa-lib", "pango", "cairo",
"gtk3", "dbus-libs",
];
function getSandboxCredentials() {
if (
process.env.VERCEL_TOKEN &&
process.env.VERCEL_TEAM_ID &&
process.env.VERCEL_PROJECT_ID
) {
return {
token: process.env.VERCEL_TOKEN,
teamId: process.env.VERCEL_TEAM_ID,
projectId: process.env.VERCEL_PROJECT_ID,
};
}
return {};
}
async function withBrowser<T>(
fn: (sandbox: InstanceType<typeof Sandbox>) => Promise<T>,
): Promise<T> {
const snapshotId = process.env.AGENT_BROWSER_SNAPSHOT_ID;
const credentials = getSandboxCredentials();
const sandbox = snapshotId
? await Sandbox.create({
...credentials,
source: { type: "snapshot", snapshotId },
timeout: 120_000,
})
: await Sandbox.create({ ...credentials, runtime: "node24", timeout: 120_000 });
if (!snapshotId) {
await sandbox.runCommand("sh", [
"-c",
`sudo dnf clean all 2>&1 && sudo dnf install -y --skip-broken ${CHROMIUM_SYSTEM_DEPS.join(" ")} 2>&1 && sudo ldconfig 2>&1`,
]);
await sandbox.runCommand("npm", ["install", "-g", "agent-browser"]);
await sandbox.runCommand("npx", ["agent-browser", "install"]);
}
try {
return await fn(sandbox);
} finally {
await sandbox.stop();
}
}Screenshot
The `screenshot --json` command saves to a file and returns the path. Read the file back as base64:
export async function screenshotUrl(url: string) {
return withBrowser(async (sandbox) => {
await sandbox.runCommand("agent-browser", ["open", url]);
const titleResult = await sandbox.runCommand("agent-browser", [
"get", "title", "--json",
]);
const title = JSON.parse(await titleResult.stdout())?.data?.title || url;
const ssResult = await sandbox.runCommand("agent-browser", [
"screenshot", "--json",
]);
const ssPath = JSON.parse(await ssResult.stdout())?.data?.path;
const b64Result = await sandbox.runCommand("base64", ["-w", "0", ssPath]);
const screenshot = (await b64Result.stdout()).trim();
await sandbox.runCommand("agent-browser", ["close"]);
return { title, screenshot };
});
}Accessibility Snapshot
export async function snapshotUrl(url: string) {
return withBrowser(async (sandbox) => {
await sandbox.runCommand("agent-browser", ["open", url]);
const titleResult =Read more
name: vercel-sandbox
description: Vercel Sandbox guidance — ephemeral Firecracker microVMs for running untrusted code safely. Supports AI agents, code generation, and experimentation. Use when executing user-generated or AI-generated code in isolation.
metadata:
priority: 4
docs:
- "https://vercel.com/docs/sandbox"
sitemap: "https://vercel.com/sitemap/docs.xml"
pathPatterns: []
importPatterns:
- '@vercel/sandbox'
bashPatterns:
- '\bnpm\s+(install|i|add)\s+[^\n]*@vercel/sandbox\b'
- '\bpnpm\s+(install|i|add)\s+[^\n]*@vercel/sandbox\b'
- '\bbun\s+(install|i|add)\s+[^\n]*@vercel/sandbox\b'
- '\byarn\s+add\s+[^\n]*@vercel/sandbox\b'
promptSignals:
phrases:
- "@vercel/sandbox"
- "sandbox"
- "code sandbox"
- "vercel sandbox"
- "isolated environment"
- "sandboxed execution"
allOf:
- [sandbox, code]
- [sandbox, execute]
- [sandbox, run]
- [sandbox, isolated]
- [sandbox, safe]
- [sandbox, environment]
- [isolated, execute]
- [isolated, code]
- [isolated, environment]
- [isolated, run]
- [safe, execute]
- [safe, code]
- [untrusted, code]
- [untrusted, execute]
- [code, runner]
- [code, playground]
- [execute, safely]
- [run, safely]
- [run, isolation]
- [execute, isolation]
- [ffmpeg, process]
- [ffmpeg, convert]
- [ffmpeg, compress]
- [student, code]
- [student, execute]
- [student, run]
anyOf:
- "sandbox"
- "isolated"
- "isolation"
- "untrusted"
- "safely"
- "microvm"
- "ffmpeg"
- "playground"
noneOf:
- "iframe sandbox"
- "sandbox attribute"
- "codesandbox.io"
- "stackblitz"
minScore: 4
retrieval:
aliases:
- code sandbox
- microvm
- isolated execution
- safe code runner
intents:
- run untrusted code
- execute code safely
- create sandbox
- isolate code execution
entities:
- Vercel Sandbox
- Firecracker
- microVM
- isolated execution
chainTo:
-
pattern: 'from\s+[''""]vm2[''""]|require\s*\(\s*[''""]vm2[''""\)]|new\s+VM\('
targetSkill: vercel-sandbox
message: 'vm2 detected — it has known security vulnerabilities. Reloading Vercel Sandbox guidance for Firecracker microVM-based safe execution.'
-
pattern: 'child_process.*exec\(|execSync\(|spawn\(.*\{.*shell:\s*true'
targetSkill: ai-sdk
message: 'Shell exec for code execution detected — loading AI SDK guidance for tool-calling patterns that pair with Vercel Sandbox for safe agent execution.'Browser Automation with Vercel Sandbox
Run agent-browser + headless Chrome inside ephemeral Vercel Sandbox microVMs. A Linux VM spins up on demand, executes browser commands, and shuts down. Works with any Vercel-deployed framework (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.).
Dependencies
pnpm add @vercel/sandbox
The sandbox VM needs system dependencies for Chromium plus agent-browser itself. Use sandbox snapshots (below) to pre-install everything for sub-second startup.
Core Pattern
import { Sandbox } from "@vercel/sandbox";
// System libraries required by Chromium on the sandbox VM (Amazon Linux / dnf)
const CHROMIUM_SYSTEM_DEPS = [
"nss", "nspr", "libxkbcommon", "atk", "at-spi2-atk", "at-spi2-core",
"libXcomposite", "libXdamage", "libXrandr", "libXfixes", "libXcursor",
"libXi", "libXtst", "libXScrnSaver", "libXext", "mesa-libgbm", "libdrm",
"mesa-libGL", "mesa-libEGL", "cups-libs", "alsa-lib", "pango", "cairo",
"gtk3", "dbus-libs",
];
function getSandboxCredentials() {
if (
process.env.VERCEL_TOKEN &&
process.env.VERCEL_TEAM_ID &&
process.env.VERCEL_PROJECT_ID
) {
return {
token: process.env.VERCEL_TOKEN,
teamId: process.env.VERCEL_TEAM_ID,
projectId: process.env.VERCEL_PROJECT_ID,
};
}
return {};
}
async function withBrowser<T>(
fn: (sandbox: InstanceType<typeof Sandbox>) => Promise<T>,
): Promise<T> {
const snapshotId = process.env.AGENT_BROWSER_SNAPSHOT_ID;
const credentials = getSandboxCredentials();
const sandbox = snapshotId
? await Sandbox.create({
...credentials,
source: { type: "snapshot", snapshotId },
timeout: 120_000,
})
: await Sandbox.create({ ...credentials, runtime: "node24", timeout: 120_000 });
if (!snapshotId) {
await sandbox.runCommand("sh", [
"-c",
`sudo dnf clean all 2>&1 && sudo dnf install -y --skip-broken ${CHROMIUM_SYSTEM_DEPS.join(" ")} 2>&1 && sudo ldconfig 2>&1`,
]);
await sandbox.runCommand("npm", ["install", "-g", "agent-browser"]);
await sandbox.runCommand("npx", ["agent-browser", "install"]);
}
try {
return await fn(sandbox);
} finally {
await sandbox.stop();
}
}Screenshot
The `screenshot --json` command saves to a file and returns the path. Read the file back as base64:
export async function screenshotUrl(url: string) {
return withBrowser(async (sandbox) => {
await sandbox.runCommand("agent-browser", ["open", url]);
const titleResult = await sandbox.runCommand("agent-browser", [
"get", "title", "--json",
]);
const title = JSON.parse(await titleResult.stdout())?.data?.title || url;
const ssResult = await sandbox.runCommand("agent-browser", [
"screenshot", "--json",
]);
const ssPath = JSON.parse(await ssResult.stdout())?.data?.path;
const b64Result = await sandbox.runCommand("base64", ["-w", "0", ssPath]);
const screenshot = (await b64Result.stdout()).trim();
await sandbox.runCommand("agent-browser", ["close"]);
return { title, screenshot };
});
}Accessibility Snapshot
export async function snapshotUrl(url: string) {
return withBrowser(async (sandbox) => {
await sandbox.runCommand("agent-browser", ["open", url]);
const titleResult =Comprehensive Vercel ecosystem plugin — relational knowledge graph, skills for every major product, specialized agents, and Vercel conventions. Turns any AI agent into a Vercel expert.
Repo: vercel-labs/vercel-plugin
Other skills on vercel.
- /benchmark-agents
Advanced AI agent benchmark scenarios that push Vercel's cutting-edge platform features — Workflow DevKit, AI Gateway, MCP, Chat SDK, Queues, Flags, Sandbox, and multi-agent orchestration. Designed to stress-test skill injection for complex, multi-system builds.
Open skill - /benchmark-e2e
End-to-end benchmark suite for vercel-plugin. Runs realistic projects through skill injection, launches dev servers, verifies everything works, analyzes conversation logs, and produces an improvement report for overnight self-improvement loops.
Open skill - /benchmark-sandbox
Run vercel-plugin eval scenarios in Vercel Sandboxes instead of local WezTerm panels. Provisions ephemeral microVMs with Claude Code + plugin pre-installed, runs benchmark prompts, extracts hook artifacts, and produces coverage reports.
Open skill - /benchmark-testing
Create and launch benchmark test projects to exercise vercel-plugin skill injection across realistic scenarios. Sets up isolated directories, installs the plugin, and spawns WezTerm panes running Claude Code with crafted prompts.
Open skill - /plugin-audit
Audit vercel-plugin performance on real-world projects. Extracts tool calls from Claude Code conversation logs, tests hook matching against actual inputs, identifies pattern coverage gaps, and checks plugin cache staleness. Use when asked to audit, test, or investigate plugin
Open skill - /release
Release vercel-plugin — run gates, bump version, generate artifacts, commit, and push. Use when asked to "release", "ship", "bump and push", or "cut a release".
Open skill

