---
title: Vercel Sandbox vs Upstash Box
description: Compare Vercel Sandbox and Upstash Box as AI agent sandboxes, including isolation, persistence, network controls, SDKs, and deployment regions.
keywords: ["Vercel Sandbox","Upstash Box","AI agent sandbox","untrusted code execution","Firecracker microVM"]
url: "https://vercel.com/kb/guide/vercel-sandbox-vs-upstash-box"
published: 2026-11-23
last_updated: 2026-11-23
authors: Ben Sabic
related_resources:
  - title: "Vercel Sandbox vs E2B"
    url: "/kb/guide/vercel-sandbox-vs-e2b"
    description: "A detailed guide to Vercel Sandbox vs E2B: compute lifecycle, security controls, code execution, pricing, and when to choose each sandbox for your AI agent workloads."
  - title: "How Vercel Sandbox duration and persistence work"
    url: "/kb/guide/vercel-sandbox-duration-and-persistence"
    description: "Session duration and persistence are two separate controls in Vercel Sandbox. The timeout option keeps a single run alive for up to 24 hours, while snapshots and persistent sandboxes carry state across runs for long-running agents and pipelines."
  - title: "How Vercel Drives work and how to use them"
    url: "/kb/guide/vercel-drives"
    description: "Learn how Vercel Drives give Vercel Sandbox persistent, shareable storage, and how to create, mount, snapshot, fork, list, and delete a drive."
install_vercel_plugin: npx plugins add vercel/vercel-plugin
search_with_vercel_cli: npx vercel@latest kb search "<query>"
read_with_vercel_cli: "npx vercel@latest kb inspect vercel-sandbox-vs-upstash-box"
---

[Vercel Sandbox](https://vercel.com/docs/sandbox) and [Upstash Box](https://upstash.com/docs/box/overall/how-it-works) are AI sandboxes for running generated code in Linux environments. Vercel uses a Firecracker microVM with its own kernel. Upstash uses a container with a separate filesystem, process tree, and network stack.

Choose Vercel Sandbox for dedicated kernels, multiple regions, or request-level credential controls. Choose Upstash Box for its managed coding-agent API or idle-based pausing. Both preserve files between sessions by default.

## How Vercel Sandbox and Upstash Box compare

### Compute and resources

Vercel Sandbox gives each environment a [dedicated guest kernel](https://vercel.com/docs/sandbox/concepts/security). Upstash Box isolates processes and files in a [container](https://upstash.com/docs/box/overall/security). If your requirements call for a separate kernel per tenant, choose Vercel Sandbox for that isolation boundary.

| **Concern**             | **Vercel Sandbox**                                                                                                                                                                                                         | **Upstash Box**                                                                    |
| ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| Isolation               | Firecracker microVM with its own kernel                                                                                                                                                                                    | Docker container with its own filesystem, process tree, and network stack          |
| Base environment        | [Managed images](https://vercel.com/docs/sandbox/concepts/images) built on Ubuntu 26.04 (the default `universal` image has Node.js 24 and Python 3.14) or Arch Linux, or a custom OCI image from Vercel Container Registry | Node.js, Python, Go, Ruby, or Rust runtime on Debian, each with an Alpine variant  |
| vCPUs                   | 1 or even numbers; default 2. Limits: 4 (Hobby), 8 (Pro), 32 (Enterprise).                                                                                                                                                 | Small (2 vCPU, the default), Medium (4 vCPU), or Large (8 vCPU), set at creation   |
| Memory                  | 2 GB per vCPU, up to 8 GB on Hobby, 16 GB on Pro, 64 GB on Enterprise                                                                                                                                                      | 4 GB (Small), 8 GB (Medium), 16 GB (Large)                                         |
| Disk                    | 64 GB NVMe; SDK 3.0.0+ or custom image                                                                                                                                                                                     | See [Box disk limits](https://upstash.com/docs/box/overall/how-it-works#box-size). |
| Concurrent environments | Hobby: 10. Pro and Enterprise: 10,000.                                                                                                                                                                                     | Free: 10. Pay as You Go: 1,000 by default; request a higher limit.                 |
| SDKs and tools          | TypeScript SDK, sync/async Python SDK, Sandbox CLI, and Vercel CLI                                                                                                                                                         | TypeScript SDK, sync/async Python SDK, Box CLI, and SSH                            |
| Authentication          | Project-scoped Vercel OIDC token, or an access token with team and project IDs                                                                                                                                             | Box API key, with optional read-only keys                                          |

Vercel's [higher Enterprise limits](https://vercel.com/docs/sandbox/pricing#resource-limits) accommodate builds or data processing that need more than eight CPU cores or 16 GB of RAM in one environment. Its 64 GB NVMe disk also provides more space for dependencies and build output than [Upstash's 30 GB Large box](https://upstash.com/docs/box/overall/how-it-works#box-size). The 64 GB capacity requires Sandbox SDK 3.0.0+ or a custom image; deprecated runtimes receive 32 GB.

Both products also let you create or branch many environments from one snapshot.

### Lifecycle

Vercel Sandbox sets a time limit for each session. Upstash Box pauses standard boxes after inactivity unless keep-alive mode is enabled.

| **Concern**           | **Vercel Sandbox**                                                                                                                          | **Upstash Box**                                                                 |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| Session end           | Default 5 minutes. Extend to 45 minutes on Hobby or 24 hours on Pro and Enterprise with `sandbox.extendTimeout()`.                          | Idle auto-pause: 1 hour on Free, 6 hours on paid plans                          |
| State kept by default | Filesystem and configuration [snapshotted on stop](https://vercel.com/docs/sandbox/concepts/persistent-sandboxes) by default                | The filesystem and environment are kept while the box is paused                 |
| Running processes     | Not restored on resume                                                                                                                      | Stopped on pause                                                                |
| How it resumes        | An SDK operation that requires a running VM, such as `runCommand()`, starts a new session from the latest snapshot                          | `box.resume()`, new work from the SDK, or an HTTP request to a public URL       |
| Always on             | Not designed to run continuously                                                                                                            | `keepAlive: true` on paid plans; no auto-pause                                  |
| Disposable mode       | `persistent: false` discards the filesystem when the session stops                                                                          | `EphemeralBox`, deleted automatically after a TTL of up to 3 days (the default) |
| Snapshots             | Automatic on stop, or manual with `snapshot()`. They expire 30 days after last use by default, and you can change or remove the expiration. | Manual with `box.snapshot()`, restored with `Box.fromSnapshot()`                |

Restoring an [Upstash snapshot](https://upstash.com/docs/box/overall/snapshots) creates a new box. Reapply its network policy, attached headers, init command, and other lifecycle settings. Provide directly passed agent API keys again; account-stored provider keys can be reused.

Requests to a stopped Vercel Sandbox's public URL return `410 SANDBOX_STOPPED`. Resume it through a supported SDK operation before sending traffic. See how [sessions and saved state](https://vercel.com/docs/sandbox/concepts/persistent-sandboxes) work when the environment stops.

Each vendor publishes its own startup figures, measured in different ways, so time both from the region your application runs in.

### Networking and security

Both products allow outbound access to public internet destinations by default and support policies that restrict it. Upstash Box always blocks private networks and internal infrastructure. Vercel supports additional private-network configurations, so check the relevant network policy and connectivity settings for your workload.

| **Concern**      | **Vercel Sandbox**                                                                                                                        | **Upstash Box**                                                                                                                                                   |
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Egress modes     | [Firewall](https://vercel.com/docs/sandbox/concepts/firewall): `allow-all` (default), `deny-all` (blocks DNS), or custom allow/deny lists | [Network policy](https://upstash.com/docs/box/overall/network-policy) with `allow-all` (default), `deny-all`, and `custom`. Private IP ranges are always blocked. |
| Runtime updates  | Policy updates apply without a process restart                                                                                            | `box.updateNetworkPolicy()` applies to running boxes; excludes `EphemeralBox`                                                                                     |
| Secret injection | Change rules at runtime; match paths, methods, queries, and headers on allowed domains                                                    | `attachHeaders`, matched by host pattern on HTTPS port 443, set at creation and not updated on a running box                                                      |
| Public ports     | Up to 15 ports, each with its own URL that anyone with the URL can reach                                                                  | `box.getPublicURL(port)` supports optional bearer or basic auth                                                                                                   |
| Compliance       | SOC 2 Type II certified infrastructure; snapshots encrypted at rest                                                                       | Upstash describes SOC 2 and HIPAA for Box as in progress                                                                                                          |

Credentials in a sandbox's environment are visible to code running there. Use Vercel's [credential injection rules](https://vercel.com/docs/sandbox/concepts/firewall) or Upstash's [Attach Headers](https://upstash.com/docs/box/overall/attach-headers) to keep supported secrets outside the environment. Code can still make authorized requests, so restrict its destinations and permissions.

### Regions

Vercel Sandbox supports [19 regions](https://vercel.com/docs/sandbox/concepts/regions), with selection per sandbox or project. Its default is `iad1` in Washington, D.C. Upstash Box runs in AWS `us-east-1`. Check that the location meets your latency and data residency requirements.

Vercel's CPU, memory, and data-transfer rates vary by region.

### Core SDK calls

Install and authenticate the SDK before running its example:

- [Vercel Sandbox](https://vercel.com/docs/sandbox/sdk/javascript) reads `VERCEL_OIDC_TOKEN` from the environment.
  
- [Upstash Box](https://upstash.com/docs/box/overall/quickstart) reads `UPSTASH_BOX_API_KEY` from the environment.
  

**Vercel Sandbox**

```javascript
import { Sandbox } from '@vercel/sandbox';

const sandbox = await Sandbox.create();

try {
  const result = await sandbox.runCommand('node', ['--version']);
  console.log(await result.stdout());

  await sandbox.writeFiles([
    { path: 'hello.txt', content: Buffer.from('hi') },
  ]);
  const file = await sandbox.readFileToBuffer({ path: 'hello.txt' });
  console.log(file?.toString());
} finally {
  await sandbox.stop();
}
```

**Upstash Box**

```javascript
import { Box } from "@upstash/box";

const box = await Box.create({ runtime: "node" });

const run = await box.exec.command("node --version");

await box.files.write({
  path: "data.json",
  content: '{"key":"value"}',
});
const content = await box.files.read("data.json");

await box.pause(); // Keeps the filesystem and releases compute
```

`sandbox.stop()` ends the current session. Operations such as `runCommand()` resume a stopped persistent sandbox from its saved state; metadata lookups and configuration updates do not necessarily start a session. `box.pause()` releases Box compute until an explicit resume or new work starts it again. To discard files, create the Vercel sandbox with `persistent: false` or delete the Box.

### Python SDK calls

Vercel's `vercel-sandbox` requires Python 3.11 or later and supports sync and async APIs. Upstash's `upstash-box` provides `Box` and `AsyncBox` clients.

The Vercel excerpt uses its asynchronous interface; the Upstash excerpt uses the synchronous client. Follow the [Vercel Python SDK reference](https://vercel.com/docs/sandbox/sdk/python) or [Upstash quickstart](https://upstash.com/docs/box/overall/quickstart) to install and authenticate the client.

**Vercel Sandbox**

```python
import asyncio

from vercel import sandbox


async def main() -> None:
    box = await sandbox.create_sandbox()

    result = await box.run_command(
        "python", ["--version"], capture_output=True
    )

    await box.fs.write_text("hello.txt", "hi")
    text = await box.fs.read_text("hello.txt")

    await box.stop()


asyncio.run(main())
```

**Upstash Box**

```python
from upstash_box import Box

box = Box.create(runtime="python")

run = box.exec.code(code="print('hello')", lang="python")

box.files.write(path="data.json", content='{"key":"value"}')
content = box.files.read("data.json")

box.pause()
```

To build a code interpreter on Upstash Box, pass the model's script to `box.exec.code()`, which runs a snippet in the language you name. On Vercel Sandbox, write the script with `box.fs.write_text()` and run it with `run_command()`, or pass it to `python -c`.

## Where Vercel Sandbox goes deeper

### Dedicated kernel and root access

Each sandbox has its own kernel, so a process can run with `sudo` while the microVM boundary isolates it from other sandboxes and the host. Supported [system-level operations](https://vercel.com/docs/sandbox/concepts/security) include Docker, VPN access to private networks, and FUSE mounts. In the SDK, pass `sudo: true` to `runCommand()`.

### Private network access

Attach a sandbox to a [Secure Compute network](https://vercel.com/docs/sandbox/concepts/secure-compute) to reach private APIs or databases over configured VPC peering. Public internet traffic leaves through the network's static IPs, which you can allowlist at external services.

Secure Compute is an [additional Enterprise purchase](https://vercel.com/docs/networking/secure-compute). Upstash Box's [network policy](https://upstash.com/docs/box/overall/network-policy) always blocks private IP ranges, even when an allow rule includes them.

### Custom images from Vercel Container Registry

Store your dependencies and tools in a `linux/amd64` OCI image in [Vercel Container Registry](https://vercel.com/docs/sandbox/concepts/images). Sandboxes can start from this image but do not run its `ENTRYPOINT` or `CMD`. Use `runCommand()` to start processes after creation.

### Persistent workspaces with Drives

[Vercel Drives](https://vercel.com/docs/sandbox/concepts/drives) keep working files separate from the sandbox's starting environment. Mount up to four drives for agent workspaces or dependency caches, then reuse those files in later sandboxes without restoring the original environment.

The sandbox and drive must share a region. Each drive allows one writable mount at a time, with read-only snapshots for concurrent readers. Upstash offers [full-workspace snapshots](https://upstash.com/docs/box/overall/snapshots) for saving and cloning an environment.

### Request-level credential injection

Vercel's [credentials brokering](https://vercel.com/docs/sandbox/concepts/firewall) adds secrets to matching outbound requests. Rules can match the path, method, query parameters, and headers. These matchers determine where the credential is injected; separate access or direct-response rules control whether other requests can reach the service.

Network policies can change while code runs, so an agent can begin with outbound access denied and receive access to specific APIs as needed. For domains with request-modifying rules, the firewall decrypts HTTPS and re-encrypts it with a certificate signed by the sandbox's own proxy certificate authority.

For private dependencies, [managed npm credentials](https://vercel.com/docs/sandbox/concepts/credentials) use your team's configured registry credentials, including GitHub Packages and JFrog Artifactory. Set `credentials: { npm: true }` when creating the sandbox. Tokens stay outside the environment and are added to package download requests.

This covers installs, not `npm publish`. Configure the credentials as team Shared Environment Variables and allow the registry hosts in the sandbox's network policy.

Upstash's `attachHeaders` injects secrets outside the container. It matches HTTPS requests by host on port 443, using header values set at creation.

### Separate users for collaborating agents

[Create a Linux user for each agent](https://vercel.com/docs/sandbox/concepts/multi-agent) to give agents separate home directories and file permissions within one sandbox. Both the JavaScript and Python SDKs support users. The JavaScript SDK adds groups with shared workspaces.

Your application retains access to the agents' files. These permissions control file access within a shared microVM; each agent does not receive its own kernel. Run agents in separate sandboxes if they need that isolation boundary.

### Agent framework integrations

eve includes a Vercel Sandbox provider in `eve/sandbox/vercel`. With that provider, sessions run code in Vercel Sandbox and can use supported [Vercel Drive mounts](https://vercel.com/kb/guide/vercel-drives-eve-agent). [Mastra](https://vercel.com/docs/sandbox/ecosystem/mastra) and [Flue](https://vercel.com/docs/sandbox/ecosystem/flue) also provide Vercel Sandbox integrations.

Upstash offers an [eve provider](https://upstash.com/docs/box/guides/eve-setup) through `@upstash/agentkit-eve/sandbox`. Choose the provider based on the sandbox capabilities your agent needs. For example, Box uses `attachHeaders` for credential injection and does not support eve's Vercel-style request-matching firewall rules.

Explore [Sandbox integrations](https://vercel.com/docs/sandbox/ecosystem) for other frameworks. The Sandbox CLI can also run supported coding agents inside a sandbox.

## Where Upstash Box goes deeper

### Built-in coding agents

Upstash Box integrates with Claude Code, Codex, OpenCode, Cursor, and custom agents. Set the agent and model at creation, then send prompts through `box.agent.run()` to use its shell, files, and git operations.

Box also supports schedules and a managed Chromium browser. On Vercel Sandbox, use the Sandbox CLI or a documented integration to run a coding agent; the SDK provides the underlying command and file operations.

### Idle pauses, keep-alive, and disposable boxes

Standard Box environments auto-pause after one hour of inactivity on Free or six hours on paid plans. Choose a lifecycle mode based on how work arrives:

- Standard boxes retain their files and resume when new work arrives.
  
- Keep-alive boxes disable automatic pausing on paid plans. Pause and resume APIs are unavailable in this mode.
  
- `EphemeralBox` environments expire after their TTL. They support commands, files, schedules, and snapshots, but not the agent API, git operations, or public URLs.
  

### Authenticated URLs and automatic resume

Upstash public URLs can require a bearer token, basic authentication, or either. Authenticated requests can resume a paused box. Configure an `initCommand` to start the server again when the box resumes.

After resume and configuration, the proxy waits up to 30 seconds for the port to accept connections. If it stays closed, the response is `503` with `Retry-After: 5`. Set your client timeout to cover the full resume sequence.

Vercel Sandbox port URLs are accessible to anyone who has the URL. Requests to a stopped sandbox do not resume it.

### Read-only access and SSH

Upstash read-only API keys support inspection and restricted command execution without Box API write operations. Commands run as a separate user that cannot write to the workspace, but they still have network access and can read accessible workspace files and other processes' command lines. Grant these keys only to tools that should see that data.

For interactive access, connect over SSH with a Box API key or an SSH key.

## How pricing compares

[Vercel Sandbox](https://vercel.com/docs/sandbox/pricing) and [Upstash Box](https://upstash.com/pricing/box) use different billing models. Upstash's charges also depend on whether a box uses standard or keep-alive mode.

| Product                 | Billing units                                                                                                  |
| ----------------------- | -------------------------------------------------------------------------------------------------------------- |
| Vercel Sandbox          | Active CPU in vCPU-hours, provisioned memory in GB-hours, sandbox creations, and snapshot storage in GB-months |
| Upstash Box, standard   | Active CPU in core-hours and disk storage in GB-months, including snapshots. No separate memory charge.        |
| Upstash Box, keep-alive | Time the box exists, billed per second at a rate determined by size. CPU and storage are included.             |

Vercel also meters internet egress and traffic in both directions through exposed ports in GB, while downloads into the sandbox are free. Vercel Drive usage adds storage in GB-months and reads and writes in GB.

Vercel meters memory while a session waits for a model. Stopping a persistent sandbox ends compute usage but retains billable snapshot storage.

Measure CPU use, session duration, stored data, and transfer for a representative task. Apply the current rates and included allowances for your plan and region.

## Choose by workload requirements

Compare the two agent sandboxes against your implementation requirements:

| Requirement                                         | Product fit    | Reason                                                     |
| --------------------------------------------------- | -------------- | ---------------------------------------------------------- |
| Separate kernel for each tenant                     | Vercel Sandbox | Firecracker microVM isolation                              |
| Docker, VPN clients, or FUSE inside the environment | Vercel Sandbox | System-level access through `sudo`                         |
| Custom OCI starting image                           | Vercel Sandbox | Images from Vercel Container Registry                      |
| Regions beyond AWS us-east-1                        | Vercel Sandbox | Region per sandbox or project                              |
| Credentials restricted by request path or method    | Vercel Sandbox | Request-matching firewall rules that can change at runtime |
| Prompt-driven coding agents through a managed API   | Upstash Box    | Built-in agents exposed through the API                    |
| Idle-based pausing or keep-alive mode               | Upstash Box    | Lifecycle configured around inactivity                     |
| Authenticated preview URLs that resume on request   | Upstash Box    | Public URL authentication and automatic resume             |

For either AI agent sandbox, match the isolation model to your threat model and restrict the files, network destinations, and credentials available to generated code. Framework support alone may not decide the choice: eve supports both.

## Get started with Vercel Sandbox

Before you begin, make sure you have a [Vercel account](https://vercel.com/signup), the [Vercel CLI](https://vercel.com/docs/cli), and Node.js 22 or later. Sandbox is available on Hobby within the included usage.

Connect a directory to a Vercel project, which handles [OIDC token authentication](https://vercel.com/docs/sandbox/concepts/authentication):

```bash
vercel link
```

Pull the project's environment variables into `.env.local`. The development token expires after 12 hours; refresh it with `vercel env pull` if it has expired.

```bash
vercel env pull
```

Install the SDK:

**pnpm**

```bash
pnpm i @vercel/sandbox
```

**npm**

```bash
npm i @vercel/sandbox
```

**yarn**

```bash
yarn add @vercel/sandbox
```

**bun**

```bash
bun add @vercel/sandbox
```

Save the Vercel JavaScript sample from [Core SDK calls](#core-sdk-calls) as `sandbox.mjs` in the linked project directory. Each run creates a new persistent sandbox and counts toward your plan's allowances or billing. Set `persistent: false` in `Sandbox.create()` for a disposable run without snapshot storage.

Run the script with the environment file loaded:

```bash
node --env-file=.env.local sandbox.mjs
```

The script prints the sandbox's Node.js version and `hi`, then stops the session. With default persistence, its files remain in a saved snapshot.

## Start from an eve template

The [eve with Vercel Drives template](https://vercel.com/templates/eve/eve-vercel-drives-starter) lets an agent read and save a team's shared files from Slack or a terminal. Each session gets a sandbox with a read-only Drive snapshot mounted at `/drive`.

The `save_to_drive` tool writes changes through a separate, short-lived sandbox with a read-write mount. Outbound network access is disabled for these sandboxes, keeping their commands from calling external services.

## Next steps

- Choose [how long sessions last and what persists](https://vercel.com/kb/guide/vercel-sandbox-duration-and-persistence)
  
- Restrict egress and broker credentials with the [Sandbox firewall](https://vercel.com/docs/sandbox/concepts/firewall)
  
- Boot from your own image with [custom images](https://vercel.com/docs/sandbox/concepts/images)
  
- Expose a dev server with [public ports](https://vercel.com/docs/sandbox/examples/expose-a-port)
  
- Estimate your bill with [Sandbox pricing and quotas](https://vercel.com/docs/sandbox/pricing)
  
- Compare Vercel Sandbox with [E2B](https://vercel.com/kb/guide/vercel-sandbox-vs-e2b)
  

## Frequently asked questions

### Is Upstash Box a microVM like Vercel Sandbox?

No. Upstash runs every box as its own Docker container with a separate filesystem, process tree, and network stack, and calls this hardened container isolation. Vercel Sandbox boots each sandbox as a Firecracker microVM, so code inside it runs on its own kernel instead of sharing the host's.

### Which should I use for an AI code interpreter?

Choose Vercel Sandbox if your interpreter requires a separate kernel for each execution environment or request-level credential controls. Upstash Box runs scripts directly with `box.exec.code()`. Limit access to sensitive files and external services before running model-generated code.

### Can I run Python in Vercel Sandbox and Upstash Box?

Yes. Vercel's default `universal` image includes Python 3.14, a separate managed image pins Python, and the `vercel-sandbox` SDK lets apps on Python 3.11 or newer create and control sandboxes. Upstash offers a `python` runtime on Debian or Alpine, and the `upstash-box` SDK has synchronous and asynchronous clients.

### Does Upstash Box run outside us-east-1?

No. Every box currently runs in AWS us-east-1. Vercel Sandbox lets you pick from 19 regions for each sandbox, or set a default for the project.

### What happens to my files when a sandbox stops or pauses?

Both products preserve files between ordinary sessions by default. Vercel Sandbox restores its saved snapshot when work resumes, subject to that snapshot's retention settings. Non-persistent sandboxes discard their files on stop. Upstash Box retains its filesystem while paused.

Running processes must be started again after either environment resumes. On Upstash Box, configure an `initCommand` to restart a server; Vercel's lifecycle hooks can perform resume-time setup.

### Can I use Vercel Sandbox with eve, Mastra, or Flue?

Yes. eve includes a Vercel Sandbox provider, Mastra offers `VercelSandbox` from `@mastra/vercel`, and Flue provides `useSandbox()`. These integrations let the framework use Vercel Sandbox for command and file operations. eve also supports Upstash Box, so compatibility alone may not decide the choice.

## Related Resources

- [Vercel Sandbox vs E2B](/kb/guide/vercel-sandbox-vs-e2b): A detailed guide to Vercel Sandbox vs E2B: compute lifecycle, security controls, code execution, pricing, and when to choose each sandbox for your AI agent workloads.
- [How Vercel Sandbox duration and persistence work](/kb/guide/vercel-sandbox-duration-and-persistence): Session duration and persistence are two separate controls in Vercel Sandbox. The timeout option keeps a single run alive for up to 24 hours, while snapshots and persistent sandboxes carry state across runs for long-running agents and pipelines.
- [How Vercel Drives work and how to use them](/kb/guide/vercel-drives): Learn how Vercel Drives give Vercel Sandbox persistent, shareable storage, and how to create, mount, snapshot, fork, list, and delete a drive.

## More Vercel Sandbox guides

- [Add Python code execution to a TypeScript AI agent with Vercel Sandbox](/kb/guide/python-ai-sdk-vercel-sandbox): Add an \`executeCode\` tool to your TypeScript AI SDK agent with the \`ai-sdk-tool-code-execution\` package to run Python 3.13 inside an isolated Vercel Sandbox.
- [Build a v0-style app builder with OpenAI Agents API and Vercel Sandbox](/kb/guide/v0-clone-openai-agents-vercel-sandbox): Build a chat-to-app workspace with live Next.js previews, follow-up edits, and saved projects using the OpenAI Agents API preview, Vercel Sandbox, and Queues.
- [Investigate GitHub issues with \`HarnessAgent\` and Vercel Sandbox](/kb/guide/sandboxed-coding-agent-with-harnessagent): Use HarnessAgent to run coding agent harnesses like Claude Code or Codex against untrusted code inside Vercel Sandbox. Reproduce GitHub issues with the agent harness and generate a report for the maintainer.

## Reference Architecture

Choose a stack and work through the decisions behind it, with curated documentation, guides, templates, and courses to help you build.

- [Agent stack](/kb/architecture/agents): Build and operate agents with models, tools, and durable workflows.
- [Web applications](/kb/architecture/web): Choose rendering, data, authentication, and caching approaches.
- [Backends](/kb/architecture/backends): Choose a runtime, connect services, and run background work.

[Browse all stacks](/kb/architecture)

## Build with prompts

Build an app, extend an agent, or improve your project with ready-to-use prompts for your coding agent.

[Browse the prompt library](/kb/prompts) · [Read the Markdown index](/kb/prompts.md)

## Search guides from your terminal

Search the Knowledge Base and read guides as Markdown with the Vercel CLI. No login required.

```bash
# Find guides by keyword
npx vercel@latest kb search "rewrites and redirects"
npx vercel@latest kb search "AI SDK streaming"

# Show the latest guides
npx vercel@latest kb

# Print a guide as Markdown, by slug or URL
npx vercel@latest kb inspect <guide>
```
