---
title: Migrate from Daytona to Vercel Sandbox
description: Migrate from Daytona to Vercel Sandbox in TypeScript or Python, including images, persistent files, network policies, and a staged cutover.
keywords: ["Vercel Sandbox","Daytona","migrate from Daytona","AI agent sandbox","sandbox migration","untrusted code execution"]
url: "https://vercel.com/kb/guide/migrate-from-daytona-to-vercel-sandbox"
published: 2026-12-02
last_updated: 2026-12-02
authors: Ben Sabic
related_resources:
  - title: "Vercel Sandbox vs Daytona"
    url: "/kb/guide/vercel-sandbox-vs-daytona"
    description: "Compare Vercel Sandbox and Daytona as AI agent sandboxes, including isolation, persistence, network controls, SDKs, and deployment regions."
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 migrate-from-daytona-to-vercel-sandbox"
---

To move sandbox workloads from [Daytona](https://www.daytona.com/docs) to [Vercel Sandbox](https://vercel.com/docs/sandbox), update your application's sandbox calls to use Vercel's TypeScript or Python SDK. The migration also involves adapting image setup, file persistence, and network rules to preserve the behavior your application needs.

Daytona sandboxes are ephemeral unless you create them with `persistent: true`. Vercel preserves files by default when a persistent sandbox stops, but your application must restart its processes when resuming it by name. Review the [migration limitations](#what-doesn%27t-map-from-daytona) before starting, especially if your application also relies on paused sandboxes, memory snapshots, private preview URLs, or Daytona's desktop.

You can use Vercel Sandbox from an application on any host. Your backend connects through the SDK using [Vercel credentials](https://vercel.com/docs/sandbox/concepts/authentication), while sandboxed code runs on Vercel's infrastructure. Your application can stay with its current hosting provider.

Daytona's [v2 platform](https://www.daytona.com/changelog/daytona-2-0) has a separate API and resource model from v0. These samples use SDK 2.x through `daytona.v2`. For an application on v0, use the SDK 0.x translation in step 1 before following the migration steps.

## Prerequisites

Before you begin, make sure you have a [Vercel account](https://vercel.com/signup) ready. For local development, use Node.js 24+ (or Python 3.11+) and the latest [Vercel CLI](https://vercel.com/docs/cli).

## Migrate with your agent

Use this prompt in your application's repository to have a coding agent check where Daytona is used and prepare the migration:

### Agent prompt

```txt
Migrate this codebase from Daytona to Vercel Sandbox.

1. Read and follow the migration guide using the Vercel CLI: `npx vercel@latest kb inspect migrate-from-daytona-to-vercel-sandbox`.
2. Inventory Daytona imports and call sites, including images, commands, code runs, files, Git operations, snapshots, forks, volumes, preview URLs, secrets, network policies, lifecycle policies, and resource settings. Record whether each call targets Daytona v2 (`daytona.v2`) or Daytona v0. Preserve the application's language and authorization checks.
3. Identify features that need a different design, including paused sandboxes, memory snapshots and forks, CPU guarantees below one core and bursting, arm64 images, idle timeouts, wake on request, private or signed preview URLs, TCP and UDP port forwarding, code-execution kernels, Git methods, sessions, PTY, SSH, the desktop and Computer Use API, bucket volumes, GPU and Windows sandboxes, macOS sandboxes, and Bring Your Own Compute. Ask for a decision only where that choice blocks implementation.
4. Keep both providers behind one application module. Select the provider for each new agent session and retain that choice for the session's lifetime. Keep the Daytona path available until I approve cutover.
5. Port one call site at a time. Check units, paths, users, shell use, combined output, cleanup, and persistence against the guide and the SDK references: https://vercel.com/docs/sandbox/sdk/javascript and https://vercel.com/docs/sandbox/sdk/python
6. Plan how to stop writes, export and verify files, release writable mounts, and reconcile changes if we roll back. Do not delete Daytona data or revoke credentials.
7. Run local checks first. Describe any live test and the resources it creates before running it. Report the results, remaining configuration, and cutover plan. Do not switch production traffic without my approval.
```

## How Daytona features map to Vercel Sandbox

Daytona projects map to Vercel projects, registered images map to Vercel images, and Vercel's default persistence replaces `persistent: true` and its stop and start calls. Other features, such as pauses that keep memory and private preview URLs, require a [different approach](#what-doesn%27t-map-from-daytona). Before migrating, [compare Vercel Sandbox and Daytona](https://vercel.com/kb/guide/vercel-sandbox-vs-daytona) for your workload.

You can keep using TypeScript or Python. The mappings use TypeScript names for both SDKs, with Daytona names from SDK 2.x; [step 5](#5.-replace-sandbox-creation,-commands,-and-file-operations) lists the Python names, and [step 1](#translate-sdk-0.x-names) translates SDK 0.x names. Both products have an Enterprise plan, so plan names in this guide refer to Vercel unless the sentence names Daytona.

### Projects, images, and compute

Replace the Daytona project and its API key with a Vercel project, and select a Vercel image in place of a registered Daytona image.

| Daytona                                                                                                                                                                                        | Vercel Sandbox                                                                                                                             | What you change                                                                                                                                                                                                        |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Project, selected by its API key                                                                                                                                                               | Vercel project                                                                                                                             | Each sandbox belongs to the project that issued its credentials.                                                                                                                                                       |
| Project API key in `DAYTONA_API_KEY`                                                                                                                                                           | [OIDC token](https://vercel.com/docs/sandbox/concepts/authentication) in `VERCEL_OIDC_TOKEN`, or an access token with team and project IDs | Run `vercel link` and `vercel env pull` for local development.                                                                                                                                                         |
| [Image](https://www.daytona.com/docs/images) registered in the project, which is the `daytona-base` default or one pulled from a registry, built from a Dockerfile, or captured from a sandbox | [Managed image](https://vercel.com/docs/sandbox/concepts/images), or a custom OCI image in Vercel Container Registry                       | Build or push custom images to Vercel Container Registry. Pass the image as the `image` option instead of the first argument.                                                                                          |
| Image `ENTRYPOINT` and `CMD`, which run when a sandbox starts                                                                                                                                  | `runCommand()` with `detached: true`                                                                                                       | Vercel Sandbox doesn't run an image's `ENTRYPOINT` or `CMD`. Start the process after creation and after each resume, then check that it's ready.                                                                       |
| `resources`, with `cpu`, `memory`, and `disk` guarantees and `cpuMax`, `memoryMax`, and `diskMax` limits, in cores and GiB                                                                     | `resources.vcpus`, with 2 GB of memory per vCPU                                                                                            | Daytona's SDK expresses CPU in cores, and the sandbox's guest CPU count is twice its CPU limit. Size Vercel's fixed allocation for peak CPU and memory use.                                                            |
| `region`, with a broad value such as `earth` or `us`, or a narrow value such as `us-east`                                                                                                      | `region`, with one of [19 region IDs](https://vercel.com/docs/sandbox/concepts/regions) such as `iad1`                                     | Choose a region for each sandbox or set a project default. Snapshots and Drives use the main region; configured [failover](https://vercel.com/docs/sandbox/concepts/regions#failover-regions) can load them elsewhere. |
| Commands run through `bash` or `sh` as `root` in `/root` on the base image                                                                                                                     | Commands run without a shell as the image's default user, which is `ubuntu` or `arch` on managed images, in `/vercel`                      | Use `bash -c` for shell syntax and `sudo: true` for root commands. Update absolute paths.                                                                                                                              |
| Sandbox ID from `sandbox.id`                                                                                                                                                                   | Sandbox `name`                                                                                                                             | Choose a name at creation and store it in place of the ID.                                                                                                                                                             |
| Up to 100 `labels`                                                                                                                                                                             | Up to five `tags`                                                                                                                          | Use tags for filtering. Store additional metadata in your application database, keyed by sandbox name.                                                                                                                 |

### Lifecycle and state

Vercel saves a persistent sandbox's filesystem when it stops. Use its name to find the sandbox later and resume it from that saved state.

| Daytona                                                                                                       | Vercel Sandbox                                                                                                   | What you change                                                                                                                           |
| ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| `lifecyclePolicy.timeoutSeconds`, reset with `updateLifecyclePolicy()`                                        | `timeout`, extended with `extendTimeout()`                                                                       | Convert seconds to milliseconds in TypeScript. `extendTimeout()` adds time to the session and can't set a new deadline measured from now. |
| `lifecyclePolicy.idleExpirySeconds` with `onIdleTimeout`                                                      | No equivalent                                                                                                    | Vercel Sandbox has no idle timeout, so stop the sandbox from your code.                                                                   |
| Session of up to 24 hours on Daytona Starter, or 48 hours on Daytona Team                                     | Session of up to 45 minutes on Hobby, or 24 hours on Pro and Enterprise                                          | Persistent sandboxes span multiple sessions.                                                                                              |
| Ephemeral by default, with `persistent: true` to keep the disk                                                | Persistent by default                                                                                            | Remove `persistent: true`. Pass `persistent: false` for sandboxes that were ephemeral on Daytona.                                         |
| `sandbox.stop()` and `sandbox.start()`, which keep the disk                                                   | `sandbox.stop()`, which saves the filesystem                                                                     | Remove the `start()` calls. The next command resumes a stopped sandbox.                                                                   |
| `sandbox.pause()`, or a timeout whose `onTimeout` is `pause`, which keep files, memory, and running processes | Automatic snapshot on stop, which keeps files                                                                    | Remove the pause and resume calls. After each resume, restart processes, for example with the TypeScript SDK's `onResume` hook.           |
| `daytona.v2.delete(sandbox)`, which discards the sandbox's files                                              | `stop()` saves files; `delete()` deletes the sandbox                                                             | Pass `persistent: false` for disposable sandboxes.                                                                                        |
| `daytona.v2.get(id)` and `daytona.v2.findByName(name)`                                                        | `Sandbox.get({ name })`                                                                                          | Look up sandboxes by name. Daytona names aren't unique, and Vercel names are unique within a project.                                     |
| `lifecyclePolicy.wakeOnRequest`, on authenticated toolbox, SSH, and private-preview requests                  | Resume on SDK operations such as `runCommand()`                                                                  | Requests to a stopped sandbox's URL return HTTP 410. Resume the sandbox from your backend first.                                          |
| `sandbox.captureImage()` for files, or `sandbox.createSnapshot()` for memory and disk                         | `sandbox.snapshot()`, then a snapshot source                                                                     | `snapshot()` stops the session, and a snapshot holds files only.                                                                          |
| `sandbox.fork()`, which copies the disk and, by default, memory and running processes                         | `Sandbox.fork()`                                                                                                 | Each fork starts from the source sandbox's latest saved snapshot. Start processes in each fork.                                           |
| [Volumes](https://www.daytona.com/docs/volumes), up to eight for each sandbox                                 | [Drives](https://vercel.com/docs/sandbox/concepts/drives), up to four for each sandbox                           | Each Drive allows one writable mount. Match the sandbox's main region to the Drive's region.                                              |
| Bucket volumes backed by object storage                                                                       | [FUSE mount](https://vercel.com/docs/sandbox/examples/mount-remote-storage) from a custom image, or copied files | Install a FUSE client in your image, or copy a fixed set of files into the sandbox. See the bucket volumes section below.                 |

### Networking and secrets

The firewall's `networkPolicy` option replaces Daytona's network policy, and public port URLs replace preview URLs.

| Daytona                                                                                                                                     | Vercel Sandbox                                                                                          | What you change                                                                                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `sandbox.ports.expose(port)` and `sandbox.ports.previewLink(port)`, on any port after creation                                              | `ports` and `sandbox.domain(port)`                                                                      | List up to 15 ports at creation. `sandbox.update({ ports })` replaces the list.                                                                                   |
| Private preview URLs with the `X-Daytona-Preview-Token` header, and signed links that expire                                                | No equivalent                                                                                           | Anyone with a port's URL can reach it. Authenticate callers in the server that runs inside the sandbox.                                                           |
| `networkPolicy: { blockAll: true }`                                                                                                         | `networkPolicy: 'deny-all'`                                                                             | Both policies also block DNS.                                                                                                                                     |
| `networkPolicy.allowDomains`                                                                                                                | `networkPolicy: { allow: [...] }`                                                                       | On both products, `*.example.com` doesn't match `example.com`.                                                                                                    |
| `networkPolicy.allowCidrs`, for public IPv4 ranges                                                                                          | `networkPolicy: { subnets: { allow: [...] } }`                                                          | Vercel also has `subnets.deny`, and denied CIDR ranges take precedence over allowed domains and ranges.                                                           |
| `sandbox.updateNetworkPolicy()` and `sandbox.resetNetworkPolicy()`, with the current `etag`                                                 | `sandbox.update({ networkPolicy })`                                                                     | Each update replaces the whole policy on both products. Remove the `etag` read.                                                                                   |
| `env`, at creation or for each command                                                                                                      | `env`, at creation or for each command                                                                  | Keep the option name.                                                                                                                                             |
| [Secrets](https://www.daytona.com/docs/secrets), stored in the project and swapped in by an outbound proxy on each secret's allowed domains | [Brokering rules](https://vercel.com/docs/sandbox/concepts/firewall) with `transform`                   | Pass the secret's value from your application. Vercel rules can also match on path, method, query, and headers.                                                   |
| Port forwarding with the `ports` create option, for TCP and UDP                                                                             | No equivalent                                                                                           | Vercel port URLs support HTTP and WebSocket traffic.                                                                                                              |
| [VPN client](https://www.daytona.com/docs/vpn-connections) that runs inside the sandbox                                                     | [Secure Compute](https://vercel.com/docs/sandbox/concepts/secure-compute) network, set with `networkId` | Secure Compute is an additional Enterprise purchase. You can also run the same VPN client inside a Vercel sandbox. Start it after creation and after each resume. |

## Steps

### 1\. Find where your application uses Daytona

Search for Daytona imports, call sites, and environment variables, then trace aliases through your code. Match each result to a migration step or replacement feature.

```bash
grep -rni 'daytona' \
  --include="*.py" --include="*.ts" --include="*.tsx" \
  --include="*.mts" --include="*.cts" \
  --include="*.js" --include="*.jsx" \
  --include="*.mjs" --include="*.cjs" \
  --exclude-dir=node_modules --exclude-dir=.venv \
  --exclude-dir=venv .
```

The search finds both SDK generations: `@daytona/sdk` and `@daytonaio/sdk` in JavaScript, and `daytona` and `daytona_sdk` in Python. It also matches `DAYTONA_*` environment variables in those source files. Trace the returned sandbox handles to find calls such as `sandbox.exec()` that don't contain the provider's name.

Check `.env` files, `package.json`, and `requirements.txt` or `pyproject.toml` for the Daytona dependency and `DAYTONA_API_KEY`. Then inspect scripts and CI jobs for `daytona sandbox`, `daytona image`, and `daytona volume` commands, and match what you find to the migration steps:

| In your code                                                                                                                                                                                | Go to                                                                              |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `daytona.v2.images`, `ImageBuilder`, `createFromBuild()`, `captureImage()`, or an image name passed to `daytona.v2.create()`                                                                | [Step 4](#4.-move-your-daytona-image-to-a-vercel-image)                            |
| `daytona.v2.create()`, `exec()`, `process.run()`, `process.start()`, or `sandbox.fs`                                                                                                        | [Step 5](#5.-replace-sandbox-creation,-commands,-and-file-operations)              |
| `persistent: true`, `stop()`, `start()`, `findByName()`, `fork()`, or `createFromSnapshot()`                                                                                                | [Step 6](#6.-replace-stop-and-start-with-named-sandboxes)                          |
| `daytona.v2.volumes` or the `volumes` option                                                                                                                                                | [Step 7](#7.-move-volumes-to-drives)                                               |
| `sandbox.ports.expose()` or `sandbox.ports.previewLink()`                                                                                                                                   | [Step 8](#8.-replace-preview-urls-with-public-ports)                               |
| `networkPolicy`, `updateNetworkPolicy()`, `env`, `secrets`, or `daytona.v2.secrets`                                                                                                         | [Step 9](#9.-replace-daytona-network-policies,-environment-variables,-and-secrets) |
| `pause()`, `createSnapshot()`, `idleExpirySeconds`, `wakeOnRequest`, `signedPreviewLink()`, `runCode()`, `sandbox.git`, `createSession()`, `sandbox.pty`, `computerUse`, or `createMacos()` | [What doesn't map from Daytona](#what-doesn%27t-map-from-daytona)                  |

#### Translate SDK 0.x names

Daytona's SDKs have two incompatible generations, and this guide maps the 2.x names. SDK 0.x calls Daytona v0. SDK 2.x calls Daytona v2 through `daytona.v2`, and Daytona v0 through `daytona.v0`. Code that imports `@daytonaio/sdk` or `daytona_sdk`, calls `daytona.create()` without a namespace, or calls `daytona.v0` uses the 0.x names. Translate these common 0.x names:

| SDK 0.x                                                                          | SDK 2.x                                                                                                                   | Vercel Sandbox                                                                          |
| -------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- |
| `daytona.create()` with a `snapshot` or `image`                                  | `daytona.v2.create()` with a registered image                                                                             | `Sandbox.create()` with an `image`                                                      |
| Snapshots, the images that sandboxes start from, and `daytona.snapshot.create()` | Images and `daytona.v2.images`                                                                                            | A managed or custom image                                                               |
| `envVars`                                                                        | `env`                                                                                                                     | `env`                                                                                   |
| `target`                                                                         | `region`                                                                                                                  | `region`                                                                                |
| `ephemeral: true`                                                                | The default. `persistent: true` keeps the disk.                                                                           | `persistent: false`                                                                     |
| `autoStopInterval`, in minutes                                                   | `lifecyclePolicy.idleExpirySeconds` with `onIdleTimeout: 'stop'`                                                          | No equivalent. Stop the sandbox from your code.                                         |
| `autoArchiveInterval`, `autoDeleteInterval`, and `sandbox.archive()`             | No equivalent                                                                                                             | `snapshotExpiration` to limit how long Vercel keeps saved files, and `sandbox.delete()` |
| `process.executeCommand()` and `response.result`                                 | `exec()` and `result.output`                                                                                              | `runCommand()` and `await result.output('both')`                                        |
| `process.codeRun()`                                                              | `runCode()`                                                                                                               | `writeFiles()`, then `runCommand()`                                                     |
| `process.createSession()` and `process.executeSessionCommand()`                  | `process.createSession()` and `session.run()`                                                                             | `cwd` and `env` on each `runCommand()`                                                  |
| `fs.uploadFile()` and `fs.downloadFile()`                                        | `fs.uploadFile()` and `fs.downloadFile()` with a local path, or `fs.writeBytes()` and `fs.readBytes()` for data in memory | `writeFiles()` and `readFileToBuffer()`                                                 |
| `fs.listFiles()`, `fs.createFolder()`, and `fs.deleteFile()`                     | `fs.list()`, `fs.mkdir()`, and `fs.remove()`                                                                              | `fs.readdir()`, `fs.mkdir()`, and `fs.rm()`                                             |
| `daytona.get(idOrName)`                                                          | `daytona.v2.get(id)` or `daytona.v2.findByName(name)`                                                                     | `Sandbox.get({ name })`                                                                 |
| `daytona.list()`                                                                 | `daytona.v2.search()`                                                                                                     | `Sandbox.list()`                                                                        |
| `sandbox.getPreviewLink(port)`                                                   | `sandbox.ports.previewLink(port)`                                                                                         | `sandbox.domain(port)`                                                                  |
| `sandbox.setPublic()`                                                            | `sandbox.ports.expose(port, { public: true })`                                                                            | `ports` at creation                                                                     |
| `networkBlockAll`, `domainAllowList`, and `networkAllowList`                     | `networkPolicy`, with `blockAll`, `allowDomains`, and `allowCidrs`                                                        | `networkPolicy`, as shown in step 9                                                     |
| `sandbox.createSnapshot()`                                                       | `sandbox.captureImage()`                                                                                                  | `sandbox.snapshot()`                                                                    |

Daytona v0 defaults to stopping after 15 idle minutes, or pausing after 60 idle minutes on sandbox classes that support pausing. Vercel's default session ends 5 minutes after startup, so set `timeout` to cover the expected work.

For the exports in steps 6 and 7, retrieve the v0 sandbox with `daytona.get()` in SDK 0.x or `daytona.v0.get()` in SDK 2.x. Start a stopped or archived sandbox before reading its files, and keep the archive and download calls on that v0 handle:

- In TypeScript, run the archive command with `process.executeCommand()` and download it with `fs.downloadFile()`.
  
- In Python, use `process.exec()` and `fs.download_file()`. The Python SDKs otherwise use the snake\_case forms of the names in the table; `process.exec()` is the command-method exception in SDK 0.x.
  

### 2\. Link a Vercel project and authenticate

Vercel Sandbox supports OpenID Connect (OIDC) tokens and access tokens. Link your local directory to the project that will own your sandboxes:

```bash
vercel link
```

Save the environment variables and development OIDC token to `.env.local`:

```bash
vercel env pull
```

For local runs, load `.env.local` with Node.js's `--env-file=.env.local` option or Python's `python-dotenv`. Refresh development OIDC tokens every 12 hours with `vercel env pull`; Vercel manages tokens for deployed applications.

For a backend hosted elsewhere, create a [Vercel access token](https://vercel.com/docs/accounts/access-tokens#create-an-access-token) and copy your [team ID](https://vercel.com/docs/accounts#find-your-team-id) and [project ID](https://vercel.com/docs/project-configuration/general-settings#project-id). Save them as environment variables and pass them to the SDK:

```javascript
const credentials = {
  token: process.env.VERCEL_TOKEN,
  teamId: process.env.VERCEL_TEAM_ID,
  projectId: process.env.VERCEL_PROJECT_ID,
};

const sandbox = await Sandbox.create({ ...credentials });
```

The TypeScript SDK doesn't read these variables on its own. Pass all three fields to every static call, including `Sandbox.get()`, `Sandbox.getOrCreate()`, `Sandbox.fork()`, and `Sandbox.list()`. Methods on a returned sandbox reuse its credentials. The later samples omit these fields because they assume an OIDC token.

Without an OIDC token, the Python SDK reads these variables automatically from the environment of each Python process.

Keep your Daytona API key until the migrated workloads pass verification. Retain the keys used by workloads remaining on Daytona.

### 3\. Install the Vercel Sandbox SDK

Install `@vercel/sandbox` for TypeScript and JavaScript:

**pnpm**

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

**npm**

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

**yarn**

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

**bun**

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

For Python, install `vercel-sandbox` and `python-dotenv` to load local credentials:

**uv**

```bash
uv add vercel-sandbox python-dotenv
```

**pip**

```bash
pip install vercel-sandbox python-dotenv
```

Keep the Daytona SDK package until no workloads use it.

### 4\. Move your Daytona image to a Vercel image

Replace your Daytona image with a Vercel [managed image](https://vercel.com/docs/sandbox/concepts/images) or a custom image in Vercel Container Registry. Choose based on how you registered the image:

| Daytona image                                                                                    | Vercel replacement                                                                                                                                                                                                                                                                              |
| ------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| The default `daytona-base` image, or a stock Python or Node.js image pulled with `images.pull()` | A managed image such as `vercel/sandbox/python:3.14` or `vercel/sandbox/node:24`. With no `image`, a sandbox uses `vercel/sandbox/universal`, which includes current Node.js LTS and Python versions. Build a custom image if the required runtime version is not available as a managed image. |
| `ImageBuilder` calls such as `pipInstall()`, `runCommands()`, and `env()`                        | A Dockerfile with the matching `RUN` and `ENV` instructions, built into Vercel Container Registry                                                                                                                                                                                               |
| `ImageBuilder.fromDockerfile()`, `images.buildFromContext()`, or `daytona image build`           | The same Dockerfile instructions, built into Vercel Container Registry                                                                                                                                                                                                                          |
| `images.pull()` with another image from a registry                                               | Push the existing `linux/amd64` image to Vercel Container Registry, or build a Dockerfile whose `FROM` instruction names it.                                                                                                                                                                    |
| `sandbox.captureImage()`                                                                         | A Dockerfile that reproduces the sandbox's setup, or a Vercel snapshot as shown in step 6                                                                                                                                                                                                       |
| An image name passed to `daytona.v2.create()`                                                    | A repository and tag in Vercel Container Registry, passed as `image`                                                                                                                                                                                                                            |
| An image `ENTRYPOINT` or `CMD`                                                                   | A detached `runCommand()` after creation and after each resume, followed by a readiness check                                                                                                                                                                                                   |

If a managed image meets your needs, continue to step 5. For a custom image, install Docker and put the image's build steps in a Dockerfile. This Daytona image installs Git and pandas on a Python image:

```javascript
import { Daytona } from '@daytona/sdk';
import { ImageBuilder } from '@daytona/sdk/v2';

const daytona = new Daytona();

let image = await daytona.v2.images.build(
  ImageBuilder.fromRegistry('python:3.13-slim')
    .runCommands('apt-get update && apt-get install -y git')
    .pipInstall('pandas')
    .workdir('/workspace'),
  { name: 'agent-runtime' },
);
while (image.status !== 'ready' && image.status !== 'failed') {
  image = await daytona.v2.images.get(image.id, { wait: 'ready' });
}

if (image.status !== 'ready') {
  throw new Error(image.error || `Image build ended in ${image.status}`);
}

const sandbox = await daytona.v2.create('agent-runtime');
```

`createFromBuild()` builds the same `ImageBuilder` definition and creates a sandbox in one call. Both Daytona approaches map to this Dockerfile, which preserves the base image and build steps:

```docker
FROM python:3.13-slim
RUN apt-get update && apt-get install -y git
RUN pip install pandas
WORKDIR /workspace
```

Log in, then build and push the image from the linked project:

```bash
vercel vcr login docker
vercel vcr build docker . agent-runtime:latest --push
```

Wait for Ready on the registry repository's details page before creating a sandbox. Creation fails with `image_not_ready` while the image is being prepared. Pass the repository and tag as `image`:

**Vercel Sandbox (TypeScript)**

```javascript
const sandbox = await Sandbox.create({ image: 'agent-runtime:latest' });
```

**Vercel Sandbox (Python)**

```python
box = await sandbox.create_sandbox(image="agent-runtime:latest")
```

Check these differences from Daytona images:

- Rebuild `arm64` images for `linux/amd64`, the architecture Vercel Sandbox requires. Daytona selects `amd64` or `arm64` with `cpuArch`.
  
- Start an image's `ENTRYPOINT` and `CMD` through a detached `runCommand()` after creation and each resume. Daytona starts them automatically; Vercel requires your application to start them and check readiness.
  
- Convert Daytona's CPU and memory guarantees to a Vercel size through `resources.vcpus`. Each Vercel vCPU includes 2 GB of memory.
  
- Check the image's user and working directory. Daytona's base image uses `root` in `/root`; other images use their `USER` and `WORKDIR`. Custom Vercel images use the configured user and `WORKDIR`, defaulting to `/` when no working directory is set. Vercel managed images use `/vercel`.
  
- Keep each image within 15 GB and each compressed layer within 2 GB.
  

For an Ubuntu-based managed image, update the package index before installing packages with `apt-get` and `sudo`:

```javascript
await sandbox.runCommand({ cmd: 'apt-get', args: ['update'], sudo: true });
await sandbox.runCommand({
  cmd: 'apt-get',
  args: ['install', '-y', 'git'],
  sudo: true,
});
```

Installed packages remain across persistent sessions. Use the package manager supplied by your image when running Arch or a custom image.

### 5\. Replace sandbox creation, commands, and file operations

Replace Daytona's creation, command, and file calls with the corresponding Vercel methods. `Sandbox.create()` uses project credentials and an `image` option instead of an API key and an image argument.

Route every sandbox operation through one module in your application, and add a flag that selects Daytona or Vercel for each new agent session. Add the Vercel calls beside the Daytona calls, and keep the Daytona path until step 10.

#### TypeScript SDK calls

| Task                          | Daytona                                                                  | Vercel Sandbox                                                                         |
| ----------------------------- | ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------- |
| Import                        | `Daytona` from `@daytona/sdk`                                            | `Sandbox` from `@vercel/sandbox`                                                       |
| Create a client               | `new Daytona()`                                                          | No client object                                                                       |
| Create a sandbox              | `daytona.v2.create()`                                                    | `Sandbox.create()`                                                                     |
| Set the lifetime              | `lifecyclePolicy.timeoutSeconds`                                         | `timeout`, in milliseconds                                                             |
| Set resources                 | `resources`, with `cpu` and `memory`                                     | `resources: { vcpus }`                                                                 |
| Set environment variables     | `env`                                                                    | `env`                                                                                  |
| Run a command                 | `sandbox.exec()` or `sandbox.process.run()`                              | `sandbox.runCommand()`                                                                 |
| Read output                   | `result.output` for both streams, or `result.stdout` and `result.stderr` | `await result.output('both')`, or `await result.stdout()` and `await result.stderr()`  |
| Get the exit code             | `result.exitCode`                                                        | `result.exitCode`                                                                      |
| Run in the background         | `sandbox.process.start()`                                                | `runCommand()` with `detached: true`                                                   |
| Run a code snippet            | `sandbox.runCode()`                                                      | `writeFiles()`, then `runCommand()`                                                    |
| Write a file                  | `sandbox.fs.writeText(path, text)`                                       | `sandbox.writeFiles([{ path, content }])`                                              |
| Read a file                   | `sandbox.fs.readText(path)`                                              | `sandbox.fs.readFile(path, 'utf8')`, or `sandbox.readFileToBuffer({ path })` for bytes |
| List, create, or remove paths | `fs.list()`, `fs.mkdir()`, and `fs.remove()`                             | `sandbox.fs.readdir()`, `sandbox.fs.mkdir()`, and `sandbox.fs.rm()`                    |
| Clone a repository            | `sandbox.git.clone()`                                                    | A `git` source at creation                                                             |
| Find a sandbox                | `daytona.v2.get(id)` or `daytona.v2.findByName(name)`                    | `Sandbox.get({ name })`                                                                |
| List sandboxes                | `daytona.v2.search({ labels })`, which matches all supplied labels       | `Sandbox.list({ tags })`, which filters on one tag                                     |
| Change the timeout            | `sandbox.updateLifecyclePolicy({ timeoutSeconds })`                      | `sandbox.extendTimeout(ms)`                                                            |
| End a sandbox                 | `daytona.v2.delete(sandbox)`                                             | `sandbox.stop()` or `sandbox.delete()`                                                 |

On Daytona, a script creates a client, starts an ephemeral sandbox from the default image, and passes each command as one string:

```javascript
import { Daytona } from '@daytona/sdk';

const daytona = new Daytona();
const sandbox = await daytona.v2.create({
  lifecyclePolicy: { timeoutSeconds: 10 * 60 },
  resources: { cpu: 1, memory: 4 },
  env: { PYTHONUNBUFFERED: '1' },
});

try {
  if (sandbox.state !== 'started') {
    await sandbox.wait({ until: 'started', timeoutSeconds: 60 });
  }

  await sandbox.fs.writeText('/tmp/main.py', 'print(21 * 2)');

  const result = await sandbox.exec('python /tmp/main.py', {
    executionTimeoutSeconds: 60,
  });
  console.log(result.output);
  console.log('exit code', result.exitCode);
} finally {
  await daytona.v2.delete(sandbox);
}
```

The Vercel version runs the same Python script in a disposable sandbox:

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

const sandbox = await Sandbox.create({
  timeout: 10 * 60 * 1000,
  resources: { vcpus: 2 },
  env: { PYTHONUNBUFFERED: '1' },
  persistent: false,
});

try {
  await sandbox.writeFiles([
    { path: 'main.py', content: Buffer.from('print(21 * 2)') },
  ]);

  const result = await sandbox.runCommand({
    cmd: 'python',
    args: ['main.py'],
    timeoutMs: 60_000,
  });
  console.log(await result.stdout());
  console.log('exit code', result.exitCode);
} finally {
  await sandbox.stop();
}
```

The Vercel script uses the default image and a fixed 2-vCPU size with 4 GB of memory. Daytona's `cpu: 1` guarantees one core, equivalent to 2 vCPUs, and `memory: 4` guarantees 4 GiB. Daytona can use more than these guarantees, up to its limits, so check peak CPU and memory use before choosing a Vercel size.

Like the Daytona example, `persistent: false` discards files when the sandbox ends. Save as `sandbox.mjs` and run with `.env.local` loaded:

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

The script prints `42` and `exit code 0`, then stops the sandbox.

#### Python SDK calls

| Task                          | Daytona                                               | Vercel Sandbox                                              |
| ----------------------------- | ----------------------------------------------------- | ----------------------------------------------------------- |
| Import                        | `Daytona` from `daytona`                              | `sandbox` from `vercel`                                     |
| Create a sandbox              | `daytona.v2.create()`                                 | `sandbox.create_sandbox()`                                  |
| Set the lifetime              | `lifecycle_policy`, with `timeout_seconds`            | `execution_time_limit`, in seconds or as a `timedelta`      |
| Set resources                 | `resources` with `Resources`                          | `resources` with `SandboxResources`                         |
| Set environment variables     | `env`                                                 | `env`                                                       |
| Run a command                 | `sandbox.exec()` or `sandbox.process.run()`           | `box.run_command()`                                         |
| Read output                   | `result.output`, `result.stdout`, and `result.stderr` | `result.stdout.decode()`, with `capture_output=True`        |
| Get the exit code             | `result.exit_code`                                    | `result.returncode`                                         |
| Run in the background         | `sandbox.process.start()`                             | `box.create_command()`                                      |
| Run a code snippet            | `sandbox.run_code()`                                  | `box.fs.write_text()`, then `box.run_command()`             |
| Write a file                  | `sandbox.fs.write_text(path, text)`                   | `box.fs.write_text(path, text)`                             |
| Read a file                   | `sandbox.fs.read_text(path)`                          | `box.fs.read_text(path)`                                    |
| List, create, or remove paths | `fs.list()`, `fs.mkdir()`, and `fs.remove()`          | `box.fs.listdir()`, `box.fs.mkdir()`, and `box.fs.remove()` |
| Clone a repository            | `sandbox.git.clone()`                                 | `source` with `GitSource`                                   |
| Find a sandbox                | `daytona.v2.get()` or `daytona.v2.find_by_name()`     | `sandbox.get_sandbox()`                                     |
| List sandboxes                | `daytona.v2.search()`                                 | `sandbox.query_sandboxes()`                                 |
| Change the timeout            | `sandbox.update_lifecycle_policy()`                   | `box.extend_execution_time_limit()`                         |
| End a sandbox                 | `daytona.v2.delete(sandbox)`                          | `box.stop()` or `box.destroy()`                             |

Daytona's synchronous Python client performs the same operations:

```python
from daytona import Daytona
from daytona.v2 import Resources

with Daytona() as daytona:
    sandbox = daytona.v2.create(
        lifecycle_policy={"timeout_seconds": 10 * 60},
        resources=Resources(cpu=1, memory=4),
        env={"PYTHONUNBUFFERED": "1"},
    )

    try:
        if sandbox.state != "started":
            sandbox.wait(until="started", timeout=60)

        sandbox.fs.write_text("/tmp/main.py", "print(21 * 2)")

        result = sandbox.exec("python /tmp/main.py", execution_timeout=60)
        print(result.output, end="")
        print("exit code", result.exit_code)
    finally:
        daytona.v2.delete(sandbox)
```

Save the Vercel version as `sandbox_example.py` in your linked project directory:

```python
import asyncio

from dotenv import load_dotenv
from vercel import sandbox
from vercel.sandbox import SandboxResources


load_dotenv(".env.local")


async def main() -> None:
    async with sandbox.create_sandbox(
        execution_time_limit=10 * 60,
        resources=SandboxResources(vcpus=2, memory=4096),
        env={"PYTHONUNBUFFERED": "1"},
        persistent=False,
    ) as box:
        await box.fs.write_text("main.py", "print(21 * 2)")

        result = await box.run_command(
            "python", ["main.py"], kill_after=60, capture_output=True
        )
        print(result.stdout.decode(), end="")
        print("exit code", result.returncode)


asyncio.run(main())
```

Run the script from your project directory to load `.env.local`:

```bash
python sandbox_example.py
```

The script prints `42` and `exit code 0`. Its `async with` block stops and destroys the sandbox on exit, matching `daytona.v2.delete(sandbox)`. To preserve files instead, set `persistent=True` and `destroy=False` in `create_sandbox()` so the context manager stops and saves the sandbox. You can also await `create_sandbox()` directly and call `stop()` when work ends.

For synchronous code using Daytona's `Daytona` client rather than `AsyncDaytona`, import `sync` from `vercel.sandbox` as `sandbox`, remove `await`, and use regular context managers. When importing both SDKs, rename the Daytona handle because `from vercel import sandbox` already uses that name.

#### Commands, timeouts, and output

Daytona's `exec()` runs a command string through `bash`, or `sh` when the image has no `bash`. Vercel starts the binary directly, with its arguments in an array. Use `bash -c` for pipes, redirection, or variable expansion, and `bash -lc` when the command also needs the login shell's profile. Daytona's shell-free `{ argv: [...] }` form maps directly to Vercel's `cmd` and `args`.

Match the time units before copying values between SDKs:

| SDK and setting                                                 | Unit                     |
| --------------------------------------------------------------- | ------------------------ |
| Daytona SDK 2.x, in both languages                              | Seconds                  |
| Daytona SDK 0.x lifecycle intervals                             | Minutes                  |
| Vercel TypeScript `timeout`, `timeoutMs`, and `extendTimeout()` | Milliseconds             |
| Vercel Python `execution_time_limit` and `kill_after`           | Seconds or a `timedelta` |

Daytona's `executionTimeoutSeconds` and Python's `execution_timeout` stop the command, like Vercel's `timeoutMs` and `kill_after`. Daytona's `timeoutSeconds`, or Python's `timeout`, only ends the caller's wait; the command continues.

Check the command's `exitCode`, or Python's `returncode`, on Vercel. Daytona also returns a `reason`, such as `exited` or `timed_out`. For Python code that should raise on a nonzero exit, pass `check=True` to receive `subprocess.CalledProcessError`.

Daytona returns `stdout`, `stderr`, and combined `output` as strings. Combined output follows the order in which the command wrote to both streams. Vercel's TypeScript methods are asynchronous: await `stdout()`, `stderr()`, or `output('both')`. In Python, `run_command()` streams output locally unless you set `capture_output=True`, which captures bytes. To merge both streams instead, import `subprocess` and pass `stdout=subprocess.PIPE` with `stderr=subprocess.STDOUT`.

#### Files, paths, and users

Daytona's filesystem methods require absolute paths, and commands on its base image start as `root` in `/root`. On Vercel managed images, relative paths resolve from `/vercel` and commands run as `ubuntu` or `arch` with passwordless sudo. Check each command's `cwd` and update absolute paths in code, system prompts, and tool descriptions. Pass `sudo: true`, or Python's `sudo=True`, when a command needs root. Use `sandbox.createUser()` to create another Linux user.

Daytona's `fs.writeText()` and `fs.mkdir()` create missing parent directories. Before calling Vercel's `writeFiles()`, create any missing target directory with `sandbox.fs.mkdir()` and `{ recursive: true }`. Python's `box.fs.mkdir()` is recursive by default. Handle missing reads too: Vercel's `sandbox.readFile()` and `readFileToBuffer()` return `null` when the file doesn't exist.

#### Readiness, names, and persistence

- Check Daytona's sandbox state and wait for `started` because `create()` can return before startup finishes. Vercel's `Sandbox.create()` waits until commands can run; omit Daytona's `waitSeconds` option and state check.
  
- Store the Vercel sandbox name chosen at creation or generated by Vercel. Daytona names aren't unique; use `Sandbox.getOrCreate()` where repeated named `create()` calls retrieve an existing Daytona sandbox.
  
- For disposable work, preserve Daytona's default ephemeral behavior with `persistent: false` or Python's `persistent=False`. Persistent Vercel sandboxes save a snapshot on each stop, which counts toward Snapshot Storage.
  

#### Background commands and streamed output

Replace Daytona's `process.start()` with a detached command and `streamLogs()` with its log stream. The Daytona handle yields log events while the command runs:

```javascript
const handle = await sandbox.process.start(
  'for i in 1 2 3; do echo $i; sleep 1; done',
);

for await (const event of handle.streamLogs()) {
  if (event.type === 'log') process.stdout.write(event.frame.data);
}

const finished = await handle.wait();
console.log('exit code', finished.exitCode);
```

On Vercel, `runCommand()` with `detached: true` returns when the command starts, and `command.logs()` streams its output:

```javascript
const command = await sandbox.runCommand({
  cmd: 'bash',
  args: ['-c', 'for i in 1 2 3; do echo $i; sleep 1; done'],
  detached: true,
});

for await (const line of command.logs()) {
  process.stdout.write(line.data);
}

const finished = await command.wait();
console.log('exit code', finished.exitCode);
```

In the Python SDK, `create_command()` starts a command without waiting for it:

```python
from anyio.streams.text import TextReceiveStream

process = await box.create_command(
    "bash", ["-c", "for i in 1 2 3; do echo $i; sleep 1; done"]
)
async for text in TextReceiveStream(process.stdout):
    print(text, end="")

returncode = await process.wait()
```

Store `command.cmdId` and pass it to `sandbox.getCommand()` to reconnect to a running command, replacing Daytona's `sandbox.process.connect()`. Command IDs last for the current session; processes you start after a resume receive new IDs.

Connections close after 340 seconds without data while the command keeps running. Use the [long-running task pattern](https://vercel.com/docs/sandbox/examples/execute-long-running-tasks) for longer, quiet jobs.

### 6\. Replace stop and start with named sandboxes

Use a named persistent sandbox in place of creating a Daytona sandbox with `persistent: true` and tracking its ID for each agent session.

#### Reconnect to a sandbox by name

On Daytona, your application creates the sandbox with `persistent: true`, stops it when an agent session ends, stores the sandbox ID, and starts that sandbox for the next session. The excerpt assumes that `sandboxStore` is your application's persistent mapping of session IDs to sandbox IDs, and that `daytona` and `sessionId` identify the client and the current session.

```javascript
// End of an agent session
const sandbox = await daytona.v2.create({ persistent: true });
if (sandbox.state !== 'started') {
  await sandbox.wait({ until: 'started', timeoutSeconds: 60 });
}

await sandbox.fs.writeText('/root/workspace/notes.txt', 'draft');
await sandbox.stop();
await sandboxStore.set(sessionId, sandbox.id);

// Next agent session
const resumed = await daytona.v2.get(await sandboxStore.get(sessionId));
await resumed.start();
console.log(await resumed.fs.readText('/root/workspace/notes.txt'));
```

Give the Vercel sandbox a name derived from the agent session. Vercel saves its files on explicit stops and session timeouts, and a later file or command operation resumes it from that snapshot. This also replaces Daytona pauses, including the default timeout action for persistent Daytona sandboxes:

**Vercel Sandbox (TypeScript)**

```javascript
// End of an agent session
const sandbox = await Sandbox.getOrCreate({ name: `session-${sessionId}` });
await sandbox.writeFiles([
  { path: 'notes.txt', content: Buffer.from('draft') },
]);
await sandbox.stop();

// Next agent session
const resumed = await Sandbox.get({ name: `session-${sessionId}` });
const result = await resumed.runCommand('cat', ['notes.txt']);
console.log(await result.stdout());
```

**Vercel Sandbox (Python)**

```python
# End of an agent session
box, created = await sandbox.get_or_create_sandbox(name=f"session-{session_id}")
await box.fs.write_text("notes.txt", "draft")
await box.stop()

# Next agent session
box = await sandbox.get_sandbox(name=f"session-{session_id}")
print(await box.fs.read_text("notes.txt"))
```

Both Vercel samples print `draft`. After the migration, your application stores the sandbox name instead of a table of sandbox IDs. Keep each session associated with its sandbox name and provider while both providers are in use.

Use a unique session identifier for each Vercel sandbox name, which must be unique within its project and can't change. Daytona names can match several sandboxes; `Sandbox.get({ name })` returns one, so remove code that selects the first `findByName()` result. Each resume starts a new session and timeout.

#### Set snapshot retention and handle missing state

Stopped Daytona sandboxes keep their disks until deletion. Vercel saves snapshots whose retention you can configure:

| What you need to control                | Vercel setting                                                                                                                                                                                              |
| --------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Expiration after last use               | The default is 30 days. Change it with TypeScript's `snapshotExpiration` in milliseconds or Python's `snapshot_expiration` in seconds.                                                                      |
| Snapshots kept until deletion           | Set the expiration value to `0` to disable expiry.                                                                                                                                                          |
| Snapshots left after deleting a sandbox | Deletion preserves snapshots by default. Enable `deleteOrphanSnapshots` in `sandbox.delete()` or `delete_orphan_snapshots` in Python's `box.destroy()` to remove only snapshots that no other sandbox uses. |

These helpers can recreate a sandbox whose saved snapshot is missing:

- Python's `get_or_create_sandbox()` recreates the sandbox and returns `created=True`. Check that flag before using files you expect to be present.
  
- TypeScript's `Sandbox.getOrCreate()` also recreates it when `resume: true` is set. Use `onCreate` to initialize or restore the replacement.
  

Use `get_sandbox()` or `Sandbox.get()` for an existing migrated workspace when automatic replacement would hide lost state. With `resume: true`, `Sandbox.get()` fails for a missing snapshot so your application can recover. Set retention for the expected gap between sessions, keep a recoverable backup, and handle resume errors before accepting more work.

#### Restart processes after a resume

Daytona pauses keep memory and processes, while stops end the processes on both platforms. Resuming a Vercel sandbox restores files, so restart the processes your application needs. Create the named sandbox with port 8000 and start its server during provisioning. Use this TypeScript helper to reconnect to the existing workspace and restart the server after a resume:

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

const sessionId = 'your-session-id';

async function startServer(sandbox) {
  await sandbox.runCommand({
    cmd: 'python',
    args: ['-m', 'http.server', '8000'],
    detached: true,
  });
}

const sandbox = await Sandbox.get({
  name: `session-${sessionId}`,
  resume: true,
  onResume: startServer,
});

// Check service readiness before sending application traffic.
```

`Sandbox.get()` with `resume: true` waits for `onResume` when it resumes a stopped sandbox. The hook doesn't run for an already-running session. Check the service's readiness before sending traffic because the detached command can return before the server accepts connections.

The Python SDK has no resume hook. After lookup, check that the required processes are running and start them if needed. `get_sandbox()` only retrieves a handle; a command or filesystem operation resumes a stopped persistent sandbox. `get_or_create_sandbox()` resumes by default.

#### Start many sandboxes from one snapshot

To start many Vercel sandboxes from one prepared environment, take a snapshot and pass its ID as the `source`. This replaces Daytona's `captureImage()`, which saves a sandbox's filesystem as an image that later sandboxes start from, and `fork()`, which copies a persistent sandbox:

```javascript
const base = await Sandbox.create({
  name: 'base-environment',
  source: {
    type: 'git',
    url: 'https://github.com/your-org/your-repo.git',
    depth: 1,
  },
});
const install = await base.runCommand({
  cmd: 'npm',
  args: ['install'],
  cwd: 'your-repo',
});
if (install.exitCode !== 0) {
  const error = await install.stderr();
  await base.stop();
  throw new Error(error || `npm install exited with ${install.exitCode}`);
}

const snapshot = await base.snapshot();

const worker = await Sandbox.create({
  source: { type: 'snapshot', snapshotId: snapshot.snapshotId },
});
```

The `git` source clones the repository into a directory named after it, so the install command sets `cwd`. Calling `base.snapshot()` saves files and stops the session. To fork the sandbox's latest snapshot, use `Sandbox.fork()` with a `sourceSandbox` name. Stop or snapshot the source first because a fork doesn't include unsaved changes from a running session.

Create sandboxes where the snapshot is available, then start their processes because snapshots and forks preserve files without process memory. Configured [failover](https://vercel.com/docs/sandbox/concepts/regions#failover-regions) can load it elsewhere if Vercel can't provision capacity in the main region.

In Python, await `create_sandbox()` to create the base sandbox. Using `async with` destroys it and its unused snapshots on exit. To create new sandboxes from the snapshot, pass `snapshot.id` as `snapshot_id` to `SnapshotSource`, or use `sandbox.fork_sandbox()` to fork by name.

#### Copy files from existing Daytona sandboxes

Start the Daytona sandbox to archive its files; Vercel can't read its disk, captured images, or memory snapshots. This script uses your application's `sandboxStore` and `sessionId` to export `/root/workspace`.

Set `sourceDir` to your application directory and rebuild system packages in step 4. Export stopped, paused, or idle sessions and keep writers stopped after reconnecting because paused sandboxes resume their processes.

**Daytona (TypeScript)**

```javascript
const sandbox = await daytona.v2.get(await sandboxStore.get(sessionId));
const initialState = sandbox.state;
if (initialState === 'stopped' || initialState === 'paused') {
  await sandbox.start();
}
const sourceDir = '/root/workspace';

try {
  if (sandbox.state !== 'started') {
    throw new Error(`Cannot export sandbox in state ${sandbox.state}`);
  }
  const result = await sandbox.exec({
    argv: ['tar', '-czf', '/tmp/workspace.tgz', '-C', sourceDir, '.'],
  });
  if (result.exitCode !== 0) throw new Error(result.stderr || result.output);

  await sandbox.fs.downloadFile('/tmp/workspace.tgz', './workspace.tgz');
} finally {
  if (initialState === 'paused') await sandbox.pause();
  if (initialState === 'stopped') await sandbox.stop();
}
```

**Daytona (Python)**

```python
sandbox = daytona.v2.get(sandbox_store[session_id])
initial_state = sandbox.state
if initial_state in ("stopped", "paused"):
    sandbox.start()
source_dir = "/root/workspace"

try:
    if sandbox.state != "started":
        raise RuntimeError(f"Cannot export sandbox in state {sandbox.state}")
    result = sandbox.exec(
        argv=["tar", "-czf", "/tmp/workspace.tgz", "-C", source_dir, "."]
    )
    if result.exit_code != 0:
        raise RuntimeError(result.stderr or result.output)

    sandbox.fs.download_file("/tmp/workspace.tgz", "./workspace.tgz")
finally:
    if initial_state == "paused":
        sandbox.pause()
    if initial_state == "stopped":
        sandbox.stop()
```

`start()` starts a stopped sandbox or resumes a paused one. `downloadFile()` streams the archive to local disk and runs only in Node.js. The script saves `workspace.tgz` locally, then returns the source sandbox to its earlier state. Pausing a sandbox that was paused keeps its memory and processes until cutover.

Other source types need preparation before export:

- An ephemeral Daytona sandbox can't stop or pause and is deleted at timeout. Extend its lifetime with `updateLifecyclePolicy()` before exporting.
  
- For a captured image, create a temporary sandbox with `daytona.v2.create()`. For a memory snapshot, use `daytona.v2.createFromSnapshot()`. Ensure `tar` is installed before running the archive steps, then delete the temporary sandbox.
  

#### Import the archive into Vercel

Install the [Sandbox CLI](https://vercel.com/docs/sandbox/sdk/cli) for the file transfer. The yarn command requires Yarn Classic; choose the npm command if you use modern Yarn:

**pnpm**

```bash
pnpm add --global sandbox
```

**npm**

```bash
npm install --global sandbox
```

**yarn**

```bash
yarn global add sandbox
```

**bun**

```bash
bun add --global sandbox
```

Before creating the destination, match its settings to the sandbox your application expects. Set the image and environment variables now because `sandbox.update()` cannot change them later. `Sandbox.getOrCreate()` also ignores creation settings when the name already exists. Add the required image, resources, public ports, network policy, environment, region, and retention settings to `sandbox create`.

These commands use the default managed image. For a custom image, add `--image agent-runtime:latest` and replace `/vercel` with its working directory. Run in the linked project, or pass `--project` and `--scope` to select the project and team. Use a new name for each import to keep reruns from overwriting session files.

```bash
sandbox create --name session-123 --timeout 30m &&
sandbox copy ./workspace.tgz session-123:/vercel/workspace.tgz &&
sandbox exec session-123 -- tar -xzf /vercel/workspace.tgz -C /vercel &&
sandbox stop session-123
```

### 7\. Move volumes to Drives

Use a [Drive](https://vercel.com/docs/sandbox/concepts/drives) in place of a Daytona [volume](https://www.daytona.com/docs/volumes) for storage that outlives a sandbox and mounts as a directory.

```javascript
const sandbox = await daytona.v2.create({
  volumes: [{ volumeId: 'workspace-cache', mountPath: '/cache' }],
});
```

Install `@vercel/drives` for JavaScript. Python includes Drive operations in its SDK:

**pnpm**

```bash
pnpm i @vercel/drives
```

**npm**

```bash
npm i @vercel/drives
```

**yarn**

```bash
yarn add @vercel/drives
```

**bun**

```bash
bun add @vercel/drives
```

Measure your files before creating the Drive because its size limit cannot change later. Defaults are 1 TB on Pro and Enterprise, or 1 GB on Hobby and Pro trials. Set `maxSize` in TypeScript or `max_size_bytes` in Python within your plan's [Drive limits](https://vercel.com/docs/drives/pricing#limits), then create the Drive and mount it in a sandbox in the same region:

**Vercel Sandbox (TypeScript)**

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

const drive = await Drive.getOrCreate({
  name: 'workspace-cache',
  region: 'iad1',
});

const sandbox = await Sandbox.create({
  region: drive.region,
  mounts: { '/cache': drive },
});
```

**Vercel Sandbox (Python)**

```python
drive, created = await sandbox.get_or_create_drive(
    name="workspace-cache", region="iad1"
)

box = await sandbox.create_sandbox(
    region=drive.region,
    mounts={"/cache": drive},
)
```

`Drive.getOrCreate()` replaces `daytona.v2.volumes.create()`, and `daytona.v2.volumes.get()` with `create: true`. `maxSize` replaces `sizeGib`.

Check these differences from volumes:

- Give each Drive one writable mount. Daytona allows several sandboxes to attach and write to one volume; concurrent readers on Vercel can mount `drive.snapshot()` for a read-only view at that point in time.
  
- Remove `sandbox.volumes.pull()`. Drive snapshots keep the files from the time of capture, so mount a new snapshot when readers need later changes.
  
- Choose the Drive's region and maximum size before creation because neither can change. New Drives default to `iad1`.
  
- Mount up to four Drives at non-overlapping absolute paths, in place of Daytona's limit of eight volumes.
  

#### Transfer the volume's files

Before the final export, stop or delete the Daytona sandboxes that write to the volume and wait for their last commits. Daytona can publish a writer's final commit several minutes after that writer stops.

The export sandbox writes the archive to its own disk, so set a `resources.disk` guarantee large enough to hold it. Mount `workspace-cache` at `/cache` in a new sandbox, then archive and download its files:

**Daytona (TypeScript)**

```javascript
const sandbox = await daytona.v2.create({
  volumes: [{ volumeId: 'workspace-cache', mountPath: '/cache' }],
  lifecyclePolicy: { timeoutSeconds: 30 * 60 },
});

try {
  if (sandbox.state !== 'started') {
    await sandbox.wait({ until: 'started', timeoutSeconds: 60 });
  }

  const result = await sandbox.exec('tar -czf /tmp/workspace.tgz -C /cache .');
  if (result.exitCode !== 0) throw new Error(result.stderr || result.output);
  await sandbox.fs.downloadFile('/tmp/workspace.tgz', './workspace.tgz');
} finally {
  await sandbox.delete();
}
```

**Daytona (Python)**

```python
from daytona.v2 import VolumeMount

sandbox = daytona.v2.create(
    volumes=[VolumeMount(volume_id="workspace-cache", mount_path="/cache")],
    lifecycle_policy={"timeout_seconds": 30 * 60},
)

try:
    if sandbox.state != "started":
        sandbox.wait(until="started", timeout=60)

    result = sandbox.exec("tar -czf /tmp/workspace.tgz -C /cache .")
    if result.exit_code != 0:
        raise RuntimeError(result.stderr or result.output)
    sandbox.fs.download_file("/tmp/workspace.tgz", "./workspace.tgz")
finally:
    sandbox.delete()
```

If you ran the SDK mount example, await `sandbox.stop()` or Python's `box.stop()` to release its writable Drive mount. Verify the archive's contents, copy it to a sandbox mounting the Drive, and extract its files into `/cache`:

```bash
sandbox create --name volume-import \
  --non-persistent --region iad1 --timeout 30m \
  --mount workspace-cache:/cache &&
sandbox copy ./workspace.tgz volume-import:/vercel/workspace.tgz &&
sandbox exec volume-import -- tar -xzf /vercel/workspace.tgz -C /cache &&
sandbox stop volume-import
```

The `--non-persistent` flag discards the import sandbox's own files on stop. The files in `/cache` stay on the Drive.

### 8\. Replace preview URLs with public ports

Replace Daytona's `sandbox.ports.expose()` and `sandbox.ports.previewLink()` with the Vercel port URL. Expose the port through `ports`, then read its URL with `sandbox.domain()` in TypeScript or the matching entry in Python's `box.routes`.

Treat every Vercel port URL as public. Daytona ports are private by default and require the `X-Daytona-Preview-Token` header or a signed link unless you set `public: true`. When migrating a private preview, authenticate callers in the server running inside the sandbox.

```javascript
const sandbox = await daytona.v2.create();

if (sandbox.state !== 'started') {
  await sandbox.wait({ until: 'started', timeoutSeconds: 60 });
}

await sandbox.process.start('python -m http.server 8000');

const endpoint = await sandbox.ports.expose(8000, { public: true });
console.log(endpoint.url);
```

On Vercel, list the port at creation, start the server as a detached command, and read the port's URL:

```javascript
const sandbox = await Sandbox.create({ ports: [8000] });

await sandbox.runCommand({
  cmd: 'python',
  args: ['-m', 'http.server', '8000'],
  detached: true,
});

console.log(sandbox.domain(8000));
```

In the Python SDK, read the URL from `box.routes`:

```python
box = await sandbox.create_sandbox(ports=[8000])
url = next(route.url for route in box.routes if route.port == 8000)
```

Daytona can expose a port after creation through `ports.expose()`. On Vercel, declare up to 15 ports when creating the sandbox, or replace the exposed list with `sandbox.update({ ports })`. Vercel port URLs carry HTTP and WebSocket traffic; Daytona's `ports` create option also forwards TCP and UDP connections.

Vercel port requests return HTTP 410 without waking a stopped sandbox. Daytona's authenticated requests can wake its sandboxes with `wakeOnRequest`. On Vercel, resume with a command, restart the server as shown in step 6, and wait for readiness before routing traffic.

### 9\. Replace Daytona network policies, environment variables, and secrets

#### Map the network policy

Use `networkPolicy` to replace Daytona's network policy:

| Daytona policy                               | Vercel replacement              |
| -------------------------------------------- | ------------------------------- |
| No `networkPolicy`                           | Default `allow-all` policy      |
| `blockAll: true`                             | `deny-all` policy               |
| Domains in `allowDomains`                    | Domain entries in `allow`       |
| CIDRs in `allowCidrs`, with `blockAll: true` | CIDR entries in `subnets.allow` |

This Daytona policy allows three domain patterns. Both products block destinations outside the domain allow list, and `*.github.com` matches subdomains only. Include `github.com` alongside it to allow the base domain:

```javascript
networkPolicy: {
  allowDomains: ['api.openai.com', 'github.com', '*.github.com'],
}
```

Set the policy at creation or replace it with `update()`, which stands in for Daytona's `updateNetworkPolicy()`. In Python, pass a `NetworkPolicy` instance as `network_policy`. Updates replace the policy in full:

**Vercel Sandbox (TypeScript)**

```javascript
const sandbox = await Sandbox.create({
  networkPolicy: {
    allow: ['api.openai.com', 'github.com', '*.github.com'],
  },
});

await sandbox.update({ networkPolicy: 'deny-all' });
```

**Vercel Sandbox (Python)**

```python
from vercel.sandbox import NetworkPolicy

box = await sandbox.create_sandbox(
    network_policy=NetworkPolicy.custom(
        allow={"api.openai.com": (), "github.com": (), "*.github.com": ()}
    ),
)

await box.update(network_policy=NetworkPolicy.deny_all())
```

Daytona's `updateNetworkPolicy()` and `resetNetworkPolicy()` require the current `etag` and apply in the background. Vercel's `update()` takes no `etag`; set `networkPolicy` to `'allow-all'` to remove the restrictions.

Allow IP ranges with subnet rules. Daytona accepts public IPv4 ranges in `allowCidrs` only with `blockAll: true` or a domain allow list. Vercel's `subnets.allow` can resolve any hostname unless you add domain rules, so include them if Daytona restricted DNS. Denied Vercel CIDRs override allowed domains and ranges:

```javascript
networkPolicy: {
  subnets: { allow: ['203.0.113.0/24'] },
}
```

Daytona's proxy checks hostnames on ports 80 and 443. Vercel matches domains by TLS hostname, so plain HTTP requests need an IP-based rule.

#### Pass environment variables

Both SDKs name the option `env`. Pass values from your application when creating the sandbox or running a command:

```javascript
const sandbox = await Sandbox.create({
  env: { DATABASE_URL: process.env.DATABASE_URL },
});

await sandbox.runCommand({
  cmd: 'python',
  args: ['sync.py'],
  env: { API_TOKEN: process.env.API_TOKEN },
});
```

To replace Daytona's `sandbox.updateEnv()`, pass `env` on each later command. In Python, pass `env` to `create_sandbox()` or `run_command()`. Keep secrets out of command arguments because Vercel Sandbox can store arguments and return them in command API responses.

#### Broker credentials with firewall rules

Code in the sandbox can read every value in its environment. To keep a credential outside the sandbox, replace a Daytona secret with a brokering rule, which adds the header after the request leaves the sandbox:

**Daytona (TypeScript)**

```javascript
await daytona.v2.secrets.set('API_TOKEN', process.env.API_TOKEN, {
  allowedDomains: ['api.example.com'],
});

const sandbox = await daytona.v2.create({ secrets: ['API_TOKEN'] });

if (sandbox.state !== 'started') {
  await sandbox.wait({ until: 'started', timeoutSeconds: 60 });
}

// The sandbox holds a placeholder. Daytona's proxy swaps in the real
// value on HTTPS requests to api.example.com.
await sandbox.exec(
  'curl -H "Authorization: Bearer $API_TOKEN" https://api.example.com/v1/items',
);
```

**Vercel Sandbox (TypeScript)**

```javascript
const sandbox = await Sandbox.create({
  networkPolicy: {
    allow: {
      'api.example.com': [
        {
          transform: [
            { headers: { Authorization: `Bearer ${process.env.API_TOKEN}` } },
          ],
        },
      ],
      '*': [],
    },
  },
});
```

**Vercel Sandbox (Python)**

```python
import os

from vercel.sandbox import (
    NetworkPolicy,
    NetworkPolicyRule,
    NetworkPolicyTransform,
)

box = await sandbox.create_sandbox(
    network_policy=NetworkPolicy.custom(
        allow={
            "api.example.com": [
                NetworkPolicyRule(
                    transform=[
                        NetworkPolicyTransform(
                            headers={
                                "Authorization": (
                                    f"Bearer {os.environ['API_TOKEN']}"
                                )
                            }
                        )
                    ]
                )
            ],
            "*": [],
        }
    ),
)
```

Daytona stores secrets in the project and attaches them by name. Sandboxed code sends a placeholder, which the proxy replaces on HTTPS port 443 for an allowed domain. Vercel takes the header value when you create a sandbox or update its policy, so read it from your application's environment or secret manager and remove the placeholder from the sandboxed request.

Vercel's `transform` sets headers only. If an API requires a credential in the query string or request body, forward the request to your own proxy with `forwardURL`, or pass it through `env` if sandboxed code is allowed to read it.

#### Restrict credential use and egress

Keep the egress policy separate from the credential's destination rules. Daytona's secret allow list controls substitution without blocking other traffic. Vercel combines brokering with an egress allow list; remove the `'*'` entry to block domains that the policy doesn't name.

Limit which requests receive a credential with a Vercel `match` on path, method, query, or headers. The query matcher is `queryString` in TypeScript and `query` in Python. To reject unmatched requests, finish the domain's rule list with a `response` rule returning 403 through `statusCode`, or Python's `status_code`.

### 10\. Verify and cut over

#### Validate workload behavior and resource use

Run both providers side by side before changing traffic:

- Run a representative workload on each provider and compare its output, exit codes, and written files.
  
- Check that the migrated network policy permits required services and blocks the destinations your source policy blocked.
  
- Measure peak CPU and memory on Vercel, then set `vcpus` to cover the peak. Plan maximums are 4 vCPUs and 8 GB on Hobby, 8 vCPUs and 16 GB on Pro, and 32 vCPUs and 64 GB on Enterprise.
  
- Check concurrency and creation rate against the plan quotas. Hobby allows 10 concurrent sandboxes. Pro and Enterprise allow 10,000, with a vCPU allocation rate that starts at 150 vCPUs per minute and ramps to 5,000.
  

Estimate usage with [Sandbox pricing](https://vercel.com/docs/sandbox/pricing). Vercel meters Active CPU, Provisioned Memory, Sandbox Creations, Data Transfer, and Snapshot Storage, plus Drive Storage, Drive Reads, and Drive Writes.

#### Move session state and switch traffic

Before moving state, plan replication between providers if shared data must remain writable during cutover. Otherwise, stop writes during the final export and import.

1. Record which provider owns each existing session and keep its requests on that provider while you migrate its state.
   
2. Stop writes to the session workspaces and volumes being moved. Export files from persistent sandboxes and volumes as shown in steps 6 and 7. Import and verify the files before routing those sessions to Vercel.
   
3. Switch the flag for new sessions and monitor output and errors. Keep existing Daytona sessions on Daytona until they finish or their state has been imported.
   

#### Keep a rollback path until cleanup

If you roll back, send new sessions to Daytona. Before moving a session that has written files on Vercel back to Daytona, copy and verify those changes. Retain both providers' state until the rollback period ends.

After the rollback period, remove the migrated workloads' unused Daytona call sites and data. Retain images, persistent sandboxes, snapshots, volumes, and secrets needed by workloads still on Daytona. Remove the SDK and revoke its API key only when every dependent application and job has migrated.

## What doesn't map from Daytona

These Daytona features need a different design on Vercel. Run the CLI examples from the project directory linked in step 2 with the latest Vercel and Sandbox CLIs.

### Pauses, snapshots, and forks that keep memory

Vercel snapshots preserve files without process memory. Save progress to a file, Drive, or database before stopping the sandbox, then restart the process and load its saved progress on resume. The process restart example in step 6 shows how to attach startup logic to the sandbox lifecycle.

Daytona stops and forks created with `memory: false` already preserve only the disk. Start the processes again after booting from those files.

### Entrypoints and readiness checks

Daytona runs the image's `ENTRYPOINT` and `CMD` at startup. Vercel restores files, so prepare dependencies once in an image or snapshot and launch the process with a detached `runCommand()` after creation and each resume.

Sandbox creation waits until commands can run; your server may still be starting. Save this Node.js helper as `wait-for-http.mjs` and check a health URL covering the service and its dependencies before forwarding traffic:

```javascript
import { setTimeout as delay } from 'node:timers/promises';

export async function waitForHttp(url, headers = {}) {
  for (let attempt = 0; attempt < 20; attempt++) {
    try {
      const response = await fetch(url, {
        headers,
        redirect: 'error',
        signal: AbortSignal.timeout(2_000),
      });
      const ready = response.ok;
      await response.body?.cancel();
      if (ready) return;
    } catch {
      // Retry while the service is starting.
    }
    await delay(500);
  }
  throw new Error('Service did not become ready');
}
```

The helper retries startup failures and throws if the service stays unavailable. The authenticated service below uses it with an authorization header. Run the check again after restarting a service on resume.

### Idle timeouts and wake on request

Vercel Sandbox has no idle timeout; requests don't extend sessions or wake stopped sandboxes. Daytona's `idleExpirySeconds` stops, pauses, or deletes idle sandboxes; `wakeOnRequest` starts them on authenticated requests.

Track activity in your application, extend the session while work continues, and call `stop()` when work ends. For an interactive agent, have a background worker stop inactive sessions after checking that no jobs are running. While a session is still running, extend its deadline with the [Sandbox CLI](https://vercel.com/docs/sandbox/sdk/cli#sandbox-extend):

```bash
sandbox extend session-123 10m
```

Replace `session-123` with your sandbox's name. Extending adds time to the current session; it doesn't reset an idle timer or change the default timeout for later sessions. Use `extendTimeout()` and `stop()` from your application. Daytona's `updateLifecyclePolicy()` sets a new deadline measured from the call, so convert each call to the amount of time to add.

On Pro and Enterprise, [lifecycle webhooks](https://vercel.com/docs/sandbox/lifecycle-webhooks) can trigger backend actions:

| Event                      | When Vercel sends it    | Backend action                               |
| -------------------------- | ----------------------- | -------------------------------------------- |
| `sandbox.session.expiring` | 1 minute before timeout | Call `extendTimeout()` while work continues. |
| `sandbox.session.stopped`  | When the session ends   | Clean up.                                    |

Vercel SDK operations that need a running sandbox, such as `runCommand()`, resume a stopped persistent sandbox. Requests to its port URL return HTTP 410 while it is stopped. For a preview, have your backend resume the sandbox, restart its server, and wait for a successful health check before loading the sandbox URL.

### Private preview URLs and signed links

To protect Vercel's public port URLs, have your server check a per-sandbox bearer token sent by your trusted backend. Use this token in place of Daytona's `X-Daytona-Preview-Token` header to authenticate outside callers; sandboxed code can still read it or change the server.

Save `server.mjs` and `call-protected-service.mjs` beside the readiness helper. Run the caller locally or on your backend. It creates a token, uploads the server to a sandbox, and sends an authenticated request before stopping it:

**server.mjs**

```javascript
import { createServer } from 'node:http';
import { timingSafeEqual } from 'node:crypto';

const token = process.env.SERVICE_TOKEN;
if (!token) throw new Error('SERVICE_TOKEN is required');
const expected = Buffer.from('Bearer ' + token);

createServer((request, response) => {
  const actual = Buffer.from(request.headers.authorization ?? '');
  if (
    actual.length !== expected.length ||
    !timingSafeEqual(actual, expected)
  ) {
    response.writeHead(401).end('Unauthorized');
    return;
  }
  response.writeHead(200, { 'Content-Type': 'application/json' });
  response.end(JSON.stringify({ ok: true }));
}).listen(3000, '0.0.0.0');
```

**call-protected-service.mjs**

```javascript
import { randomBytes } from 'node:crypto';
import { readFile } from 'node:fs/promises';
import { Sandbox } from '@vercel/sandbox';
import { waitForHttp } from './wait-for-http.mjs';

const token = randomBytes(32).toString('hex');
const sandbox = await Sandbox.create({
  ports: [3000],
  timeout: 5 * 60 * 1000,
  persistent: false,
});

try {
  await sandbox.writeFiles([{
    path: 'server.mjs',
    content: await readFile(new URL('./server.mjs', import.meta.url)),
  }]);
  await sandbox.runCommand({
    cmd: 'node',
    args: ['server.mjs'],
    env: { SERVICE_TOKEN: token },
    detached: true,
  });

  const url = sandbox.domain(3000);
  const headers = { Authorization: 'Bearer ' + token };
  await waitForHttp(url, headers);
  const response = await fetch(url, {
    headers,
    redirect: 'error',
    signal: AbortSignal.timeout(5_000),
  });
  if (!response.ok) throw new Error('Service request failed');
  console.log(await response.text());
} finally {
  await sandbox.stop();
}
```

Run the caller from that directory with the credentials saved in step 2:

```bash
node --env-file=.env.local call-protected-service.mjs
```

The caller prints `{"ok":true}`. Missing or incorrect tokens return HTTP 401. Your backend must authorize each user's access before calling the sandbox.

Browser page loads and iframes can't set this header, so serve previews through an application route that adds it. Vercel Sandbox has no equivalent to Daytona's expiring signed links; have that route issue and check short-lived tokens.

### CPU guarantees below one core, bursting, and larger sandboxes

Vercel sandboxes have 1 vCPU or an even number up to 32, with 2 GB of memory per vCPU. Daytona sets separate CPU, memory, and disk guarantees and limits; CPU guarantees start at 0.125 cores, with bursting up to each limit. Choose a fixed Vercel size within your plan's limits that covers both CPU and memory needs.

| Daytona `resources` guarantee   | Smallest Vercel size that covers it |
| ------------------------------- | ----------------------------------- |
| Defaults of 0.5 cores and 1 GiB | 1 vCPU and 2 GB                     |
| `cpu: 1, memory: 4`             | 2 vCPUs and 4 GB                    |
| `cpu: 2, memory: 8`             | 4 vCPUs and 8 GB                    |
| `cpu: 2, memory: 16`            | 8 vCPUs and 16 GB                   |

One Daytona core equals 2 vCPUs. These sizes match each guarantee, but Daytona can use more, up to `cpuMax` and `memoryMax`. Measure peak CPU and memory in step 10 before settling on a size.

Sizes above 4 vCPUs require Pro, and sizes above 8 vCPUs require Enterprise. Daytona's Starter and Team plans allow 64 cores and 128 GiB per sandbox, so keep workloads that need more than 32 vCPUs or 64 GB on Daytona. For a workload that fits, pass the Vercel size as `resources.vcpus`:

```javascript
const sandbox = await Sandbox.create({ resources: { vcpus: 1 } });
```

Vercel meters Active CPU and Provisioned Memory separately. For a workload that runs on Daytona's default guarantees today, Vercel bills 2 GB of provisioned memory while the sandbox runs, and CPU time only while its code is active.

#### Store files beyond the local disk

Use a [Drive](https://vercel.com/docs/drives/cli-reference#vercel-drives-get-or-create) at `/data` for files beyond the 64 GB local disk. Its region and size limit are fixed at creation, and only one sandbox can mount it for writing. Create a 100 GiB Drive on Pro or Enterprise and a sandbox in the same region:

```bash
vercel drives get-or-create migration-data \
  --region iad1 --max-size 100GiB

sandbox create --name migration-worker \
  --vcpus 4 --timeout 30m --region iad1 \
  --mount migration-data:/data
```

Keep datasets on the Drive at `/data`, separate from local disk, and run `sandbox stop migration-worker` when work finishes. Hobby and Pro trial Drives have a 15 GB limit; use external storage for larger datasets.

### Code execution kernels

Vercel Sandbox has no equivalent to Daytona's `runCode()`, which is `run_code()` in Python. On Daytona, code runs in a language kernel that keeps variables between calls and returns charts and other rich results. On Vercel, your application writes the generated code to a file and runs it with `runCommand()`. Each run is a new process, so save the state that later runs need to a file.

This example runs two snippets in one sandbox. The second snippet loads the value that the first one saved:

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

const sandbox = await Sandbox.create({
  persistent: false,
  networkPolicy: 'deny-all',
});

async function runCell(code) {
  await sandbox.writeFiles([{ path: 'cell.py', content: Buffer.from(code) }]);
  const result = await sandbox.runCommand('python', ['cell.py']);
  const output = {
    stdout: await result.stdout(),
    stderr: await result.stderr(),
    exitCode: result.exitCode,
  };
  if (output.exitCode !== 0) {
    throw new Error(output.stderr || `Code exited with ${output.exitCode}`);
  }
  return output;
}

try {
  await runCell(`
import json, pathlib
pathlib.Path("state.json").write_text(json.dumps({"total": 21}))
`);

  const second = await runCell(`
import json, pathlib
state = json.loads(pathlib.Path("state.json").read_text())
print(state["total"] * 2)
`);
  console.log(second.stdout);
} finally {
  await sandbox.stop();
}
```

Save the script as `run-cells.mjs` and run it with `node --env-file=.env.local run-cells.mjs`. The script prints `42`.

Check these differences from `runCode()`:

- Write data frames and intermediate results to files for later runs. To preserve variables, imports, or open connections in memory, keep one process running and send it input.
  
- Print text or write rich results to files. Daytona exposes values, images, and chart data through `result.results`; on Vercel, save a chart with `plt.savefig()` and retrieve it with `sandbox.readFileToBuffer()`.
  
- Replace Daytona's `result.error` and traceback handling by checking Vercel's `exitCode` and reading `stderr()`.
  
- Replace Daytona's Python, TypeScript, or JavaScript kernel with `python`, `node`, or another interpreter. Install packages in a custom image or snapshot.
  
- Replace `interpreter.createContext()` with a separate working directory or sandbox for each independent session.
  

For notebook-style state, run a Jupyter server inside the sandbox. Vercel Labs' [notebook-factory](https://github.com/vercel-labs/notebook-factory) starts a separate JupyterLab environment for each user.

### Git operations

Replace Daytona's `sandbox.git` methods with a `git` source at creation and Git commands through `runCommand()` afterward. The Daytona example clones a repository and reads its state through the SDK:

```javascript
await sandbox.git.clone('https://github.com/your-org/your-repo.git', {
  path: '/root/your-repo',
  branch: 'main',
  username: 'x-access-token',
  password: process.env.GITHUB_TOKEN,
});
console.log(await sandbox.git.status('/root/your-repo'));
```

Use the token as the source's `password` and the cloned path as `cwd` for Git:

**Vercel Sandbox (TypeScript)**

```javascript
const sandbox = await Sandbox.create({
  source: {
    type: 'git',
    url: 'https://github.com/your-org/your-repo.git',
    username: 'x-access-token',
    password: process.env.GITHUB_TOKEN,
    revision: 'main',
    depth: 1,
  },
});

const status = await sandbox.runCommand({
  cmd: 'git',
  args: ['status'],
  cwd: 'your-repo',
});
console.log(await status.stdout());
```

**Vercel Sandbox (Python)**

```python
import os

from vercel.sandbox import GitSource

box = await sandbox.create_sandbox(
    source=GitSource(
        url="https://github.com/your-org/your-repo.git",
        username="x-access-token",
        password=os.environ["GITHUB_TOKEN"],
        revision="main",
        depth=1,
    )
)

status = await box.run_command(
    "git", ["status"], cwd="your-repo", capture_output=True
)
print(status.stdout.decode(), end="")
```

Both Vercel samples print the repository's `git status` output. The repository is cloned into a directory named after it, so each command sets `cwd` to that directory. For a private GitHub repository, use `x-access-token` as the username and a token as the password; omit both for a public repository.

Run the corresponding Git command through the object form of `runCommand()` shown above. Set `cmd` to `git`, supply the arguments in `args`, and select the repository directory with `cwd`:

| Daytona method                                  | On Vercel Sandbox                                                                                |
| ----------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| `git.clone()`                                   | Use a `git` source at creation, or run `git clone` with the repository URL in a running sandbox. |
| `git.status()` and `git.history()`              | Run `git status` and `git log`.                                                                  |
| `git.createBranch()` and `git.checkoutBranch()` | Run `git checkout -b` or `git checkout` with the branch name.                                    |
| `git.add()` and `git.commit()`                  | Stage changes with `git add`, then run `git commit -m` with the message.                         |
| `git.push()` and `git.pull()`                   | Run `git push` or `git pull` with a token passed through the command's `env`.                    |
| `git.setConfig()`                               | Run `git config` with the key and value.                                                         |

#### Commit and push changes

Daytona's `git.commit()` takes the author's name and email on each call. Before committing on Vercel, set `user.name` and `user.email` with `git config`.

For a Vercel push, pass a token with write access through `env` and keep it out of command arguments. The command pushes the current commit to `fix/empty-state`; substitute your organization, repository, and branch:

```javascript
await sandbox.runCommand({
  cmd: 'bash',
  args: [
    '-c',
    'git push "https://x-access-token:${GITHUB_TOKEN}@github.com/' +
      'your-org/your-repo.git" HEAD:refs/heads/fix/empty-state',
  ],
  cwd: 'your-repo',
  env: { GITHUB_TOKEN: process.env.GITHUB_TOKEN },
});
```

Bash expands `${GITHUB_TOKEN}` from the command's environment, so the token doesn't appear in the stored arguments. Code in the sandbox can read it while the command runs; use a token limited to that repository.

### Sessions, PTY, and SSH

Vercel Sandbox has no session that carries a working directory or environment between commands, so pass `cwd` and `env` to each command, or run the steps as one `bash -c` script. A Daytona session carries both from one command to the next.

Vercel Sandbox provides terminal sessions without an SSH server. Replace `daytona sandbox ssh` with `sandbox connect` in the Sandbox CLI:

```bash
sandbox connect session-123
```

For interactive terminals, `sandbox.openInteractive()` replaces `sandbox.pty.start()` and returns a WebSocket URL and token. The Python SDK has `box.open_interactive()`. Vercel terminal sessions end when the sandbox stops.

Tools that connect over SSH, such as `scp`, have no direct replacement. Copy files with `sandbox copy`, and reach a service through a port that you expose with `ports`.

### Desktop and computer use

Vercel Sandbox has no first-party replacement for Daytona's Computer Use API and its mouse, keyboard, and screenshot methods. With Sandbox CLI 4.12.0 or later, use Vercel Labs' [screen-relay](https://vercel.com/docs/sandbox/examples/desktop-streaming) to start a Linux desktop with browser controls:

```bash
sandbox create --name desktop --timeout 30m -p 8080 \
  --image vercel-labs/screen-relay/sandbox-desktop:0.1.3
sandbox exec desktop -- screen-relay up -d --public $(sandbox domain desktop 8080)
```

The viewer token replaces Daytona's VNC access for desktop viewing and control. Release viewer control before an agent uses `screen-relay` from a terminal.

The [AI SDK Computer Use template](https://vercel.com/templates/next.js/ai-sdk-computer-use) provides a separate setup for an agent to control a sandbox's remote desktop. Keep workloads on Daytona until you replace their Computer Use calls.

### Bucket volumes

Vercel Sandbox has no built-in replacement for a Daytona bucket volume. Copy objects into the sandbox when a job can work from a fixed set of files. If it needs a mounted bucket, install a FUSE client in a custom image, then [mount remote storage](https://vercel.com/docs/sandbox/examples/mount-remote-storage) with `sudo: true` after creation and after each resume.

External bucket volumes already store their objects in your bucket; export a Daytona-managed bucket through a sandbox using step 7. For S3, install and authenticate the [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html) on your local machine or trusted worker. Replace `your-bucket` and the `inputs/` prefix below, download the inputs there, then copy them into a sandbox:

```bash
aws s3 sync s3://your-bucket/inputs/ ./migration-inputs

sandbox create --name bucket-reader --timeout 30m
sandbox copy --recursive ./migration-inputs \
  bucket-reader:/vercel/data
sandbox exec bucket-reader -- ls /vercel/data
sandbox stop bucket-reader
```

AWS credentials stay on the machine running the copy. This is a file transfer, so bucket updates won't appear automatically and sandbox writes won't upload to S3. Copy outputs back and upload them explicitly when needed. For datasets larger than the local disk, copy into a Drive mount instead.

### macOS sandboxes and Bring Your Own Compute

Vercel Sandbox runs Linux images in your selected region on Vercel's infrastructure. Keep builds and tests that need macOS, Xcode, or the iPhone simulator on Daytona's macOS sandboxes. Keep workloads that must run on your own Kubernetes nodes on Daytona's Bring Your Own Compute.

To reach private APIs and databases, connect Vercel Sandbox to a [Secure Compute network](https://vercel.com/docs/sandbox/concepts/secure-compute), an Enterprise add-on, or run a VPN client inside the sandbox with `sudo`.

### GPU and Windows sandboxes

Vercel Sandbox runs Linux with CPU and memory resources. Keep jobs that need Windows or a local GPU, including training and custom CUDA code, on Daytona v0 or another compatible service. For inference with a supported model, call [AI Gateway](https://vercel.com/docs/ai-gateway) and keep preprocessing or code execution in Vercel Sandbox.

### Other SDK features

These Daytona features have a different interface on Vercel, or none:

| Daytona feature                                            | On Vercel Sandbox                                                                                                    |
| ---------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| `handle.writeStdin()` on a background process              | `stdin: true` with `detached: true` in `runCommand()`, then `command.writeStdin()` and `command.closeStdin()`        |
| `sandbox.process.list()`                                   | `box.query_commands()` in the Python SDK. The TypeScript SDK has no list call, so store each `cmdId`.                |
| `handle.kill()`                                            | `command.kill()`                                                                                                     |
| `fs.writeBytes()`, `fs.writeMany()`, and `fs.uploadFile()` | `sandbox.writeFiles()`, which takes several files in one call, or `sandbox copy` in the Sandbox CLI for a local file |
| `fs.move()` and `fs.chmod()`                               | `sandbox.fs.rename()` and `sandbox.fs.chmod()`                                                                       |
| `fs.grep()`, `fs.glob()`, and `fs.replace()`               | No equivalent. Run `grep`, `find`, or `sed` with `runCommand()`.                                                     |
| `fs.watchDir()`                                            | No equivalent. Poll with `sandbox.fs.readdir()` and `sandbox.fs.stat()`.                                             |
| `fs.presignedDownloadUrl()` and `fs.presignedUploadUrl()`  | No equivalent. Move files through your backend with `writeFiles()`, `readFile()`, or `downloadFile()`.               |
| `fs.downloadFile()`, which streams to local disk           | `sandbox.downloadFile()`, or `sandbox.readFile()`, which returns a stream                                            |
| The `user` option at creation or on a command              | `sudo: true` for root, or `sandbox.createUser()` for another Linux user                                              |
| Daytona's HTTP API and Go SDK                              | The [Sandboxes endpoints](https://vercel.com/docs/rest-api/sandboxes) in the Vercel REST API                         |

Replace Daytona CLI commands in scripts and CI jobs with these commands:

| Daytona CLI                                           | Vercel replacement                                                          |
| ----------------------------------------------------- | --------------------------------------------------------------------------- |
| `daytona sandbox create`                              | `sandbox create`                                                            |
| `daytona sandbox list`                                | `sandbox list`                                                              |
| `daytona sandbox exec <id> -- <command>`              | `sandbox exec <name> -- <command>`                                          |
| `daytona sandbox ssh <id>`                            | `sandbox connect <name>`                                                    |
| `daytona sandbox cp`                                  | `sandbox copy`                                                              |
| `daytona sandbox stop <id>`                           | `sandbox stop <name>`                                                       |
| `daytona sandbox pause <id>`                          | `sandbox stop <name>`, which saves files only                               |
| `daytona sandbox delete <id>`                         | `sandbox remove <name>`                                                     |
| `daytona image build`                                 | `vercel vcr build`                                                          |
| `daytona image capture` and `daytona snapshot create` | `sandbox snapshot <name> --stop` to save files and stop the running session |

## Troubleshooting

Use these checks when behavior changes after moving a workload from Daytona.

| What you observe                                                                                                                   | What to check                                                                                                                                                                                                                               |
| ---------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Authentication fails locally after it worked earlier                                                                               | The development OIDC token expires after 12 hours. Run `vercel env pull` again.                                                                                                                                                             |
| `Sandbox.create()` returns `image_not_ready`                                                                                       | Vercel Container Registry is still preparing the image. Retry after the repository details page shows Ready, and confirm the image targets `linux/amd64`.                                                                                   |
| A command that was one string on Daytona fails to start, or pipes, redirection, and `$VARIABLES` reach the program as literal text | `runCommand()` doesn't use a shell. Pass the binary and an argument array, or wrap the command in `bash -c`.                                                                                                                                |
| A command or file write fails with a permission error                                                                              | Commands run as the image's default user instead of root. Write under `/vercel`, or pass `sudo: true`.                                                                                                                                      |
| Files or scripts aren't found under `/root`                                                                                        | Managed images use `/vercel` as the home and working directory. Update absolute paths, or use relative paths.                                                                                                                               |
| A sandbox or command times out much sooner than on Daytona                                                                         | Vercel's TypeScript SDK takes milliseconds. Multiply each value copied from Daytona's lifecycle `timeoutSeconds` or `executionTimeoutSeconds` by 1,000.                                                                                     |
| A command stops at a timeout that only ended the wait on Daytona                                                                   | Vercel's `timeoutMs` and `kill_after` stop the command. Remove them where Daytona's `timeoutSeconds` limited only the caller's wait.                                                                                                        |
| Python output is `None`, or prints as `b'...'`                                                                                     | Pass `capture_output=True` to `run_command()`, then call `.decode()` on `stdout`.                                                                                                                                                           |
| A second code run can't see variables from the first                                                                               | Each `runCommand()` call starts a new process. Save state to a file, as the code execution kernels section shows.                                                                                                                           |
| `git` commands fail because the directory isn't a repository                                                                       | A `git` source clones the repository into a directory named after it. Set each command's `cwd` to that directory.                                                                                                                           |
| Requests to a sandbox URL return HTTP 410                                                                                          | The sandbox is stopped, and HTTP requests don't resume it. Run a command to resume the sandbox, then restart your server.                                                                                                                   |
| A server that ran before a stop isn't running after a resume                                                                       | Vercel restores the saved files. Start the server during provisioning and restart it with `onResume`, as shown in step 6.                                                                                                                   |
| Snapshot Storage grows for sandboxes that run once                                                                                 | Vercel sandboxes are persistent by default. Pass `persistent: false` for sandboxes that were ephemeral on Daytona.                                                                                                                          |
| The first call to a stopped sandbox fails with `snapshot_not_found`                                                                | Check whether the snapshot is still available. If it has expired, create a replacement sandbox and restore files from an available backup. Configure retention for future snapshots; extending retention cannot recover a deleted snapshot. |
| Creation fails with `snapshot_region_mismatch` or `drive_region_mismatch`                                                          | Create the sandbox in the same region as its snapshot or Drive.                                                                                                                                                                             |
| Requests to a domain that Daytona allowed are blocked                                                                              | A Vercel allow list blocks every destination that it doesn't name, and denied CIDR ranges take precedence over allowed domains. Add the domain to the allow list. For plain HTTP requests, switch to HTTPS or allow the IP range.           |
| A long, quiet command loses its connection                                                                                         | Connections close after 340 seconds without data, and the command keeps running. Follow [Execute long-running tasks](https://vercel.com/docs/sandbox/examples/execute-long-running-tasks).                                                  |

## What to build with Vercel Sandbox

Use these patterns when adapting the workloads you moved from Daytona.

### AI code interpreter

With a code interpreter, a model can write Python or SQL, run it against a user's file, and return the result. Create one sandbox for each request with `persistent: false`, a short `timeout`, and `networkPolicy: 'deny-all'`. Upload the data with `writeFiles()`, then run the model's script with `runCommand()`.

[Add Python execution to a TypeScript agent](https://vercel.com/kb/guide/python-ai-sdk-vercel-sandbox), or read about [code interpreter design](https://vercel.com/i/code-interpreter).

### Coding agents that work on a repository

Coding agents use a Linux workspace to clone a repository, edit files, run checks, and return a branch or draft pull request. Clone a private repository with a `git` source, and install private packages with `credentials: { npm: true }`. With the Sandbox CLI, `sandbox create claude` or `sandbox create codex` starts a supported agent in a sandbox from your terminal.

Use [eve Software Factory](https://vercel.com/templates/eve/eve-software-factory) to turn issues into reviewed draft pull requests.

### App builders with live previews

An app builder gives each project a sandbox with a dev-server URL that your product loads in an iframe. Open the named sandbox with `Sandbox.getOrCreate()`, expose port 3000, and start the server as a detached command.

On later visits, have your backend resume the sandbox and restart the server before loading its preview URL. Extend the session while the user is active; requests to a stopped sandbox's URL do not resume it.

Build a [v0-style app builder](https://vercel.com/kb/guide/v0-clone-openai-agents-vercel-sandbox) with the OpenAI Agents API.

### Agents with persistent, shared workspaces

Long-running agents can keep files between conversations and share reference material with a team. Give each user or task a named sandbox, and keep team files on a Drive that each session mounts as a read-only snapshot.

The [eve with Vercel Drives template](https://vercel.com/templates/eve/eve-vercel-drives-starter) connects an agent in Slack or a terminal to shared team files. It saves new documents through a separate sandbox with write access. Follow the [eve and Drives setup](https://vercel.com/kb/guide/vercel-drives-eve-agent) to configure it.

### Customer code in a multi-tenant product

Use one sandbox per execution to run code written by your customers, third-party developers, or their agents. Start each job from a snapshot that holds its dependencies, and set `networkPolicy` to `'deny-all'` or an allow list. Broker credentials at the Sandbox firewall so customer code never holds them.

See [Notion Workers](https://vercel.com/customers/notion-workers-vercel-sandbox) for a production example of running untrusted code, or [add isolated Python execution](https://vercel.com/kb/guide/python-and-vercel-sandbox) to your own app.

## Next steps

- Configure [session timeouts and persistent files](https://vercel.com/docs/sandbox/concepts/persistent-sandboxes)
  
- Restrict egress and broker credentials with the [Sandbox firewall](https://vercel.com/docs/sandbox/concepts/firewall)
  
- Build custom images with [Vercel Container Registry](https://vercel.com/docs/container-registry)
  
- Mount persistent storage with [Drives](https://vercel.com/docs/sandbox/concepts/drives)
  
- Run agent evals with [Harbor and Terminal-Bench](https://vercel.com/docs/sandbox/ecosystem/harbor)
  
- Estimate your bill with [Sandbox pricing and quotas](https://vercel.com/docs/sandbox/pricing)
  
- Compare [Vercel Sandbox and Daytona](https://vercel.com/kb/guide/vercel-sandbox-vs-daytona) for your workload
  

## Frequently asked questions

### Can I move Daytona sandboxes, snapshots, or volumes to Vercel Sandbox directly?

No. Export the files from a Daytona sandbox that you started, created from the image or snapshot, or created with the volume mounted. Use `sandbox copy` to transfer the archive to Vercel, then extract it into the sandbox's workspace or mounted Drive. Memory and running processes don't transfer.

### Can my application stay on its current host after I migrate to Vercel Sandbox?

Yes. The Vercel Sandbox SDKs work from any backend with an access token, a team ID, and a project ID. Applications deployed on Vercel authenticate with the project's OIDC token instead.

### Can I keep some workloads on Daytona and move the rest to Vercel Sandbox?

Yes. The Daytona and Vercel Sandbox SDKs are independent, so one application can call both. For example, move code execution to Vercel Sandbox, and keep computer-use agents that depend on Daytona's Computer Use API on Daytona.

### Do I need to rebuild my Daytona images for Vercel Sandbox?

Not always. If you have access to an existing `linux/amd64` OCI image, you can push it to [Vercel Container Registry](https://vercel.com/docs/container-registry#use-your-container-tool-directly) with your container tool. Rebuild an `arm64` image for `linux/amd64`, and reproduce Daytona `ImageBuilder` definitions or captured sandbox setup in a Dockerfile when you don't have a reusable image. Use a Vercel managed image to replace `daytona-base` or a stock runtime image when it includes the versions and tools your workload needs.

### Does this guide apply to Daytona v0 and SDK 0.x?

Yes. Step 1 translates the SDK 0.x names and lists the defaults that differ on Daytona v0. A Daytona v0 sandbox is reachable only through SDK 0.x or the `daytona.v0` namespace, so export its files with those calls.

### Can I migrate Daytona Python code without switching to TypeScript?

Yes. The `vercel-sandbox` package supports Python 3.11 or later with asynchronous and synchronous APIs. Some names differ from Daytona's Python SDK, for example `execution_time_limit` instead of `lifecycle_policy`.

### Do processes keep running when a Vercel sandbox stops and resumes, as they do after a Daytona pause?

No. Vercel Sandbox restores files, not processes. In the TypeScript SDK, restart servers and background jobs in the `onResume` hook, which runs each time a session resumes. In Python, check that the required processes are running after lookup and start them if needed.

### Does Vercel Sandbox have an idle timeout like Daytona's idleExpirySeconds?

No. Vercel sessions end at their timeout or when your code calls `stop()`. While work continues, call `extendTimeout()` or Python's `extend_execution_time_limit()`. Persistent sandboxes save their files in either case.

### Does Vercel Sandbox resume a stopped sandbox automatically?

Yes, for SDK operations. A command or file operation resumes a stopped persistent sandbox without any lifecycle setting. HTTP requests to a port URL don't resume it, so they return HTTP 410 until your code resumes the sandbox.

### Is there a Vercel equivalent to Daytona's runCode()?

No. Write the generated code to a file and run it with `runCommand()`. Each run is a separate process, so save state to files between runs.

### Do commands run as root in Vercel Sandbox like they do on Daytona's base image?

No. Vercel managed images run commands as the `ubuntu` or `arch` user in `/vercel`, with passwordless sudo. Pass `sudo: true` to `runCommand()`, or `sudo=True` to `run_command()`, for commands that need root.

## Related Resources

- [Vercel Sandbox vs Daytona](/kb/guide/vercel-sandbox-vs-daytona): Compare Vercel Sandbox and Daytona as AI agent sandboxes, including isolation, persistence, network controls, SDKs, and deployment regions.

## More Vercel Sandbox guides

- [Migrate from Fly.io Sprites to Vercel Sandbox](/kb/guide/migrate-from-fly-io-sprites-to-vercel-sandbox): Migrate from Fly.io Sprites to Vercel Sandbox in TypeScript or Python, including images, persistent files, public ports, network policies, and a staged cutover.
- [Migrate from Railway Sandboxes to Vercel Sandbox](/kb/guide/migrate-from-railway-sandboxes-to-vercel-sandbox): Migrate Railway Sandboxes to Vercel Sandbox, adapting templates, checkpoints, timeouts, and networking with a staged cutover.
- [Vercel Sandbox vs Daytona](/kb/guide/vercel-sandbox-vs-daytona): Compare Vercel Sandbox and Daytona as AI agent sandboxes, including isolation, persistence, network controls, SDKs, and deployment regions.

## 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>
```
