Every provider has its own idea of an environment
E2B builds templates. Modal pulls images. Daytona takes snapshots. Your laptop runs Docker. Moving an agent from one to another means rebuilding its machine by hand, and hoping it comes out the same.
carton builds one image from your Dockerfile or devcontainer.json, prepares it for every provider you use, and checks a fingerprint each time a sandbox starts.
Honest about what can't be identical
The image can match exactly. The machine around it can't: the kernel, the CPU and the provider's own daemons differ. carton tells you how close each provider gets, and records any difference instead of hiding it.
| level | what runs | for example |
|---|---|---|
| F3 same digest | the exact image | Modal, Docker, Apple container |
| F2 rebuilt | the same definition, rebuilt by the provider | E2B, Daytona, Firecracker |
| F1 provisioned | the provider's base image plus a setup script | providers without custom images |
| F0 host | no image; the host, narrowed | nono, bubblewrap |
Need a guarantee? Ask for one: --min-fidelity F2 keeps a sandbox off any provider that can't meet it.
Switch on demand
Name a provider, or say what you need and let carton choose among the providers with a ready build. If one is down, carton tries the next.
$ carton create py-agent --provider e2b $ carton create py-agent --prefer cheapest --needs pty $ carton create py-agent --provider modal --fallback e2b
$ carton create py-agent --provider e2b $ carton create py-agent \ --prefer cheapest --needs pty $ carton create py-agent \ --provider modal --fallback e2b
Switching happens when a sandbox is created. A running sandbox never moves.
Commands and output on this page are examples.
Your machines are providers too
Run carton agent on a laptop, a server or a GPU box. It joins the same pool as your hosted providers and reports its real isolation boundary, so your policy can keep untrusted code off weak sandboxes.
$ carton agent join https://carton.internal registered my-mac apple-container vm arm64 registered gpu-box-01 firecracker vm amd64
$ carton agent join https://carton.internal registered my-mac vm arm64 registered gpu-box-01 vm amd64
Agents never see your provider keys
carton holds the keys for every provider account. Agents and CI jobs get carton tokens with limits on how many sandboxes they run, for how long, and at what estimated cost. One inventory covers every account, deadlines work the same way everywhere, and forgotten sandboxes get cleaned up.
$ carton ls ID PROVIDER TOKEN AGE EXPIRES STATE sbx_7k2m modal agent-review 12m in 48m running sbx_q91d e2b agent-review 3h in 2m running sbx_r55p my-mac ci 1d expired orphan, cleaning up $ carton spend --by token --since 7d TOKEN MODAL E2B MY-MAC TOTAL (EST.) agent-review $41.20 $18.75 $0.00 $59.95 ci $6.10 $0.00 $0.00 $6.10
$ carton ls ID PROVIDER EXPIRES STATE sbx_7k2m modal in 48m running sbx_q91d e2b in 2m running sbx_r55p my-mac expired orphan, reaping $ carton spend --by token --since 7d TOKEN TOTAL (EST.) agent-review $59.95 ci $6.10
Example output. Spend is estimated from what carton ran, and reconciled with the provider's own billing where it offers one.
Use it from anywhere
The CLI, a TypeScript SDK, an MCP server for agents, and a plain HTTP API. Adapters for agent frameworks mean your agent code doesn't change when the provider does.
import { Carton } from "carton"; const carton = new Carton({ token: process.env.CARTON_TOKEN, }); const box = await carton.sandboxes.create({ template: "py-agent", provider: "modal", }); const run = await box.run(["pytest", "-q"]); await box.destroy();
Works with
| provider | how carton prepares your image | best |
|---|---|---|
| Modal | pulls the image | F3 |
| Vercel Sandbox | pushes to its registry | F3 |
| Northflank | pulls the image | F3 |
| E2B | builds a template | F2 |
| Daytona | builds a snapshot | F2 |
| Runloop | builds a blueprint | F2 |
| Docker, Podman | pulls the image | F3 |
| Apple container | pulls the image | F3 |
| Firecracker | converts to a rootfs | F2 |
| nono, bubblewrap | runs a setup script on the host | F0–F1 |
Something else? Write an adapter: seven operations, in any language. carton's adapter kit handles polling, retries and error mapping.
Open source. Cloud is coming.
Self-hosted
Free and open source. One binary for the server, the CLI and the agent. Your keys stay on your infrastructure.
Install cartoncarton Cloud
The same API, hosted. Bring your own provider keys. Join the waitlist and we'll email you when it opens.
Questions
Is carton a sandbox provider?
No. carton runs on top of the providers you already use, and on your own machines. It builds environments for them, places sandboxes on them, and keeps track of what is running.
Do providers have to support carton?
No. carton talks to each provider through its own API, using an adapter. Adding a provider means writing an adapter: seven operations, in any language.
Can a running sandbox move to another provider?
No. Switching happens when you create a sandbox. You can copy files between sandboxes, but running processes and memory stay where they are.
Where do my provider keys live?
In carton, encrypted. Agents and CI jobs get carton tokens, which you can scope, limit and revoke without touching the provider account.
Is it safe to run untrusted code on my laptop?
carton reports the real isolation boundary of every provider: vm, gvisor, container, lsm or namespaces. Your policy decides which code may run where, for example "untrusted code needs a vm".