vercel-sandbox
Vercel Sandbox
Vercel Sandbox is a compute primitive for safely running untrusted or user-generated code on Vercel. Each sandbox runs in an isolated Firecracker microVM with its own filesystem and network. It supports Node.js and Python runtimes, snapshotting, persistent sandboxes, and is controlled via a TypeScript/Python SDK or CLI.
Research Process
To answer questions about Vercel Sandbox, spawn a sub-agent to conduct thorough documentation research.
Launch a Research Sub-Agent
Use the Task tool to spawn a sub-agent dedicated to Vercel Sandbox documentation research. Do NOT specify a model (use the default model for comprehensive research quality).
Critical: Provide the sub-agent with a highly detailed prompt that includes:
- Goal - What you are ultimately trying to accomplish
- Context - Why you need this information and how it fits into the larger task
- Specific Questions - Exactly what information you need answered
- Output Requirements - The format and level of detail needed in the response
Task Tool Configuration
Task tool parameters:
- description: "Research Vercel Sandbox docs"
- subagent_type: "generalPurpose"
- model: (DO NOT SPECIFY - use default for thorough research)
- readonly: true
- prompt: (see template below)
Prompt Template for Sub-Agent
Structure your prompt to the research sub-agent as follows:
You are researching Vercel Sandbox documentation to help with a specific task.
## Your Research Goal
[Describe exactly what you need to accomplish with this information]
## Context
[Explain why you need this information and how it will be used]
## Specific Questions to Answer
[List the specific questions that need to be answered]
## Research Process
1. Start by fetching the main overview page:
URL: https://vercel.com/docs/vercel-sandbox.md
Individual doc pages are available by appending .md to the path, e.g.:
https://vercel.com/docs/vercel-sandbox/{page}.md
2. Based on the questions above, identify and fetch the most relevant pages.
The docs are organized as follows:
**Overview & Getting Started:**
- /docs/vercel-sandbox.md - Overview, features, use cases
- /docs/vercel-sandbox/quickstart.md - Step-by-step first sandbox
- /docs/vercel-sandbox/working-with-sandbox.md - Common tasks, long-running tasks, debugging, monitoring, examples
**Concepts:**
- /docs/vercel-sandbox/concepts.md - How sandboxes work, lifecycle, security model, isolation architecture
- /docs/vercel-sandbox/concepts/authentication.md - OIDC tokens vs access tokens
- /docs/vercel-sandbox/concepts/snapshots.md - Save/restore sandbox state
- /docs/vercel-sandbox/concepts/persistent-sandboxes.md - Auto-save state (beta), named sandboxes, sessions
- /docs/vercel-sandbox/concepts/tags.md - Categorize sandboxes with key-value tags (beta)
- /docs/vercel-sandbox/concepts/firewall.md - Network access policies
**Reference:**
- /docs/vercel-sandbox/sdk-reference.md - Full SDK API (TypeScript/Python): Sandbox.create, runCommand, writeFile, etc.
- /docs/vercel-sandbox/cli-reference.md - CLI commands: create, run, connect, cp, stop, snapshot, etc.
- /docs/vercel-sandbox/system-specifications.md - Runtimes (node24, node22, python3.13), packages, sudo config
- /docs/vercel-sandbox/pricing.md - Pricing tiers, resource limits, rate limits, cost examples
**Knowledge Base Examples (vercel.com/kb):**
- /kb/guide/how-to-execute-ai-generated-code-safely - AI code execution
- /kb/guide/how-to-install-system-packages-in-vercel-sandbox - Installing dnf packages
- /kb/guide/using-vercel-sandbox-claude-agent-sdk - Claude Agent SDK integration
- /kb/guide/running-ai-generated-code-sandbox - Running AI code
- /kb/guide/sandbox-private-github-repositories - Private repo access
- /kb/guide/running-openclaw-in-vercel-sandbox - OpenClaw integration
- /kb/guide/running-opencode-securely-with-the-vercel-sandbox - OpenCode integration
- /kb/guide/how-to-reconnect-to-a-running-sandbox - Reconnecting to sandboxes
3. Fetch multiple relevant pages in parallel using WebFetch.
## Required Output
[Specify exactly what format and content you need returned]
Provide a comprehensive response with all findings, including relevant code examples, configuration snippets, and step-by-step instructions where applicable.
Example Usage
If you need to help a user execute AI-generated code safely:
Task tool prompt:
You are researching Vercel Sandbox documentation to help with a specific task.
## Your Research Goal
Find complete instructions for executing AI-generated code safely in a Vercel Sandbox, including SDK setup, authentication, and running arbitrary code.
## Context
A user is building an AI assistant that generates code and needs to execute it in an isolated environment, capture output, and return results to the user.
## Specific Questions to Answer
1. How do you install and authenticate the @vercel/sandbox SDK?
2. How do you create a sandbox and run AI-generated code?
3. How do you capture stdout/stderr from executed commands?
4. How do you manage files in the sandbox filesystem?
5. How do you handle timeouts and cleanup?
## Research Process
1. Fetch https://vercel.com/docs/vercel-sandbox/quickstart.md for setup
2. Fetch https://vercel.com/docs/vercel-sandbox/sdk-reference.md for API details
3. Fetch https://vercel.com/docs/vercel-sandbox/concepts/authentication.md for auth setup
## Required Output
Provide step-by-step integration instructions with code examples for creating sandboxes, writing files, running commands, and capturing output.
Example: Using Snapshots for Fast Startup
Task tool prompt:
You are researching Vercel Sandbox documentation to help with a specific task.
## Your Research Goal
Understand how to use snapshots to speed up sandbox startup by pre-installing dependencies and saving state.
## Context
A user's sandboxes spend significant time installing npm packages on every creation. They want to snapshot a pre-configured environment and reuse it.
## Specific Questions to Answer
1. How do you create a snapshot of a running sandbox?
2. How do you create a new sandbox from a snapshot?
3. How do snapshots interact with persistent sandboxes?
4. What are snapshot expiration limits and storage costs?
5. How do you list and manage snapshots?
## Research Process
1. Fetch https://vercel.com/docs/vercel-sandbox/concepts/snapshots.md
2. Fetch https://vercel.com/docs/vercel-sandbox/concepts/persistent-sandboxes.md
3. Fetch https://vercel.com/docs/vercel-sandbox/pricing.md for limits
## Required Output
Provide a guide to snapshot workflows with SDK and CLI code examples.
Example: Setting Up Persistent Sandboxes
Task tool prompt:
You are researching Vercel Sandbox documentation to help with a specific task.
## Your Research Goal
Learn how to use persistent sandboxes (beta) that auto-save state and resume where they left off, including named sandboxes and session management.
## Context
A user wants to give each of their platform's users a named sandbox that persists between sessions without manual snapshot management.
## Specific Questions to Answer
1. How do persistent sandboxes differ from ephemeral ones?
2. How do you create a named persistent sandbox?
3. How do you resume a stopped sandbox by name?
4. How do sessions work within a persistent sandbox?
5. What are the breaking changes in the beta SDK?
## Research Process
1. Fetch https://vercel.com/docs/vercel-sandbox/concepts/persistent-sandboxes.md
2. Fetch https://vercel.com/docs/vercel-sandbox/sdk-reference.md for API details
## Required Output
Provide a complete guide to persistent sandboxes with SDK and CLI examples, including migration notes from the stable API.
After Receiving Sub-Agent Results
The sub-agent will return comprehensive documentation findings. Use this information to:
- Answer the user's question accurately
- Implement the required functionality
- Provide code examples and configuration directly from official docs
Quick Reference: Common Topics
| Topic | Key Docs |
|---|---|
| Getting Started | /docs/vercel-sandbox/quickstart |
| How Sandboxes Work | /docs/vercel-sandbox/concepts |
| SDK Reference | /docs/vercel-sandbox/sdk-reference |
| CLI Reference | /docs/vercel-sandbox/cli-reference |
| Authentication | /docs/vercel-sandbox/concepts/authentication |
| Snapshots | /docs/vercel-sandbox/concepts/snapshots |
| Persistent Sandboxes | /docs/vercel-sandbox/concepts/persistent-sandboxes |
| Tags | /docs/vercel-sandbox/concepts/tags |
| Firewall | /docs/vercel-sandbox/concepts/firewall |
| System Specs | /docs/vercel-sandbox/system-specifications |
| Common Tasks | /docs/vercel-sandbox/working-with-sandbox |
| Pricing & Limits | /docs/vercel-sandbox/pricing |
Key SDK Methods
| Method | Description |
|---|---|
Sandbox.create() |
Create a new sandbox (options: runtime, timeout, snapshot) |
Sandbox.get() |
Reconnect to a running sandbox by ID or name |
sandbox.runCommand() |
Execute a command (blocking or detached) |
sandbox.writeFile() |
Write content to a file in the sandbox |
sandbox.readFile() |
Read a file from the sandbox |
sandbox.listFiles() |
List files in a directory |
sandbox.uploadFile() |
Upload a local file to the sandbox |
sandbox.downloadFile() |
Download a file from the sandbox |
sandbox.getUrl() |
Get the public URL for an exposed port |
sandbox.snapshot() |
Save sandbox state (stops the sandbox) |
sandbox.stop() |
Stop the sandbox |
sandbox.extendTimeout() |
Extend the running timeout |
Documentation URL
Main documentation: https://vercel.com/docs/vercel-sandbox.md
More from miketromba/skills
railway-cli
Manage Railway cloud deployments via the Railway CLI. Use when the user wants to deploy, manage services, set variables, view logs, link projects, add databases, configure domains, manage volumes, or perform any Railway platform operation from the terminal.
13bun
Bun JavaScript runtime, bundler, package manager, and test runner documentation and guidance. Use when working with Bun - an all-in-one toolkit for developing JavaScript/TypeScript applications. Triggers on questions about Bun runtime, bun install, bun test, bun build, Bun.serve, Bun.file, Bun.spawn, bunfig.toml, Bun APIs, SQLite, S3, Redis, WebSockets, HTTP server, bundler configuration, hot reloading, macros, plugins, or ANY Bun-related development tasks.
8drizzle
Drizzle ORM TypeScript documentation and guidance. Use when working with Drizzle - a lightweight, type-safe TypeScript ORM for PostgreSQL, MySQL, SQLite, SingleStore, and MSSQL. Triggers on questions about Drizzle schema, migrations, drizzle-kit, queries, relations, joins, transactions, RLS, column types, database connections, or ANY Drizzle-related development tasks.
4fumadocs
Fumadocs documentation framework guidance. Use when working with Fumadocs - a flexible docs framework for Next.js, React Router, TanStack Start, and Waku. Triggers on questions about Fumadocs setup, page tree, MDX content source, Fumadocs UI, Fumadocs Core, search integration, OpenAPI docs, internationalization, layouts, components, navigation, deploying, or ANY Fumadocs-related development tasks.
2qa-testing
Autonomously QA and verify the application using browser automation. Use when verifying code changes, testing features, validating bug fixes, or confirming any work done on the application. Triggers on requests to "test this", "verify this works", "QA this change", "make sure it works", or after implementing features that need validation.
2posthog
|
1