Box states
When a box freezes, wakes and is archived, what counts as use, what keeps a box awake, and how the app shows whether the conversation using a box is still at it.
claimed → ready → takeover (optional)
↕
frozen → archived → terminated
↓ ↑
stopping ───┘
Idle rules, as the sandbox_start description states them:
An idle box is frozen after 10 minutes without a call, with /work kept; the next call thaws it. A frozen box unused 24 hours is archived: its disk is kept 30 days after its last use, and any call or page load restores it. idleTimeoutMin sets your own limit instead of these: after that many minutes without a call the box is archived, frozen or not. It is capped at 10080 minutes (7 days). An attached phone freezes and thaws with its box (an iPhone restarts its apps); while frozen it holds no device slot and is not billed. A pending sandbox_review keeps neither the box nor its phone awake: they freeze and are archived by these same rules, and opening the review wakes a frozen or archived box. Commands started with background: true (a dev server, a long build) count as activity for up to 1 hour after your last call; after that a box freezes anyway (they carry on when the next call thaws it). Requests through the box's URLs count as activity for up to 2 hours after the last call; after that the box freezes, and the next page load in a browser wakes it again (a few seconds). Background fetches from an open tab don't wake it. With no room on any host it fails with "no box capacity right now" (HTTP 503 over REST); waitForCapacitySec waits for room instead.
In detail:
- Use: where this page says use (the last use, for one), it means a tool call that acts on the box, or a wake. The calls that act on a box are
sandbox_start,sandbox_exec,sandbox_sync,sandbox_get(sosandbox_pulltoo),sandbox_shot(except capturing several pages withurls),sandbox_scene,sandbox_wire,sandbox_procs, andsandbox_secretsandsandbox_buildfor a box; a person's takeover (connecting to the box's screen, typing and clicking on it) and a link connection from another box count too.sandbox_status,sandbox_list,sandbox_media,sandbox_sayandsandbox_feedback, which only read state or leave a message, do not count; nor dosandbox_review,sandbox_device,sandbox_takeoverandsandbox_shotwithurls, though on a frozen box they wake it first (exceptsandbox_devicewithlist), and that wake counts.sandbox_draft,sandbox_architectureandsandbox_schemawork on the server and never run anything in the box: given a box'sidthey count as use of it (they movelastUsedAt) but do not wake a frozen box; withoutidthey use no box. The last use is when the last of these calls started or ended, or the last wake happened, whichever is later:lastUsedAtinsandbox_statusandsandbox_list. A call that acts on the box counts from the moment it starts, so the box does not freeze under asandbox_syncorsandbox_getthat is still running (a foregroundsandbox_execkeeps it awake for as long as it runs); and a call of any kind that arrives while the box is being frozen waits the few seconds the freeze takes, then wakes the box and runs, instead of failing. - A box is
frozenafter 10 minutes without activity: its memory is snapshotted,/workis kept and it stops billing box time. Activity is use (previous item), or a request through one of the box's URLs (each HTTP request, and a WebSocket once, when it opens) for up to 2 hours after the last use, so a person usingwebUrlkeeps the box awake for that long; the app's live view of the screen and the live thumbnails in its box list do not (both are streamed while someone looks, not stored, unlike the box pictures under Credits). After those 2 hours, requests through the URLs no longer keep it awake: a person still using a page may see the box freeze mid-session, and their next page load wakes it (below). A box does not freeze while a person has taken it over, a foreground command is running, or another awake box has a link connection open to it, nor while it is recording, until a full hour has passed since the last use; after that, once nothing else listed here keeps it awake, the recording is stopped without uploading it (seesandbox_shot). A command started withbackground: true(a dev server, a long build) keeps the box awake only until 1 hour after the last use; after that the box freezes anyway, and the process carries on when the next call thaws it. Before the box freezes, each persistent folder it has attached (sandbox_startpersist) that changed since its last save is saved, and the programs that have files open in it are stopped first (SIGTERM, then SIGKILL after 20 seconds): after the wake they are not running and have to be started again. A folder that did not change is left alone.sandbox_statusgivesfreeze:at, when the box will freeze if nothing changes, andblockedBy[], what keeps it awake right now (background,url,recording,personandwoken_aheadwith theuntilthey count to;takeover,foreground,linkandphoneuntil they end, with noat). A box stillreadywell past 10 idle minutes is held by one of these. - A frozen box is woken, in a couple of seconds (about a minute when phones are attached, since they come back first), by any tool call naming it except
sandbox_status,sandbox_say,sandbox_feedback,sandbox_stop,sandbox_devicewithlist, andsandbox_draft,sandbox_architectureandsandbox_schema, by a link connection from another box, by a person loading one of its pages in a browser (next item), by a person opening the box in the ParallelSandbox app (its page, its review card or share link, Use it, or its screen), which wakes it by itself and shows what it is waiting for (the box thawing, a host being added, the phone coming back) until the screen is back, or byPOST /v1/boxes/{id}/wakewith an OAuth access token or API key. A wake counts as use. Waking needs credits on the account (402 otherwise).sandbox_stopworks on a frozen box too. Nothing is lost. - Loading a page of a frozen box in a browser wakes it: a
GETorHEADwithSec-Fetch-Mode: navigate(a typed URL, a link, a reload), or, from a browser that sends noSec-Fetch-Mode, one whoseAcceptincludestext/html. The edge asks for the box to be thawed and answers with a small page, "Waking this box… This page reloads by itself in a few seconds." (503,Retry-After: 3,Cache-Control: no-store); the page reloads itself until the app shows, about 10 seconds in all. The wake counts as use. Each box gets at most one wake request every 15 seconds; page loads in between get the same page.- Nothing else through the URLs wakes it:
fetchand XHR from an open page, images and scripts, WebSockets andPOSTs get 503{"error":"box is frozen","status":"frozen"}. A tab left open and polling neither wakes the box nor keeps it awake past the 2 hours above. - When the account is out of credits, the page says "This box is paused" (402) and does not reload by itself: add credits in the app, then reload.
- An archived box comes back this way too: the page says "Restoring this box…" and reloads itself until the box is back, in a minute or two. A deleted box does not: its URLs answer 503
box is terminated, and a new box has new URLs.
- Nothing else through the URLs wakes it:
- While a person has the box open in the app (any of the pages above, on screen, touched within the last 30 minutes), the app reports in every minute and the box counts as in use: neither it nor its phones freeze until 10 minutes after they leave, and
freeze.blockedBylistspersonuntil then. This is not a use:lastUsedAtand the AI's state do not move. A window left open and untouched for 30 minutes stops reporting, the box freezes as usual, and the next tap wakes it again. - When the person opens the ParallelSandbox app (or brings it back to the front, or goes back to its list of what waits for them), the app wakes ahead the boxes of the two newest reviews waiting for them that are frozen, so a review opens without "Waking this box…". This is not a use:
lastUsedAtdoes not move, and the idle rules archive the box at the same time as if it had stayed frozen (stopsAtdoes not move). The box stays awake for 10 minutes with its phones back, andfreeze.blockedBylistswoken_aheaduntil then; if the person does not open it, it freezes again. When they open it, that counts as a use, as waking a frozen box always did. At most two boxes of an account are woken ahead at a time, and a box with no waiting review is never woken this way. - The box's URLs stay the same across freeze and thaw; only a new box has new ones.
- The first launch of a large program after a thaw is slower than usual, often several times (an Electron app that opens in 3 seconds can take 12): its files are no longer in the box's memory cache. Launch it once to warm it up before you time a cold start or record one.
- After a thaw, boxd closes the connections to environment addresses and links that were open before the freeze (it notices the thaw within about 15 seconds); connections opened after the thaw stay. Programs have to reconnect: database pools usually do on their own, and long-lived clients should retry.
- A frozen box is archived 24 hours after its last use, or after it was frozen if that is later, so a box frozen because credits ran out keeps the full 24 hours. A box has two kinds of snapshot, as on Vercel, Modal, Daytona and E2B: a hot one, the freeze (memory and disk), kept until the idle rules archive the box; and a cold one, only the box's disk (the blocks that differ from the box image, compressed), kept until 30 days after its last use. A box handed over with
sandbox_reviewand waiting under Ready for you freezes and is archived the same way: a pending review keeps nothing awake, and archiving does not end it. The person opening the review wakes the box while it is frozen and restores it once it is archived, while the link is valid (7 days); the review ends only when the box is deleted (its archived copy expires, or someone stops it once it is archived), and then the version has to be handed over again on a new box. After it is deleted, the app lists it under Stopped (last 7 days), with its screenshots available until 30 days after capture and its recordings until 7 days (sandbox_mediaandGET /v1/boxes/{id}/mediastill return the screenshots once the app no longer lists the box). A box withidleTimeoutMinis archived after that many minutes without use instead, frozen or not; a page load that wakes it restarts the count, like any wake. stopsAtinsandbox_statusandsandbox_listis when these rules archive the box unless something uses it before then (absent when they never will). From 30 minutes beforestopsAt, every tool result in a conversation that used the box, or that names it, ends with a line such asbox <id>: the idle rules archive it at <time> (in 25 minutes) unless something uses it before then.; a call that acts on the box pushesstopsAtback,sandbox_statusandsandbox_listdo not. What is only in memory does not survive archiving.- A resident box (
PUT /v1/boxes/{id}/residentwith{"resident": true}, see REST) is exempt from these idle rules: it is never frozen or stopped for being idle and has nostopsAt;sandbox_statusshowsresident: trueandfreeze.blockedByresident. If it is frozen anyway (credits ran out, its host was drained), it is woken on the next check. It bills box time the whole time it is awake. Its attached phones still freeze when idle and come back when the box is used. - An archived box has the status
archivedinsandbox_status,sandbox_list,GET /v1/boxes/{id}and the app, where its card stays, marked Archived.restorableUntilsays until when its disk is kept (30 days after its last use), andsandbox_statusalso givesarchived(at,until,storedBytes). Opening it brings back the same box, with the same id, URLs and scene key, whoever opens it and from wherever: any tool call on it that would wake a frozen box (sandbox_exec,sandbox_sync,sandbox_getand the like), a browser loading one of its URLs, the person opening it in the app, or someone opening its review link;sandbox_start { "restore": "<id>", "goal": "<its goal>" }does the same. Restoring takes a minute or two and needs credits. The box boots from its saved disk:/workand the rest of its files, installed packages, Docker images and data are there; what was only in memory is not (running programs, tmpfs,/dev/shm). Commands started withbackground: truethat were running when it froze (a dev server) start again with the same command, directory, note and readiness check, under a newbgId. Its persistent folders are attached again with their latest saved copy (sandbox_start); attached phones are not kept. If a restore fails (no host has room, a platform error), the box stays archived and the next call or page load tries again; the failed attempt counts as a use, so the 30 days do not run out meanwhile. sandbox_stop, Shut down in the app andDELETE /v1/boxes/{id}archive a box the same way, without waiting for these rules: a running box is frozen at once (a takeover ends and its phones are released), its status isstoppingwhile the platform archives it, within a few minutes, and thenarchived, its disk kept 30 days from the stop (restorableUntil). While it isstopping, anything that would wake a frozen box (above) wakes it instead and calls off the stop, and the box runs under these idle rules again. Stopping an archived box deletes its archived copy for good (terminated), and a box that cannot be archived is deleted at once (sandbox_stop).- A person trying a box needs nothing from you: their use of its URLs keeps it awake for up to 2 hours after the last use. After that it freezes even while they use it; their next page load wakes it in about 10 seconds, and that wake counts as use, so another 2 hours start (the same after lunch). Set
idleTimeoutMinwhen you want a limit of your own. To look at a page other than the scene yourself,sandbox_shot { "id": "<id>", "target": "url", "url": "http://127.0.0.1:8082/" }opens it in a fresh Chromium in the box and returns a screenshot;curlinsandbox_execgives you the HTML. - An attached phone freezes with its box: it freezes only when the box is about to, so whatever keeps the box awake keeps its phones running too; the box freezes once its phones are frozen; a frozen phone holds no device slot and does not bill; and the call that thaws the box brings it back attached with the same
deviceIdandserial(an Android emulator resumes from a snapshot of its memory; an iPhone simulator boots again with its apps and data kept and opens again the app that was in front, the newest running app that is not Apple's). If its device host has no free slot at that moment, it stays frozen until one frees up (sandbox_device). Aboxsandbox_reviewof its app does not change this: while it waits for the person, the phone freezes with the box as usual, and comes back with the box when the person opens the review.
A box archived by these rules has a statusReason that says so, such as archived: frozen and unused for … or archived: unused for …, over idleTimeoutMin …; a stopped one says who stopped it, such as archived: sandbox_stop by … or archived: stopped via API ….
While a person has the box's screen (a takeover, or a box review they opened), every tool keeps working on the box, and sandbox_shot results carry takeover: true. What you change meanwhile (a sandbox_sync that reloads a dev server, restarting the app, typing on the display) happens under their eyes, so do not restart or reinstall the app while they are trying it unless you need to.
Any state can turn into interrupted: the host machine under it is gone (reclaimed by the cloud, or failed). sandbox_status reports the reason; the next tool call on that box returns the same. Start a new box and rerun. When the cloud reclaims a machine with notice, its boxes are frozen and saved first, and the next call thaws them on another host, so they are not interrupted at all. For a box that could not be saved whole, its /work may still have been, and the error then says Its /work was saved at <time>: sandbox_get or sandbox_pull with path /work on the interrupted box returns that copy as work.tar.gz (without node_modules, caches and files over 64 MiB; changes after that time are lost). Nothing else on an interrupted box survives, except its persistent folders as they were last saved (a freeze always saves them first).
Which conversation is using a box
The stdio adapter (parallelsandbox-mcp 0.3.0 or later) tells ParallelSandbox whether its conversation is still open:
- When it starts, it picks a random id and sends it as the
X-Psbx-Agentheader on every MCP and REST call. - After the first tool call it sends
POST /v1/agents/<id>/heartbeatwith{"client": "<MCP client name>"}every 60 seconds. - When the conversation closes (stdin ends, or SIGTERM, SIGINT or SIGHUP) it sends
POST /v1/agents/<id>/leave. A conversation that ends without one (kill -9, a laptop asleep) counts as gone 3 minutes after its last heartbeat. A heartbeat after a leave counts the same id as back. - Nothing else is sent: no prompt, no transcript.
A box remembers the last agent id that called a tool on it; a call without the header keeps the previous one. An id is letters, digits, - and _, 1 to 64 characters: the two endpoints answer anything else with 400 agent id: letters, digits, - and _ only, at most 64, and a header that breaks the rule is ignored. A client that calls the HTTP endpoint or the REST API directly can do the same: send X-Psbx-Agent itself and call both endpoints with an OAuth access token or API key (each returns {"ok":true}). A client that sends neither leaves a box's AI state to its idle time alone: it is never left.
GET /v1/boxes, sandbox_list and sandbox_status give each live box (starting, ready, taken over, frozen, or stopping while it waits to be archived) an agent object, { "state": "working", "idleSec": 42 }; archived, deleted and interrupted boxes have none. In sandbox_list and sandbox_status it also has thisConversation: true when the box's last agent id is the calling conversation's. idleSec is the seconds since the box was last used (a tool call, a wake, a person operating its screen, a link connection) or started. state is checked in this order:
left: the box's last agent sent leave, or has sent no heartbeat for over 3 minutes.idle: the box has been unused for 1 hour or more, whether or not its conversation is still open.away: the box is frozen, or has been unused for the freeze time (10 minutes), and the conversation is still there.working: otherwise.
The same list says what is on the box's screen:
screenInUse: the virtual display shows something (a browser, an emulator); false on a box that only runs builds or tests.screenActive: true when the box isreadyandscreenInUseis true, whether or not the screen changed recently: a box whose screen sits still while the AI runs tests counts too.posterUrl: a picture of the screen as it was when the box froze (presigned, valid 1 hour), given only when the screen showed something then. A box that only runs builds or tests gets none, instead of a black desktop. Each freeze replaces the earlier poster, keeping only the newest picture (Credits). Once the box is stopped,GET /v1/boxes?all=1still gives the newest one.
The app's home page has three first-level tabs, sorted with these fields:
- Ready for you: boxes waiting for the person, with a
sandbox_reviewcard or asandbox_takeoverwaiting for them, and designs that are not final and whose latest version they have not reported on yet (sandbox_design_final). - Stopped: boxes deleted or interrupted in the last seven days that left screenshots, recordings or a review card.
- AI is testing: every other open box, with a screen or not; one with no screen cannot be taken over. Each is labeled AI is using it (
working), AI is busy elsewhere (away), AI stopped · conversation closed (left) or AI stopped · unused for 1 hour (idle). A box whose AI stopped and that is not waiting for the person has the Continue and Shut down buttons (Picking up a box another conversation left).
A stopped box is archived: its card stays where it was, marked Archived (under Ready for you while a review waits for the person), until the box is deleted, and opening it brings the box back.
Frozen is no longer shown to the person as a state: in the list a frozen box is AI is busy elsewhere or AI stopped. Opening it wakes it: its page says what it is waiting for until the box and its phone are back, and nothing is needed from you.
Every tool and topic is listed in the tool reference.