vercel-sandbox
Work with Vercel Sandbox — ephemeral Linux microVMs for running untrusted code, AI agent output, and developer experimentation on Vercel. Use this skill when the user mentions "Vercel Sandbox", "@vercel/sandbox", sandbox microVMs, running code in isolated environments on Vercel, or wants to create/manage/snapshot sandboxes via the TypeScript/Python SDK or Vercel CLI. Also trigger when the user asks about sandbox pricing, resource limits, authentication (OIDC tokens, access tokens), system specifications, CLI commands (`vercel sandbox`), or wants to update the local documentation cache for this skill.
安装与使用
请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。
查看来源 ↗使用指南技能说明
Vercel Sandbox Skill
Vercel Sandbox is an ephemeral compute primitive (Beta, all plans) that runs untrusted or user-generated code in isolated Linux microVMs on Vercel. It supports AI agents, code generation tools, developer sandboxes, and backend logic testing.
When to consult reference files
- Getting started / setup: Read references/quickstart.md
- SDK usage (TypeScript): Read references/sdk-reference.md
- CLI commands: Read references/cli-reference.md
- Pricing, limits, resource specs: Read references/pricing-and-specs.md
- Authentication details: Covered in both quickstart and SDK reference files
Quick reference
Install
pnpm i @vercel/sandbox # TypeScript
pip install vercel-sandbox # Python
Authentication setup
vercel link # Link to a Vercel project
vercel env pull # Pull OIDC token to .env.local (expires 12h locally)
Minimal example (TypeScript)
import { Sandbox } from '@vercel/sandbox';
const sandbox = await Sandbox.create();
const result = await sandbox.runCommand('echo', ['Hello from Vercel Sandbox!']);
console.log(await result.stdout());
await sandbox.stop();
Key SDK classes
| Class | Purpose |
|---|---|
Sandbox |
Create, manage, list, snapshot microVMs |
Command |
Interact with running/detached commands |
CommandFinished |
Access exit code, stdout, stderr after completion |
Snapshot |
Save/restore sandbox state for fast restarts |
Available runtimes
node24, node22, python3.13 — all on Amazon Linux 2023.
Default working directory
/vercel/sandbox — user code runs as vercel-sandbox user.
Timeouts
Default 5 min. Max: 45 min (Hobby), 5 hours (Pro/Enterprise). Extend with sandbox.extendTimeout().
Snapshots
Capture with sandbox.snapshot() — sandbox stops after snapshot. Expire after 7 days.
Updating documentation
When the user asks to "update the Vercel Sandbox documentation", choose the right method based on the environment:
Method selection
-
claude.ai / Claude Desktop (has
web_fetchtool) → Use Path A: web_fetch - Claude Code (has bash with internet) → Use Path B: Python script
To detect: if web_fetch is in your available tools, use Path A. Otherwise use Path B.
Path A: web_fetch (claude.ai / Claude Desktop)
- Use
web_fetchto retrieve https://vercel.com/docs/vercel-sandbox (the main page) - Discover all sub-page links under
/docs/vercel-sandbox/ - Fetch each known sub-page URL (see list below) plus any newly discovered pages
- For each reference file in
references/: a. Read the existing file content b. Compare with fetched content — note additions, removals, changes c. Rewrite the reference file with updated, clean markdown d. Update the> Last fetched:date at the top - Report to user: pages fetched, what changed per file, update date
Path B: Python script (Claude Code / local terminal)
Run the update script which has full internet access:
python3 <skill-path>/scripts/update_docs.py <skill-path>/references
The script will:
- Fetch all known sandbox doc URLs from vercel.com
- Discover any new sub-pages from the main page
- For each reference file: compute a diff, overwrite with new content, report changes
- Print a summary of what changed and when
After the script runs, review its output and report changes to the user.
Known doc page URLs
- https://vercel.com/docs/vercel-sandbox (overview + system specs)
- https://vercel.com/docs/vercel-sandbox/quickstart
- https://vercel.com/docs/vercel-sandbox/sdk-reference
- https://vercel.com/docs/vercel-sandbox/cli-reference
- https://vercel.com/docs/vercel-sandbox/pricing
- https://vercel.com/docs/vercel-sandbox/examples
- https://vercel.com/docs/vercel-sandbox/managing
Also discover any new pages linked from the main page's sidebar/navigation.
使用示例
查看来源仓库中的使用示例与配置说明。
查看来源 ↗来源历史
- 收录时间
- 2026-03-11
- 索引更新时间
- 2026-03-11
- Branch
- main
收录与同步日期属于本站记录。源码修改历史请查看来源仓库。
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!