On this page
How to Pause an AI Agent's Sandbox While It Waits for Approval
Short answer: when an agent stops to ask a person for approval, hold its state in one of two places. Either keep the decision in your workflow engine and rebuild the sandbox afterwards, or snapshot the whole sandbox (memory and disk) and resume it exactly where it stopped. Pick the snapshot when the agent's working state is expensive to rebuild, and set the sandbox's expiry with the wait in mind.
CreateOS Sandbox gives untrusted or agent-written code its own Firecracker microVM, and it can pause, resume and fork that machine. This page is for engineers building agents that run for hours and stop for a human decision partway through.
Key takeaways
- There are two ways to wait: hold the state in the workflow and discard the sandbox, or pause the sandbox and keep the machine.
- A CreateOS Sandbox pause snapshots memory and disk, tears down the live VM and keeps the sandbox's identity, disks, networks and environment.
- Pausing takes about 1.4 s; resuming on the same host takes under 0.7 s; a cold resume on a different host takes 11 to 13 s.
- A sandbox's expiry clock keeps counting while it is paused. A long approval can outlive the sandbox.
- After resume, reconnect anything external: open database connections and sockets do not survive the pause.
Where should an agent's state wait during a human approval?
In the workflow if the state is small; in a machine snapshot if it is not.
| Hold state in the workflow | Snapshot the sandbox | |
|---|---|---|
| What waits | The plan and the approval request, in your orchestrator | The whole machine: memory, disk, running processes' state |
| Sandbox during the wait | Destroyed; rebuilt after approval | Paused; no live VM |
| Cost to continue | Rebuild: reinstall packages, re-clone, re-run setup | Resume: restore the snapshot |
| Good for | Short setups, stateless tools | Long builds, warmed caches, in-memory agent state |
| Example | Temporal's durable approvals with NVIDIA OpenShell rebuilds the sandbox from stored grants | CreateOS Sandbox pause and resume |
Both are sound. The mistake is the third option: leaving a live sandbox running while nobody answers. Deciding which actions need a person at all is a separate question, covered in where approval gates belong.
How does pause and resume work in CreateOS Sandbox?
Pause snapshots the running sandbox to durable storage and tears down the live VM. The sandbox keeps its identity, disks, networks and environment, and moves through running → pausing → paused. Resume restores it onto a compatible host and moves it back to running. Source: sandbox lifecycle.
In practice:
- The agent reaches the approval step and your code sends the request to a person.
- Your code pauses the sandbox through the SDK, the CLI or the REST API. A process inside the sandbox can also pause it itself through the in-sandbox self-signal, with no API key.
- Pause, resume and fork are asynchronous in the REST API: they return 202 with an
X-Poll-Afterheader, and you pollGET /v1/sandboxes/{id}until the status reaches the expected value. - When the approval arrives, resume the sandbox and continue the run.
Measured speeds on CreateOS-managed infrastructure, stated with their conditions: pause about 1.4 s; resume on the same host under 0.7 s; a cold resume on a different host 11 to 13 s. Resume time depends on snapshot size, host load and whether the host has a cached copy.
What can go wrong when an agent waits for approval?
Three things, all avoidable:
- The expiry passes during the wait. A sandbox can be set to destroy itself 2 to 1,440 minutes after it first runs. That clock keeps counting while the sandbox is paused and does not reset on resume. If approvals can take a day, either set expiry for the longest wait you accept or leave expiry off and destroy the sandbox yourself. Save results before any deadline.
- External connections are dead on resume. Database connections, sockets and long-poll requests do not survive a pause. Reconnect after resume.
- Nobody answers. An approval with no owner leaves a paused sandbox forever, and paused sandboxes still count toward your plan's concurrent-sandbox cap until destroyed. Give every approval a timeout and a default action, then destroy the sandbox.
Should you fork instead of waiting?
Fork when the person might say "try both". Forking clones a paused sandbox into a new sandbox with its own id, IP and placement; the original is untouched. If an approval is a choice between two plans, fork once, run each plan in its own copy, and keep the one that is approved.
When you do not need a machine snapshot
- The agent's setup takes seconds. Rebuilding is simpler than managing paused sandboxes.
- The approval comes before any code runs. Ask first, then create the sandbox.
- The agent's state already lives outside the sandbox, in a database or object store. Hold the decision in the workflow and discard the machine.
Common questions
Can I pause an AI agent's sandbox while waiting for a human? Yes. CreateOS Sandbox pause snapshots memory and disk, tears down the live VM and keeps the sandbox's identity, disks, networks and environment until you resume it.
How long does it take to pause and resume a CreateOS sandbox? Pausing takes about 1.4 s. Resuming on the same host takes under 0.7 s. A cold resume on a different host takes 11 to 13 s, depending on snapshot size and host load.
Does a paused sandbox keep its expiry timer running? Yes. A CreateOS sandbox's expiry clock starts when it first runs, keeps counting while it is paused and does not reset on resume. Plan expiry around the longest approval you accept.
Do network connections survive a sandbox pause? No. Connections to external services, such as databases and sockets, must be re-opened after resume. Files on disk and in-memory state are restored.
Can an agent pause its own sandbox? Yes. A process inside a CreateOS sandbox can pause or delete it through the in-sandbox self-signal, without an API key.
Is it better to rebuild the sandbox after approval instead? When setup is fast and state lives outside the sandbox, yes. Snapshotting pays off when rebuilding means reinstalling packages, re-cloning repositories or redoing long setup.
About CreateOS
CreateOS runs AI agents and the code they write. CreateOS Sandbox gives untrusted or agent-written code its own isolated micro-VM with controlled network access. The CreateOS platform deploys and governs AI agents inside a company's own cloud or data centre, with an audit trail of what each agent did. Start at createos.sh.
Next step
Read the sandbox lifecycle, then start one from CreateOS Sandbox.



