English
Get started

Agent Sandboxes Pauses with its memory

Pause a sandbox with its memory, wake it in 0.1 s

An agent’s sandbox spends most of its life waiting for the model. A pause keeps everything in it, its running processes too, at 30% of the running price, and the next call wakes it in about 0.1 s, exactly where it was.

What a pause keeps

A paused sandbox keeps its memory, its processes and its disk on its server’s disk. A dev server keeps its port open, a Python session keeps its variables, a coding agent’s conversation stays where it was, and a build half done goes on from where it stopped. You pause a sandbox with one call, pause_sandbox, or let its idle timer do it: by default, after 5 minutes with nothing happening in it.

What wakes it

Anything that reaches into it: a command, a file read or write, an open stream, a prompt to an agent, an SSH login, or a request to one of its ports. You never resume it first: the call that needs it wakes it, and is answered. resume_sandbox is there for when you want it running with nothing to do.

Measured on our servers: a resume takes 41 ms on the server and 124 ms through the API; a command sent to a paused sandbox answers in 80 ms, its wake included; and a visit to a paused sandbox’s preview URL takes about 200 ms.

How pause and resume work

A pause has the guest write its filesystems out, pauses the VM and takes a diff snapshot: only the memory the VM wrote since its last snapshot is written, and runs of pages that hold only zeroes are left out. Right after a create, a pause took 52 ms at the median for a SMALL sandbox and 85 ms for a LARGE one, through the API.

A paused sandbox keeps its place on its server: the server holds the memory its wake will need, so a wake is never refused for lack of room. That is why it resumes only there, on the same Firecracker, processor and base, and why a pause costs 30% of the running price rather than nothing.

from pethost.sandboxes import Sandboxes

sandboxes = Sandboxes()  # reads PETHOST_TOKEN
sandbox = sandboxes.create_sandbox("base")

# A server process; the call answers once it listens on port 8000.
sandboxes.run_command(sandbox.sandbox_id, command="python3 -m http.server 8000", wait_for_port=8000)
sandboxes.pause_sandbox(sandbox.sandbox_id)  # memory, processes and disk kept on its server

# This call wakes it, and the same server process answers.
page = sandboxes.run_command(sandbox.sandbox_id, command="curl -s localhost:8000 | head -n 1")
print(page.stdout)
id=$(pethost sandbox new)
pethost sandbox run "$id" -d --wait-for-port 8000 -- python3 -m http.server 8000
pethost sandbox pause "$id"
pethost sandbox run "$id" -- 'curl -s localhost:8000 | head -n 1'   # wakes it

What a paused sandbox costs

A paused sandbox is billed by the whole second at 30% of its size’s running price, with no minimum: $0.0054 an hour for SMALL, up to $0.0432 for XLARGE. Running time is never turned into paused time, and no second is counted twice. When we restart a server’s machine, its running sandboxes are paused and resumed after it, and those seconds cost nothing.

Pause or stop

A stop is the other way to keep a sandbox you are not using. A pause keeps it ready; a stop keeps it cheap:

PausedStopped
Where it isOn its server’s diskIn object storage
What is keptMemory, processes and diskThe disk; processes end
Price, SMALL$0.0054 an hour$0.03 per GiB a month of its own data
Back to runningAbout 0.1 s, at the next callAbout 0.2 s by resume_sandbox, or about 10 s a GiB when its disk is fetched back

By default a sandbox stops once it has been idle for 30 minutes, paused or not; the lifecycle says how to change that.

Limits

A paused sandbox’s size cannot change: a new size is refused until it is resumed or stopped. Its vCPUs count against your plan’s budget while it is paused, as a running sandbox’s do. When its server’s disk runs short, the paused sandboxes idle the longest are stopped early, their disks kept, and state_message says so. When a workspace’s included usage and balance are both spent, its paused sandboxes are stopped.

How it compares

As their pages read on 21 November 2026: E2B keeps memory too and charges nothing while a sandbox is paused, but bills 2 vCPU and 4 GiB at $0.1656 an hour running, against $0.018 here, and its docs give a pause about 4 seconds per GiB of memory and a resume about 1 second. Daytona pauses only its Linux VM class, and bills the disk alone while paused. boat.dev has no pause: a stop removes the VM and keeps its disk.

Read the docs

Questions

Does pausing and resuming a sandbox keep its running processes?

Yes, with its memory and its disk. While it is paused, its processes are frozen with the rest of its memory, and they go on from where they were at the wake. A command started with keep_awake keeps the sandbox from pausing while it runs, for a build or a job nobody waits on.

How much does a paused sandbox cost?

30% of its running price, by the second: $0.0054 an hour for SMALL, $0.0108 for DEFAULT, $0.0216 for LARGE and $0.0432 for XLARGE.

Can a wake fail for lack of room?

No: a paused sandbox keeps its place on its server. A wake is refused only when the workspace holds more vCPUs than its plan allows now, after a move to a smaller plan for instance.

Should I pause or stop a sandbox?

Pause what you will come back to soon: it keeps memory and processes at 30% of the running price and picks up in about 0.1 s. Stop what can wait: its processes end, its disk is kept in object storage at $0.03 per GiB a month, and a start boots it again from that disk.

Related

Give your agent a computer in 0.15 s

Start the free trial