Sandboxes

A fresh machine for every task.

Full Linux microVMs with their own kernel. About 2 seconds to create from a warm pool, a held handle runs a command in about 155ms, and nothing shared with anyone else. Paused costs nothing.

agent-run.tsCreate → exec → fork → pause
import { Sandal } from "@sandal-dev/sdk";
const sandal = new Sandal({ baseUrl, apiToken, organizationId, projectId });
const key = () => crypto.randomUUID();
const rev = async (id) => (await sandal.sandboxes.get(id)).revision;
// 1, create from a published template.
const { sandbox, operation } = await sandal.sandboxes.create({
idempotencyKey: key(), kind: "virtual-machine", size: "m",
templateId, templateDigest, profile, architecture,
lifecycle: { expiresAt: new Date(Date.now() + 3_600_000) },
});
await sandal.sandboxes.waitForOperation(operation.id);
// 2, run a command.
const run = await sandal.processes.execAndWait(sandbox.id, {
idempotencyKey: key(), command: ["pnpm", "test"],
expectedSandboxRevision: await rev(sandbox.id),
});
// 3, expose a port behind your API key.
await sandal.sandboxes.exposePort(sandbox.id, { idempotencyKey: key(),
port: 3000, protocol: "http", ttlSeconds: 600,
expectedSandboxRevision: await rev(sandbox.id) });
// 4, fork the disk.
await sandal.sandboxes.fork(sandbox.id, { idempotencyKey: key(),
expectedRevision: await rev(sandbox.id) });
// 5, stop. The disk is kept.
await sandal.sandboxes.stop(sandbox.id, { idempotencyKey: key(),
expectedRevision: await rev(sandbox.id) });
~2swarm create
~155msexec p50
$0while paused
1kernel per sandbox
EUregion
Resend
bolt.new
Novu
CodeCrafters
Rork
Green-Got
Shockoe
Lightsprint
Copyfy
HireVoice
Standout
August
Two shapes

One meter, two ways to run.

A container and a full VM are not the same workload, so Sandal ships both on the same microVM substrate and the same per-second meter. Pick concurrency or pick a whole machine, the SDK is identical.

Short-lived · high concurrency

Containers →

Lean microVMs that start and exit in seconds. Fan out dozens at once for agent tool-calls, code-interpreter turns, and CI shards, then tear them straight down. Own kernel, egress rules by domain or CIDR, billed by the second.

1 → 16 vCPU · Linux · from $0.0045 / container-hr
Full machine · warm all day

Virtual Machines →

Full microVMs with their own kernel that stay warm through a working day and pause to zero between bursts. Resume in about 1-2.5 seconds with your REPL variables and open files intact. Linux today, Windows in preview; macOS VMs on a leased Mac.

2 → 16 vCPU · Linux · Windows (preview) · from $0.036 / VM-hr
Both shapes bill by the second and cost nothing while paused. See the full rate card →
Inside the box

Everything inside the box.

Six primitives cover the whole surface: run things, move files, expose ports, branch state, keep data, and control what the guest can reach.

Commands & PTY

Run it buffered, streamed, or interactive.

exec runs a command and hands back its output and exit code, or a resumable event stream for long jobs. Use a PTY shell (sandal shell) when the process checks isatty(): REPLs, top, anything that reacts to a resize.

const r = await sandal.processes.execAndWait(id, {
idempotencyKey: key(), command: ["pnpm", "test"],
expectedSandboxRevision: await rev(id),
});
// still running? follow the durable output stream
for await (const ev of sandal.processes.streamEvents(id,
r.process.id, { afterSequence: r.nextSequence })) {
process.stdout.write(atob(ev.dataBase64));
}
Filesystem

Talk to the disk, not to a shell.

Read, write, list and remove paths directly against the sandbox filesystem, no shell in between. Every write is idempotent and fenced on the sandbox revision, so a retry never lands twice.

await sandal.files.write(id, {
idempotencyKey: key(), path: "/app/x.ts",
offset: 0, truncate: true, createParents: true,
dataBase64: btoa(src), expectedSandboxRevision: await rev(id),
});
const { dataBase64 } = await sandal.files.download(id,
"/app/config.json", { offset: 0, limit: 65_536 });
Preview URLs

Any port, one authenticated HTTPS URL.

Expose a listening port and get an HTTPS URL that routes to that sandbox and that port only. Requests carry your API key or a short-lived access token, and the exposure ends with its TTL or the sandbox. Share links are time-bounded (up to 24 h), optionally single-use and revocable.

const { exposure } = await sandal.sandboxes.exposePort(id, {
idempotencyKey: key(), port: 3000, protocol: "http",
ttlSeconds: 600, expectedSandboxRevision: await rev(id),
});
// once getPortExposure(id, exposure.id) is "ready":
await fetch(exposure.url, {
headers: { Authorization: `Bearer ${apiKey}` },
});
Snapshots & forks

Branch a machine like you branch a repo.

Snapshot a disk in about 7-11 seconds, or fork it in about 10-15. A fork starts from the parent’s exact disk state with a new ID, new tokens and its own TTL clock. Disk only: running processes do not carry over.

await sandal.processes.execAndWait(id, { // pay setup once
idempotencyKey: key(), command: ["pnpm", "install"],
expectedSandboxRevision: await rev(id),
});
const child = await sandal.sandboxes.fork(id, {
idempotencyKey: key(), expectedRevision: await rev(id),
});
// both have node_modules; they diverge from here
Persistent volumes

Keep the cache, throw away the machine.

A volume is named storage that outlives any single sandbox, mounted at a path you choose. Point your package store or build cache at one and a cold sandbox stops paying the cold-install tax. Volume snapshots are coming.

// illustrative
const vol = await sandal.volumes.create({
name: "pnpm-store", sizeGb: 20,
});
await sandal.sandboxes.create({ /* … */
volumes: [{ id: vol.id, mountPath: "/root/.pnpm-store" }],
});
Network policy

Cut the guest off with one field.

Create a sandbox with allowInternet: false and it reaches nothing outside: package installs, exfiltration and callbacks all fail at the network edge. Or allow and deny by domain or CIDR, enforced in about 3 seconds on a running sandbox. Brokered secrets, injected only into HTTPS requests to hosts you allow, are in preview.

const { sandbox } = await sandal.sandboxes.create({
idempotencyKey: key(), kind: "virtual-machine",
templateId, templateDigest, profile, architecture,
size: "s", lifecycle: { expiresAt },
networkPolicy: { allowInternet: false },
});
// curl https://example.com in the guest now fails
The loop

Create → Run → Return → Destroy

One call to get a machine, one to do the work, one to take the result out, and one to give it back. A delete wipes the disk.

agent-run.ts
import { Sandal } from "@sandal-dev/sdk";
const sandal = new Sandal({ baseUrl, apiToken, organizationId, projectId });
const key = () => crypto.randomUUID();
const rev = async (id) => (await sandal.sandboxes.get(id)).revision;
// 1, create from a published template.
const { sandbox, operation } = await sandal.sandboxes.create({
idempotencyKey: key(), kind: "virtual-machine", size: "m",
templateId, templateDigest, profile, architecture,
lifecycle: { expiresAt: new Date(Date.now() + 3_600_000) },
});
await sandal.sandboxes.waitForOperation(operation.id);
// 2, run a command.
const run = await sandal.processes.execAndWait(sandbox.id, {
idempotencyKey: key(), command: ["pnpm", "test"],
expectedSandboxRevision: await rev(sandbox.id),
});
// 3, expose a port behind your API key.
await sandal.sandboxes.exposePort(sandbox.id, { idempotencyKey: key(),
port: 3000, protocol: "http", ttlSeconds: 600,
expectedSandboxRevision: await rev(sandbox.id) });
// 4, fork the disk.
await sandal.sandboxes.fork(sandbox.id, { idempotencyKey: key(),
expectedRevision: await rev(sandbox.id) });
// 5, stop. The disk is kept.
await sandal.sandboxes.stop(sandbox.id, { idempotencyKey: key(),
expectedRevision: await rev(sandbox.id) });
  1. 01

    Ask for a machine.

    One call boots a microVM from a published template, with its own kernel and its own disk.

  2. 02

    Do the work.

    Exec commands, attach a PTY, write files, install packages, start a server on any port you like.

  3. 03

    Take the result out.

    Read stdout and exit codes, stream logs, pull artifacts off the filesystem, or hand back a preview URL.

  4. 04

    Give it back.

    Pause for $0, fork it for the next branch of work, or delete it; a delete wipes its disk.

Lifecycle

Six states, and what each one costs.

A sandbox moves through one state machine for its whole life. Here is the table, including the billing column most vendors leave out.

State
Billed?
creatingMicroVM is booting from a template.
No
runningKernel is live, CPU and RAM metered.
Active CPU + RAM
pausedMemory kept on the same sandbox, CPU released.
No
stoppedProcess exited, disk retained, needs a fresh boot.
No
archivedDisk snapshot kept, compute reclaimed.
Storage only
deletedGone. Its disk is wiped before reuse.
,

creating → running ⇋ paused → archived → deleted, with stopped as a side exit from running. Full lifecycle reference →

Pause ≠ stop

Pause keeps the memory.

pause() freezes exact in-memory state and releases the CPU, so resume() returns in about 1-2.5 seconds with your REPL variables and open file descriptors intact.

Stop

Stop tears the VM down.

stop() ends the process and keeps the disk; a later start() reboots with that disk. Neither state is billed.

Archive

Cold storage, storage-only billing.

An archived sandbox keeps its disk snapshot with its compute reclaimed. Deleting it deletes the snapshot.

Templates & images

Build the stack once. Fork it after that.

A template is the base filesystem a sandbox boots from. Start on a published catalog template today; custom template builds are coming soon.

Custom templates

Coming soon

Published catalog templates (a full Linux VM and a lean container base) ship with a working toolchain. Custom templates will build from a Dockerfile-like spec, cached at the block level, so a rebuild re-snapshots only the layers that changed. Sizes run from xs (1 vCPU, 1 GiB, 10 GiB disk) to xl (16 vCPU, 32 GiB, 160 GiB). The default template runs without sudo; a root + FUSE template is in preview.

Sandalfile
# coming soon, illustrative
FROM sandal-sandbox-base-beta-20261030-1
RUN apt-get install -y postgresql-client
COPY package.json pnpm-lock.yaml /app/
WORKDIR /app
RUN pnpm install --frozen-lockfile
# cached per layer; only changed layers re-snapshot

Build once, fork many

A graph op, not a disk copy

A dependency install you run 500 times a day is 500 billable installs. Run it once in a parent, fork the result, and you pay for the install once plus a near-constant cost per fork.

shard-tests.ts
// Do the expensive part a single time.
await sandal.processes.execAndWait(base, {
idempotencyKey: key(), expectedSandboxRevision: await rev(base),
command: ["sh", "-c", "pnpm install --frozen-lockfile && pnpm build"],
});
// Then branch it, one fork per test shard.
const shards = [];
for (const n of [1, 2, 3]) {
const { sandbox, operation } = await sandal.sandboxes.fork(base, {
idempotencyKey: key(), expectedRevision: await rev(base),
});
await sandal.sandboxes.waitForOperation(operation.id);
shards.push(sandbox.id); // run pnpm test --shard=n/3 in each
}
SDKs

Same three lines, three languages.

Create a sandbox, run a command, read the result. TypeScript and Python wrap the same REST API you can hit with curl.

TypeScript

@sandal-dev/sdk · private beta

Typed end to end. Every mutation takes an idempotency key and the revision it expects, so retries are safe and races fail loudly instead of clobbering state.

create-and-exec.ts
import { Sandal } from "@sandal-dev/sdk";
const sandal = new Sandal({
baseUrl: "https://api.sandal.dev",
apiToken: process.env.SANDAL_API_KEY!,
organizationId: process.env.SANDAL_ORGANIZATION_ID!,
projectId: process.env.SANDAL_PROJECT_ID!,
});
const { sandbox, operation } = await sandal.sandboxes.create({
idempotencyKey: crypto.randomUUID(), kind: "virtual-machine",
templateId, templateDigest, profile, architecture, size: "s",
lifecycle: { expiresAt: new Date(Date.now() + 3_600_000) },
});
await sandal.sandboxes.waitForOperation(operation.id);
const run = await sandal.processes.execAndWait(sandbox.id, {
idempotencyKey: crypto.randomUUID(), command: ["pnpm", "test"],
expectedSandboxRevision: (await sandal.sandboxes.get(sandbox.id)).revision,
});

Python

sandal-sdk · private beta

The same surface with snake_case names, async throughout. The REST API underneath takes an Idempotency-Key on every mutation.

create_and_exec.py
import os, uuid
from sandal import Sandal, SandboxTarget
from sandal.models.sandbox_size import SandboxSize
from sandal.models.sandbox_cpu_architecture import SandboxCpuArchitecture
from sandal.models.sandbox_lifecycle_policy_input import SandboxLifecyclePolicyInput
sandal = Sandal(SandboxTarget(
base_url="https://api.sandal.dev",
api_token=os.environ["SANDAL_API_KEY"],
organization_id=os.environ["SANDAL_ORGANIZATION_ID"],
project_id=os.environ["SANDAL_PROJECT_ID"],
))
admitted = await sandal.sandboxes.create(
idempotency_key=str(uuid.uuid4()), kind="virtual-machine",
template_id=template_id, template_digest=template_digest,
size=SandboxSize("s"), architecture=SandboxCpuArchitecture("amd64"),
lifecycle=SandboxLifecyclePolicyInput(expires_at=expires_at),
)
await sandal.sandboxes.wait_for_operation(admitted.operation.id, timeout_seconds=300)
sb = await sandal.sandboxes.get(admitted.sandbox.id)
proc = await sandal.processes.exec(sb.id, command=["pnpm", "test"],
expected_sandbox_revision=sb.revision, idempotency_key=str(uuid.uuid4()))

Prefer raw HTTP? POST to api.sandal.dev/v1/organizations/{org}/projects/{project}/sandboxes with a bearer key and an Idempotency-Key header. The SDKs are in private beta, not yet on npm or PyPI; get the bundle from hello@sandal.dev. API reference →

Where they show up

Three places a fresh machine pays for itself.

Agent loops

A machine per turn. The model proposes a command, the sandbox runs it, the output goes back into context. Pause between turns and the idle time is free.

Preview environments

One per pull request. Fork a warm parent that already has dependencies installed, check out the branch, expose the dev server. The URL dies with the sandbox.

Code interpreter

Untrusted input, contained. Arbitrary generated code runs against its own kernel, with egress cut off or limited to the hosts you allow. The worst case is a wasted sandbox, not a shared host.

Pricing

Price your sandboxes.

Billed per second while the machine runs, and $0 while paused. Pick a container fleet or a VM fleet, set the size and the hours, and see it against what the same work costs on the field.

OS
CPU
Memory
Concurrent machines50
Hours each240 hr each

Compare Price

Sandal4 vCPU / 8 GB · $0.036/hr$432
Modal$0.0236/vCPU + $0.008/GB4.4×$1,900
Daytona$0.0504/vCPU + $0.0162/GB9.2×$3,974
E2B$0.0504/vCPU + $0.0162/GB9.2×$3,974
Vercel Sandbox$0.128/vCPU + $0.0212/GB19×$8,179

Pricing breakdown

ItemQuantityCost
VM time12,000 VM hrs$432
Paused timeUnmetered$0
Estimated total for 12,000 VM hrs$432
You save 77% a month against
$1,468

Billed by the second at $0.036/hr for 4 vCPU / 8 GB. Others at their published unit rates for the same shape, wall-time assumed; a paused Sandal machine is not billed.

An agent that pauses between turns pays only for the turns, a 4 vCPU sandbox active 8 hours and paused the other 16 costs about $0.29 for the day.

Under the floor

Built to disappear.

Infrastructure an agent has to wait for is infrastructure the agent will work around. The target is a machine that arrives faster than the model can decide what to do with it.

01 / Own kernel, own metal

Firecracker on bare metal.

Sandboxes run as Firecracker microVMs on bare-metal machines we rent whole in Germany, Finland and Luxembourg. Full VMs move to Cloud Hypervisor. Each guest gets its own kernel, so there is no shared kernel to escape into.

02 / Warm pools

Pre-booted, per template.

A size s create usually boots nothing: pools hold pre-booted microVMs, one cohort per template, refilled as they drain. Size m and up boots cold, in about 12-16 seconds. Claiming one hands it a fresh identity, a fresh network fence and fresh credentials.

03 / Snapshots

Disk on demand, memory on pause.

Take a disk snapshot when you want one (about 7-11 seconds) and fork from it (about 10-15). Pause keeps RAM on the same sandbox; memory snapshots and memory forks are not offered.

Isolation

Assume the guest is hostile root.

The workload is code nobody reviewed, running unattended, at machine speed. Nothing in the design depends on a guest behaving. Forks never inherit the parent’s live credentials, and a delete wipes the disk (its blocks are zeroed before reuse).

Kernel

A kernel per sandbox, not a namespace.

Your sandbox is a microVM, not a container sharing the host kernel with other tenants. A dedicated kernel removes the cross-tenant escape surface instead of patching it.

Network

Own netns, your egress rules.

Each guest gets its own network namespace and TAP device. Egress is open by default; allow or deny by domain or CIDR, with DNS filtering, or cut it off entirely. Management interfaces never listen where a guest can reach.

Deletion

Wiped on delete, volumes keyed.

A sandbox’s disk is wiped on delete: its blocks are zeroed before reuse. Persistent volumes are encrypted with their own key, and erasing one destroys that key on the host.

Plans

One balance. Every machine you run.

Containers and VMs draw from the same credit pool as your runners (Android devices in preview, iOS simulators on request, Xcode builds coming), billed by the second at one published rate card.

Starter

For a solo build or a first agent in production.

$20/ month

$20 of usage credits

≈ 550 VM-hours or 33,000 CI minutes

Contact us
  • 20 concurrent machines
  • Committed in-plan rates on every product
  • Linux sandboxes, VMs, runners; Windows in preview
  • Per-second billing, paused is free
  • Full API, SDKs, CLI & local MCP server
  • Unlimited seats
  • Community support
Most popular

Team

Apple silicon on request, and a balance that rolls over.

$100/ month

$100 of usage credits

≈ 2,700 VM-hours or 10,000 Mac build minutes

Contact us
  • 100 concurrent machines
  • Everything in Starter, plus:
  • macOS VMs & iOS simulators (on request), Xcode builds (coming); Android (preview)
  • Unused credits roll over one month
  • Usage exports & per-second line items (coming)
  • Email support

Business

Higher ceilings for a team leaning on the fleet daily.

$250/ month

$250 of usage credits

≈ 6,900 VM-hours or 25,000 Mac build minutes

Contact us
  • 300 concurrent machines
  • Everything in Team, plus:
  • Raised concurrency
  • Priority support & shared Slack channel
  • Single sign-on, SAML / OIDC (coming)
  • Volume credit rate

Enterprise

Dedicated capacity, your compliance surface, one invoice.

Custom

Committed volume rate

Committed volume rate, negotiated per account

Talk to sales
  • Reserved bare-metal capacity
  • BYOC or self-host the control plane (coming)
  • SSO & SCIM (coming), audit events, EU data residency
  • Annual invoicing, MSA, DPA
  • Support SLA (coming) & solutions engineering
  • More regions (coming; EU today)

Every plan spends its credit pool first, then usage keeps flowing and bills per second at your committed in-plan rate, no hard stop mid-run, no forced upgrade. Without a plan you pay the on-demand rate instead. Prices are illustrative pending final list pricing; the per-second billing model is final.

Rate card

Every machine, every size.

Linux

MachineIn-plan / container-hrOn-demand / container-hr
0.5 vCPU / 1 GB$0.0045$0.0067
1 vCPU / 2 GB$0.009$0.013
2 vCPU / 4 GB$0.018$0.027
4 vCPU / 8 GB$0.036$0.054
8 vCPU / 16 GB$0.072$0.108
16 vCPU / 32 GB$0.144$0.216

Priced from the Linux formula: $0.0065 / vCPU-hr + $0.00125 / GB-hr. Any vCPU:RAM combination in between is priced the same way. On-demand is 1.5× the in-plan rate. All usage bills by the second; paused machines are not billed.

Get started

Give your AI agents somewhere to run today.

Your agents get their own machines on Linux today, Windows and Android in preview, macOS VMs and iOS simulators on request, and you stop paying for idle.

Private beta · request access