# ParallelSandbox documentation, full text > The agent guide (SKILL.md) and every English documentation page in one file, generated when the site is built. The short index is https://parallelsandbox.com/llms.txt. This file is about 655 KB. Some fetch tools cut long files short: if your copy does not end with the line "End of llms-full.txt.", fetch the pages one by one instead, in this order. Each is also a section of this file, in the same order. 1. SKILL.md, the agent guide (about 142 KB): https://parallelsandbox.com/skill/SKILL.md 2. Team setup: several services, AWS plus an office network, Sentry (about 69 KB): https://parallelsandbox.com/en/docs/team-setup/index.md 3. Tool reference (about 15 KB): https://parallelsandbox.com/en/docs/tools/index.md 4. Tool reference: `sandbox_start` (about 26 KB): https://parallelsandbox.com/en/docs/tools/sandbox-start/index.md 5. Tool reference: `sandbox_list` (about 4 KB): https://parallelsandbox.com/en/docs/tools/sandbox-list/index.md 6. Tool reference: `sandbox_media` (about 5 KB): https://parallelsandbox.com/en/docs/tools/sandbox-media/index.md 7. Tool reference: `sandbox_status` (about 10 KB): https://parallelsandbox.com/en/docs/tools/sandbox-status/index.md 8. Tool reference: `sandbox_stop` (about 7 KB): https://parallelsandbox.com/en/docs/tools/sandbox-stop/index.md 9. Tool reference: Finishing a box (about 6 KB): https://parallelsandbox.com/en/docs/tools/finishing-a-box/index.md 10. Tool reference: Picking up a box another conversation left (about 5 KB): https://parallelsandbox.com/en/docs/tools/picking-up-a-box/index.md 11. Tool reference: `sandbox_exec` (about 30 KB): https://parallelsandbox.com/en/docs/tools/sandbox-exec/index.md 12. Tool reference: `sandbox_procs` (about 7 KB): https://parallelsandbox.com/en/docs/tools/sandbox-procs/index.md 13. Tool reference: `sandbox_sync` (about 12 KB): https://parallelsandbox.com/en/docs/tools/sandbox-sync/index.md 14. Tool reference: `sandbox_get` (about 3 KB): https://parallelsandbox.com/en/docs/tools/sandbox-get/index.md 15. Tool reference: `sandbox_pull` (about 2 KB): https://parallelsandbox.com/en/docs/tools/sandbox-pull/index.md 16. Tool reference: `sandbox_build` (about 3 KB): https://parallelsandbox.com/en/docs/tools/sandbox-build/index.md 17. Tool reference: `sandbox_wire` (about 6 KB): https://parallelsandbox.com/en/docs/tools/sandbox-wire/index.md 18. Tool reference: Links to other boxes (about 6 KB): https://parallelsandbox.com/en/docs/tools/links-to-other-boxes/index.md 19. Tool reference: Taking over a link or an environment address (about 4 KB): https://parallelsandbox.com/en/docs/tools/taking-over-a-link/index.md 20. Tool reference: `sandbox_shot` (about 11 KB): https://parallelsandbox.com/en/docs/tools/sandbox-shot/index.md 21. Tool reference: `sandbox_scene` (about 2 KB): https://parallelsandbox.com/en/docs/tools/sandbox-scene/index.md 22. Tool reference: `sandbox_say` (about 2 KB): https://parallelsandbox.com/en/docs/tools/sandbox-say/index.md 23. Tool reference: `sandbox_review` (about 16 KB): https://parallelsandbox.com/en/docs/tools/sandbox-review/index.md 24. Tool reference: `sandbox_report` (about 4 KB): https://parallelsandbox.com/en/docs/tools/sandbox-report/index.md 25. Tool reference: `sandbox_takeover` (about 2 KB): https://parallelsandbox.com/en/docs/tools/sandbox-takeover/index.md 26. Tool reference: `sandbox_feedback` (about 1 KB): https://parallelsandbox.com/en/docs/tools/sandbox-feedback/index.md 27. Tool reference: `sandbox_secrets` (about 1 KB): https://parallelsandbox.com/en/docs/tools/sandbox-secrets/index.md 28. Tool reference: `sandbox_environments` (about 5 KB): https://parallelsandbox.com/en/docs/tools/sandbox-environments/index.md 29. Tool reference: `sandbox_device` (about 23 KB): https://parallelsandbox.com/en/docs/tools/sandbox-device/index.md 30. Tool reference: `sandbox_publish_version` (about 3 KB): https://parallelsandbox.com/en/docs/tools/sandbox-publish-version/index.md 31. Tool reference: `sandbox_versions` (about 2 KB): https://parallelsandbox.com/en/docs/tools/sandbox-versions/index.md 32. Tool reference: Run a published version (about 6 KB): https://parallelsandbox.com/en/docs/tools/run-a-published-version/index.md 33. Tool reference: `sandbox_draft` (about 23 KB): https://parallelsandbox.com/en/docs/tools/sandbox-draft/index.md 34. Tool reference: `sandbox_architecture` (about 10 KB): https://parallelsandbox.com/en/docs/tools/sandbox-architecture/index.md 35. Tool reference: `sandbox_schema` (about 11 KB): https://parallelsandbox.com/en/docs/tools/sandbox-schema/index.md 36. Tool reference: `sandbox_design_final` (about 2 KB): https://parallelsandbox.com/en/docs/tools/sandbox-design-final/index.md 37. Tool reference: `logs_search` (about 2 KB): https://parallelsandbox.com/en/docs/tools/logs-search/index.md 38. Tool reference: `logs_errors` (about 2 KB): https://parallelsandbox.com/en/docs/tools/logs-errors/index.md 39. Tool reference: `logs_tail` (about 2 KB): https://parallelsandbox.com/en/docs/tools/logs-tail/index.md 40. Tool reference: Without the log service (about 2 KB): https://parallelsandbox.com/en/docs/tools/without-the-log-service/index.md 41. Tool reference: Box states (about 23 KB): https://parallelsandbox.com/en/docs/tools/box-states/index.md 42. Tool reference: Credits (about 8 KB): https://parallelsandbox.com/en/docs/tools/credits/index.md 43. Tool reference: REST (about 27 KB): https://parallelsandbox.com/en/docs/tools/rest/index.md 44. Tool reference: Other facts (about 7 KB): https://parallelsandbox.com/en/docs/tools/other-facts/index.md 45. Environments: plug in your own dev (about 32 KB): https://parallelsandbox.com/en/docs/environments/index.md 46. Quick start (about 5 KB): https://parallelsandbox.com/en/docs/quickstart/index.md 47. How it works (about 5 KB): https://parallelsandbox.com/en/docs/how-it-works/index.md 48. Secrets (about 5 KB): https://parallelsandbox.com/en/docs/secrets/index.md 49. Example repos (about 8 KB): https://parallelsandbox.com/en/docs/examples/index.md 50. Log SDK (about 9 KB): https://parallelsandbox.com/en/docs/log-sdk/index.md 51. FAQ for engineers (about 25 KB): https://parallelsandbox.com/en/docs/faq/index.md ================================================================================ Section 1 of 51: SKILL.md, the agent guide Source: https://parallelsandbox.com/skill/SKILL.md ================================================================================ # ParallelSandbox: a row of test builds the person uses, talks about and circles > When to use it: ParallelSandbox lines up the test builds your AI is developing in a row: you open one and use it, talk and circle what's wrong, and the AI makes the next version. That's how you iterate fast on your user experience. Use ParallelSandbox when a task needs a real remote computer to build, run and test a repository: docker compose stacks, services with ports, browser end-to-end tests, screenshots and screen recordings, anything that must not run on the user's own computer, and any step a person must do by hand on a live screen (logins, two-factor codes, CAPTCHAs, payments) that you hand over with sandbox_takeover. It is also how you give a running version back: once you have tried a version yourself and it works, sandbox_review puts it in their app as something they open and use as a user (a web page, or a phone or desktop app on the box's screen that they tap and type on) and returns their report to this active conversation. The box is your remote computer; there is no AI inside it. You drive it with the sandbox_* tools and read browser logs from pages you run there with the logs_* tools. Code changes stay in your local checkout; the box only runs copies. Before building new or changed screens, services or stored data, design them with the person first: sandbox_draft (each screen a piece of HTML), sandbox_architecture and sandbox_schema make hand-drawn drafts, clean architecture diagrams and text schemas that show in this conversation and in their app, and bring their circled feedback back. Do not use it for chat or research. ## Install and connect when the person asks Do the setup for the person. Save this full file in the active client's skill directory (Claude Code: `~/.claude/skills/parallelsandbox/SKILL.md`; other clients: use their configured skill directory, or their project instructions if they do not support skills). Inspect the existing MCP configuration first and preserve other servers and settings. Use the local stdio adapter `parallelsandbox-mcp` 0.4.0 or later (Node 20+). Check that Node 20+ and `npx` are available, and install a supported Node runtime if needed. Verify the adapter version before starting it; an older published version is a setup blocker, not a reason to ask the person for an API key. It signs in with OAuth and provides `sandbox_sync` and `sandbox_pull` for local files. Claude Code: `claude mcp add parallelsandbox -- npx -y parallelsandbox-mcp`. Codex: `codex mcp add parallelsandbox -- npx -y parallelsandbox-mcp`, then set `startup_timeout_sec = 60` and `tool_timeout_sec = 3900` under `[mcp_servers.parallelsandbox]` in `~/.codex/config.toml`, preserving an existing longer timeout and all other settings. Cursor and other stdio clients run `npx` with args `["-y", "parallelsandbox-mcp"]`. Start or reconnect the MCP client. The adapter opens the browser to sign in; while authorization is pending, call `parallelsandbox_connect` and show the person its sign-in link. They sign in; the local adapter then completes the connection automatically. Do not ask them to create a key or click an extra approval button. Call `parallelsandbox_connect` again and then `sandbox_list` to verify the account. If the client cannot reload the tool list, reconnect it after sign-in. The adapter shares sign-in across local conversations and refreshes automatically; no API key is needed. Environment connections and service settings are your job over REST when a project needs them (see Environments). If local file transfers are not needed, remote HTTP with OAuth is an alternative: Claude Code uses `claude mcp add --transport http parallelsandbox https://mcp.parallelsandbox.com/mcp` and `/mcp` → Authenticate; Codex uses `codex mcp add parallelsandbox --url https://mcp.parallelsandbox.com/mcp` and `codex mcp login parallelsandbox`. `sandbox_sync` and `sandbox_pull` return an error over plain HTTP because they need the agent's local disk. Existing API keys remain optional for legacy HTTP clients or existing adapter setups. A client with a third-party remote callback still asks the person to authorize that service. ## Using boxes A box is an x86_64 (amd64) Linux machine, Debian 12: 2 vCPU and 8 GB memory per size unit (`size: 0.5` is 1 vCPU and 2 GB, for one Chromium or a small script), its own Docker, git, Node 22, Go, Python, PHP 8.2 with Composer, PowerShell 7, the Azure and GitHub CLIs, gcc, clang and cmake, ripgrep (`rg`), `zip`, `xxd`, `bats`, `bwrap`, `python` (Python 3), an Xvfb virtual display `:99` with Chromium (390x844 portrait by default; 1280x800 with `orientation: "landscape"` at `sandbox_start`; see Seeing the screen), ffmpeg. Working directory `/work`, 40 GB of disk per size unit (80 GB at size 2, 160 GB at size 4, the largest). Commands run as root in `bash -l` with `DISPLAY=:99`, `SBX_BOX_ID` (the box id) and `SBX_SCENE_HOST` (the scene URL's host, key included) already set. Boxes stay isolated from each other except through the links you declare (see Linking boxes). A box has no cloud credentials of its own; it reaches AWS only when its environment names an AWS role (see Environments). `sandbox_stop` archives a box for 30 days (rule 9); after that, or after an interruption, nothing on it remains except what you pushed to a git remote and the account's persistent folders under `/persist` (`persist`, below): keep the project in one of them from the start. `sandbox_start` returns `arch: "amd64"`. Pull or build `linux/amd64` images: an arm64-only image fails with `exec format error`, and emulation is not installed (`docker run --privileged --rm tonistiigi/binfmt --install arm64` adds it, but slowly). arm64 output for somewhere else (Graviton, Lambda on arm64) can still be built without running it: `CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build`, or `docker buildx build --platform linux/arm64` of a Dockerfile whose `RUN` steps run on the build platform (`FROM --platform=$BUILDPLATFORM …` in the stage that compiles); a `RUN` step in an arm64 stage fails without that emulation. The box has glibc 2.36: a Go binary built here with cgo (the default, since a C compiler is installed) fails in an older runtime image with `GLIBC_2.34 not found`, so build with `CGO_ENABLED=0` or inside the image it will run on. Everything belongs to one account: boxes, environments, links, published versions, the registry and the credits. A team shares one account. Each teammate or agent connects with the one line above and signs in once (OAuth); only tools without OAuth need an API key, which the owner makes and revokes over REST with the app's signed-in session (`/v1/keys`; an API key or OAuth token cannot create, list or revoke keys). Every connection sees and operates all boxes of the account (`sandbox_list` lists them, teammates' boxes included), and links and versions work across its connections but never across accounts. Only the account's login opens the app (box cards, Use it, takeovers, `sandbox_say` messages); the account has no members, and the person trying a change needs only the box's URL, which works for anyone who has it. Boxes record the MCP client that started them, not the credential: name boxes `: ` and say what the box is for in `goal`, stop only boxes you started or whose name says they are yours, never stop boxes in bulk by age, and ask before stopping a teammate's box. Ask for more machine with `size` (1, the default, 2 or 4 units of 2 vCPU + 8 GB, 4 being the largest; it costs proportionally more and is fixed for the life of the box): 1 is enough for web front ends and most Node, Go and Python work, 2 or more for Gradle, Java, Android or heavy docker compose stacks, such as several services built as images in one box. Ask for a language with `toolchains` (`java-17`, `java-21`, `android`, `dotnet`, `rust`, `flutter`, `esp32`, `python-3.12`, `python-3.13`): they are baked into the image but off PATH until you pick them, and picking them sets JAVA_HOME, ANDROID_HOME and PATH so plain `java`, `gradle`, `dotnet`, `cargo`, `flutter` and `pio` work. `python-3.12` and `python-3.13` put that Python first as `python`, `python3` and `pip`; without them `python3` is Debian's 3.11, which has Pillow, numpy, boto3 and fonttools. Go, Node, Python 3.11, PHP, PowerShell and browsers are always on: naming them in `toolchains` is ignored, and `toolchainsNote` in the result says so. `flutter` builds web and Android here (it implies `android`; a box's first `flutter build apk` downloads about 3 GB of Gradle dependencies, about 3 minutes); its iOS build runs on the Mac holding a leased iPhone (`psbx-ios flutter`, see Phones). `esp32` is PlatformIO with Arduino for ESP32 and ESP32-S3 ready (ESP-IDF and other chips download on their first build, about 3 minutes); it compiles firmware, but a box has no USB, so flashing a board happens on the person's computer. For a test database, `psbx-testdb up` starts Postgres, `psbx-testdb up --mysql` MySQL 8.0, `psbx-testdb up --redis` Redis 7 (`REDIS_URL`) and `psbx-testdb up --s3` an S3-compatible server (rclone `serve s3`; MinIO no longer publishes images or binaries: `pull access denied for minio/minio`, dl.min.io answers 410), each in an Alpine container (BusyBox inside: `df -Pk`, not `df --output`; see Environments for its options); `psql`, `redis-cli`, `mysql` and ImageMagick (`convert`, `montage`) are installed too. A box cannot run programs that only run on Windows (WinForms, COM broker APIs, Excel VBA, MetaTrader), a virtual machine (no `/dev/kvm`) or GPU work such as local LLM inference; Google Apps Script and TradingView Pine Script can be edited and pushed from a box but run on their own platforms. `/etc/sbx/manifest.json` in the box lists what that image has. A project's own dependencies are not in the image: for Python, `pip install -r requirements.txt` (and the project's other `requirements*.txt`) in the box before running its tests; pip installs system-wide, `break-system-packages` is already set. A one-off Node script anywhere in the box, with no `package.json`, can import `playwright`, `playwright-core` and `ws` (`import { chromium } from 'playwright'`, or `require`) without `npm install`: they, and Playwright's Chromium, Firefox and WebKit, are installed for the whole box. Those browsers belong to Playwright 1.56.0: a project pinned to another `@playwright/test` fails with `Executable doesn't exist at /usr/local/share/playwright/…`, so run `npx playwright install chromium` in the project first (about 20 seconds), or launch with `executablePath: '/usr/bin/chromium'`. For another Node major version, `npx -y node@20 script.js` (or `node@24`) runs it in about 5 seconds. git already has an identity (`ParallelSandbox Box`, in `/etc/gitconfig` and root's `~/.gitconfig`) and `safe.directory *`, so tests that commit need no setup. `nproc` and `free -g` show the box's own CPUs and memory; there is no cgroup quota inside, so `/sys/fs/cgroup/cpu.max` does not exist. `persist` at `sandbox_start` (up to 4 names, `^[a-z0-9][a-z0-9_-]{0,47}$`) attaches the account's persistent folders of those names, each at `/persist/`, restored before the box is ready (empty the first time), for what should carry over to the next box, such as a browser profile that stays signed in (`--user-data-dir=/persist/chrome`). Chromium's `SingletonLock`, `SingletonCookie` and `SingletonSocket` are left out of every save: they name the box that wrote them, and in another box Chromium would refuse the profile as in use by another computer. A folder is saved when the box stops (`sandbox_stop`, the idle rules stopping it while it runs, `DELETE /v1/boxes/{id}`) and before it freezes, but only if a file name, size or modification time in it changed since its last save; an unchanged folder is skipped and nothing is stopped. When it changed, the programs with files open in it (or working in it) get SIGTERM and up to 20 seconds, then SIGKILL, so the copy is what they wrote; after the wake they are not running, so start them again. `POST /v1/boxes/{id}/persist/{name}/save` (REST, your token) saves now and stops nothing: it copies the files as they are, so close the programs writing there first. A box that cannot save, frozen and then stopped by the idle rules or on a machine that is lost, leaves the last saved copy (a freeze always saves first); `restore` attaches the folders again with their latest copy. One box at a time can attach a folder: starting a box with one that a live box, frozen included, has attached fails with 409 naming that box; stop that box, or `DELETE /v1/boxes/{id}/persist/{name}` there, which saves it with its programs stopped, then detaches it and removes it from that box. Also over REST: `POST /v1/boxes/{id}/persist/{name}` attaches one to a running box, `GET /v1/persist` lists them (`{folders: [{name, path, bytes, savedAt, boxId}]}`), `DELETE /v1/persist/{name}` deletes one with its saved copy and `PUT /v1/persist/{name}/content` replaces its content without a box (a gzip-compressed tar whose top level is the folder's contents, for moving existing data in), both refused with 409 while a live box has the folder attached, and `GET /v1/persist/{name}/content` returns `{url, expiresAt}` to download the current copy (valid one hour). A saved copy is at most 4 GiB compressed: a bigger save is refused (413) and the previous copy is kept. `sandbox_start` and `sandbox_status` list the attached folders in `persist`; deleting the account deletes them. `egress: "dedicated"` at `sandbox_start` sends the box's outbound traffic from the account's own fixed public IPv4 address, allocated the first time a box uses it and kept until `DELETE /v1/egress-ip`, the same for every box that uses it, for sites that tie a login to the address it came from; the default, `shared`, is its host's address, shared with other boxes and different between boxes. Several boxes can use it at once, all leaving from the same address. Only TCP leaves a `dedicated` box: outbound UDP is blocked (DNS still works; browsers fall back from QUIC to TCP; WebRTC calls need a `shared` box). It follows the box across freeze and thaw, onto another machine too; until it is connected again there, the box's outbound connections are held, never sent from a shared address (`sandbox_status` shows `egress: {mode, publicIp, pending}`; `sandbox_start` returns `egress: {mode: "dedicated", publicIp}`). Over REST, `GET /v1/egress-ip` returns `{egressIp: {publicIp, createdAt}}` (`null` when there is none), `POST /v1/egress-ip` allocates one if the account has none, `POST /v1/egress-ip/proxy` (body `{}` or `{"rotate": true}`) returns `{publicIp, proxyUrl}`: an authenticated HTTPS proxy URL (CONNECT and plain http, TCP only) that sends the account's own programs, servers or CI out from the same fixed IP (`curl -x "$PROXY_URL" https://api.ipify.org`); the URL carries a credential, keep it secret, and `rotate` replaces it (the old one stops working within seconds). `DELETE /v1/egress-ip` gives the IP back and voids the proxy credential (409 while a `dedicated` box of the account is alive; a later allocation is a different address), and `PUT /v1/boxes/{id}/egress` with `{"mode": "dedicated"}` or `{"mode": "shared"}` switches a running box. An IP that neither a box nor the proxy has used for 30 days goes back to AWS. Rules: 1. Edit code locally. Files in the box are copies: put them in with `git clone` (committed work) or `sandbox_sync` (uncommitted), run and test there, bring results back with `sandbox_pull` (adapter) or `sandbox_get`. Never edit files in the box and forget to bring the change back. 2. One box per task. Reuse it for the whole task, and finish it before you stop working on it: `sandbox_review` when the person should try the result, `sandbox_stop` when there is nothing left for them to see. A box left running without either shows in the person's app as "AI stopped" and waits for them to decide what happens to it. Do not stop a box while a person is still trying the version on its URLs (after `sandbox_review`, or with `webUrl`): stopping ends their session and the URLs for good. Ask them in this conversation, the way your client asks, or leave the box: it freezes on its own after 10 idle minutes and a frozen box bills nothing (it is archived 24 hours after its last use; the next call or page load restores it). Leave `idleTimeoutMin` unset on a box you hand over: past that limit the box is archived the first time it freezes, and their next page load waits a minute or two for the restore. There is no limit on how many boxes an account has at once. The credits belong to the account and are shared by every key and agent on it; stop the boxes you are done with rather than leaving them frozen, so they do not pile up in `sandbox_list` and the person's app. `sandbox_list` shows every box of the account, so you can find forgotten ones, or pick up a box another conversation left by its `name` or `goal` (see Picking up a box another conversation left). 3. Usage is billed in credits by the minute, with no time limit: 1,000 credits run a size-1 box for about 29 hours. A bigger `size` costs proportionally more, a frozen box bills nothing, and outbound traffic is metered too. `idleTimeoutMin` replaces the idle limits of rule 6: it archives the box after that many minutes without use (rule 6), frozen or not, and a person's use of the box's URLs does not reset it (their requests keep the box up for at most 2 hours after the last use; then it freezes and, past its limit, is archived right away; a page load that wakes it counts as use and restarts the count); something that keeps the box awake (a background command, for up to 1 hour after the last use; a takeover; a link from another box) holds that off until it ends. Rates: a running size-1 box costs about 29 credits an hour, size 0.5 half that; an Android emulator 55 an hour; outbound traffic (every byte the box sends, including through environment connections and links and the pages it serves through its URLs) 114 per GB; files kept by `sandbox_get` (each call stores another copy) and the build cache 25 per GB per month, kept until the account is deleted (the build cache at most 20 GB), and the box pictures the app shows the same (a new one for each freeze with something on the screen and each `sandbox_review`; the replaced ones stay stored); screenshots and recordings the same, screenshots deleted after 30 days and recordings after 7 (the mp4 of a recording stopped for you, once fetched with `sandbox_get`, is a `sandbox_get` file); the saved copies of persistent folders the same (one per folder, until it is deleted), and each save is outbound traffic of the box; an archived box's kept disk the same (compressed, about 2 GB for a typical box); a box with `egress: "dedicated"` 5 more an hour while it runs (the price of one IPv4 address, billed with its running minutes, not while frozen); published images in the registry are not metered. 4. When the account runs out of credits, boxes are frozen (`/work` kept, not billed); a box a person has taken over keeps running and billing. `sandbox_start`, and any call that would wake a frozen box, fail with `no credits left` (HTTP 402) and say until when the boxes are kept: 24 hours after they froze, boxes are archived, and restoring one needs credits, which the person adds in the ParallelSandbox app. Tell the person right away; once credits are added, the next call wakes the box where it left off. 5. If a tool returns `interrupted`, the machine under the box is gone (reclaimed by the cloud, or its host failed). Start a new box and redo the steps from the beginning; do not retry on the old id. (A machine the cloud reclaims with notice has its boxes frozen and saved first; the next call thaws them on another host.) When the error says `Its /work was saved at …`, `sandbox_pull` or `sandbox_get` with path `/work` on the old id still returns that copy as `work.tar.gz` (without `node_modules`, caches and files over 64 MiB; later changes are lost). 6. A box is `frozen` after 10 minutes without activity: its memory is snapshotted, `/work` is kept and it stops billing (first, each persistent folder that changed is saved, stopping the programs with files open in it: start those again after the wake). Activity is use, or a request through the box's URLs for up to 2 hours after the last use, so a person using `webUrl` keeps the box awake for that long; the app's live view of the screen and its live thumbnails do not (they are streamed, not stored). Use is a tool call that acts on the box, a person's takeover, a link connection from another box, a connection through `/v1/boxes/{id}/ports/{port}/` (REST: reach a program on `127.0.0.1:{port}` in the box from outside, HTTP or WebSocket, such as Chromium's DevTools on `--remote-debugging-port=9222`), or a wake; the last use is `lastUsedAt` in `sandbox_status`. A call that acts on the box counts from the moment it starts, so the box does not freeze under a `sandbox_sync` or `sandbox_get` that is still running, and any call that arrives while the box is being frozen waits those few seconds, then thaws it and runs. The calls that act on the box are `sandbox_start`, `sandbox_exec`, `sandbox_sync`, `sandbox_get` (so `sandbox_pull` too), `sandbox_shot` (except with `urls`), `sandbox_scene`, `sandbox_wire`, and `sandbox_secrets` and `sandbox_build` for a box; `sandbox_status`, `sandbox_list`, `sandbox_media`, `sandbox_say` and `sandbox_feedback` are not use, nor are `sandbox_review`, `sandbox_procs`, `sandbox_device`, `sandbox_takeover` and `sandbox_shot` with `urls`, though these wake a frozen box first (except `sandbox_device` `list`), and the wake counts. `sandbox_draft`, `sandbox_architecture` and `sandbox_schema` count as use but never wake a frozen box: they draw on the server. Past that window, someone still using a page may see the box freeze mid-session; their next page load wakes it. It 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 (how long it has recorded does not matter): then, once nothing else keeps it awake, the recording is stopped without uploading (the mp4 stays at `/work/.sbx/rec/` and is not shown in the app; fetch it with `sandbox_get` after the box wakes, before the box is stopped). A command started with `background: true` (a dev server, a long build) keeps it awake only until 1 hour after the last use; then the box freezes anyway and the process carries on when the next call thaws it. `sandbox_status` gives `freeze`: `at`, when it will freeze if nothing changes, and `blockedBy[]`, what keeps it awake now (`background`, `url`, `recording`, `person` with the `until` they count to; `takeover`, `foreground`, `link`, `phone` until they end). While the person has the box open in the app (its page, its review, Use it, its screen), the app reports in every minute and the box and its phones do not freeze until 10 minutes after they leave (`person`); that is not a use and does not move `lastUsedAt`. A `sandbox_review` waiting for the person keeps nothing awake: the box and its phones freeze after 10 idle minutes and are archived by the same rules as any idle box; the person opening the review (in the app or through its link) wakes a frozen box and its phones by themselves, with nothing needed from you; archiving the box (or `sandbox_stop`) closes a review still waiting for the person: it leaves their list and its link no longer opens. A person trying a box needs nothing from you: when it has frozen, loading one of its pages in a browser wakes it (they see "Waking this box…" and the page reloads itself into the app within about 10 seconds; the wake counts as use; out of credits, it says the box is paused). `fetch`/XHR, assets, WebSockets and POSTs to a frozen box get 503 `box is frozen` and wake nothing, so an open tab that polls neither wakes the box nor keeps it awake past the 2 hours. Its URLs stay the same across freeze and thaw. An attached phone freezes only when the box is about to, just before it (whatever keeps the box awake keeps its phones running), and comes back with the box, with the same `deviceId` and `serial`: frozen, it holds no device slot and does not bill; 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). Besides your next call and a page load, a person opening the box in the app wakes it (the app shows what it is waiting for until the box and its phones are back), and anything with the API key with `POST /v1/boxes/{id}/wake`; a wake counts as use. After a thaw, boxd closes the box's connections to environment addresses and links that were open before the freeze, so programs have to reconnect. Any call naming the box except `sandbox_status`, `sandbox_say`, `sandbox_feedback`, `sandbox_stop`, `sandbox_device` with `list`, and the design tools (`sandbox_draft`, `sandbox_architecture`, `sandbox_schema`) thaws it first, which adds a couple of seconds (about a minute with phones attached, which come back first); nothing is lost. The first launch of a large program after a thaw (Electron, a browser) is slower, often several times, because its files left the memory cache: launch it once before you time or record a cold start. `sandbox_stop` works on a frozen box too. Unless `idleTimeoutMin` is set, a frozen box is archived 24 hours after its last use (after it was frozen, if that is later). `sandbox_status` and `sandbox_list` give `stopsAt`, when the idle rules will archive the box unless something uses it first; from 30 minutes before that, every tool result for a box this conversation used (or the call names) ends with a warning saying when, and that a call acting on it pushes it back (`sandbox_status` and `sandbox_list` do not). Archived (status `archived`, its card kept in the app), only the box's disk is kept, until 30 days after its last use (`restorableUntil`; `sandbox_status.archived` has `at`, `until`, `storedBytes`). Any call that would wake a frozen box, a page load ("Restoring this box…"), the app or the link of a review the person already sent feedback on restores the same box, with its id, URLs and scene key, in a minute or two (`sandbox_start { "restore": "", "goal": "" }` too): files, packages and Docker images are there, memory is not; background commands start again with new `bgId`s; attached phones are not kept. A failed restore leaves it archived and the next call tries again. `sandbox_stop` archives a box the same way (rule 9), and stopping an archived box deletes its archived copy for good; persistent folders are kept either way. 7. Secrets enter the box as environment variables only when named in `sandbox_start.secrets` or injected later with `sandbox_secrets { "id": "", "names": [...] }`. Never paste secret values into commands; use `$NAME`. Never put your ParallelSandbox API key or token in a box. 8. Use `sceneUrl`, `webUrl` and `services[].url` exactly as `sandbox_start` or `sandbox_status` returns them; they carry a random key, so they cannot be built from the box id; take each one from the result rather than deriving it from another. There is no login in front of them: the key protects them, and anyone with one of these URLs can use that service and whatever it reaches (the person's dev, when the box has an environment). An account can also limit box URLs to an IP allowlist (`PUT /v1/box-access`, see [Other facts](https://parallelsandbox.com/en/docs/tools/other-facts/)); when `sandbox_start` or `sandbox_status` returns `boxUrlAccess`, a request from any other IP gets 403, including the box calling its own URL, so test from inside the box with `localhost` or the service name, and tell the person whose IP is not on the list why the page does not open. Share them only with people who should have that; a chat app that builds a preview of a pasted URL fetches the page too, which counts as use and can wake the box. They stop working when the box stops. Each box's URLs have a random host of their own, so for sign-in (SSO, OAuth) on a box, run its copy with the team's local login (a seeded test user, a dev-only auth mode) or add the box's exact URL to a dev client's allowed redirect URIs while it runs; never register a wildcard such as `https://*.box.parallelsandbox.com/*`, because every account's boxes share that domain. ## Rules for working with the person The server's tool descriptions only say what each tool does; these are the rules for using them with a person. - Feedback from the person (`fromHuman`, `sandbox_report`) is yours to finish in this conversation: do every part of it here, including parts outside this box's task. Never propose, offer or start another session, task card or follow-up for any part of it, and never set a part aside for later. The person sends feedback from the app, usually on a phone away from the computer, and cannot start or follow another session. Tool results that carry feedback repeat this as `feedbackHandling`. - Feedback on a version you handed over with `sandbox_review` comes from someone who just used it, and asks for the next version of that build: change what they said, try it in the box and hand it over again with `sandbox_review`. Answer it with that version, not with a draft, an architecture diagram, a schema or a question asking them to approve the change first: they are iterating in the box, and any of those sends them a step back. Draw a draft only when that feedback asks for one ("redo the draft", 草稿要重出). - Hand over with `sandbox_review` only a version you have tried yourself: go through the flow, fix what fails and leave the product on the screen the person starts testing on, not its home page: with `open: "web"`, pass `path` for that page, signed in, with the data the test needs already there and no onboarding, consent or other dialog in the way. `open` is not a preference: anything that runs in a browser, phone-size or behind sign-in too, goes as `open: "web"` with the port its front end is served on, for the person's own browser on their own device. Serve a production build there, never a dev server, run it on the tested backend, open that URL with the path, sign in there (dev auto-login, or a test account named in `what`) and check it lands on that screen. `open: "box"` is only for a native app on `DISPLAY=:99` or a `sandbox_device` phone; whenever web is possible, never hand over the box's screen because it is easier. - A screenshot you show the person goes into your reply as a clickable Screenshot link to the exact `url` the result returned, even when you also embed the image: some chat clients show the inline image only to the model. - `sandbox_say` is a status line: when you need the person to decide something, ask them in this conversation, the way your client asks. - Send `sandbox_feedback` only when the person has authorized it and your client's policy permits it, with only the authorized task details: no secrets, unrelated personal data or conversation transcripts. - If your client lists the `sandbox_*` tools as deferred, load their schemas first (in Claude Code, ToolSearch): calling a deferred tool directly fails with InputValidationError. ## Design before you build For anything new or changed, design it with the person before you build it, in this order: `sandbox_draft` (screens) → `sandbox_architecture` (services) → `sandbox_schema` (stored data) → build in the box → `sandbox_review`. Skip a step only when the task does not touch it (a backend-only change has no draft; a change that stores nothing new has no schema). Use these tools whenever the person asks for a draft, sketch, wireframe or mockup (草稿, ラフ), an architecture or flow diagram (架構圖, 構成図) or a schema, and before you build a new or changed screen, service or table. Feedback on a version already handed over with `sandbox_review` goes straight to the next version in the box (see Rules for working with the person). A draft's screens are HTML written in the `sandbox_draft` call itself; never make separate web pages, SVG, Mermaid or image files, or a throwaway page in the box, for this instead: these tools make it, keep every version and give the person the tools to answer. - Everything goes in the call's arguments (a draft's screens as HTML in `html`). `sandbox_draft` comes back as hand-drawn phone screens and `sandbox_architecture` as a plain, clean diagram, both PNGs drawn by the server; `sandbox_schema` comes back as text, not a picture. `new: true` (on a draft, `class="new"` in the screen's HTML) marks what is new or different compared with the product (or the services, or what is stored) as it is now: red on a draft, blue on an architecture diagram, `[new]` in the schema; the rest stays as it is. It compares with how things are now, not with the previous version: what changed since the previous version goes in `note`. Draw only what the person needs to judge, and write every label in the language the person reads: what you write is shown as given, never translated. The words the drawing adds itself (the legend, the UNCHANGED stamp) are in the same language as what you write on the picture (Traditional Chinese, English or Japanese), and in the account's language only when nothing you wrote shows a language (Traditional Chinese until the person picks one in the app); `note` goes under the title as given, with nothing in front of it. The schema text's fixed words, `warnings` and errors are always English. - They need no box: a design belongs to the person's account and this conversation, not to a box, so you can draw, revise and get feedback without `sandbox_start`, and a design stays when a box stops or its pictures are deleted. `id` is optional: pass the box of this piece of work to show the design on that box's page too; leave it out and the design stands on its own page in their app. These calls run on the server, never in a box: they do not wake a frozen box, but with `id` a successful call counts as use of that box (it moves `lastUsedAt`) and makes this conversation its holder. - `topic` (at most 80 characters) names the design and stays the same for every version: the same kind and `topic` in the account is the next version, from any box or none. The result carries the pictures inline as smaller JPEGs, while the person's app shows them full size (look at them; the schema comes as a text block instead), `designId` (`dsg_…`, the design), `reviewId` (`dsn_…`, this version), `version`, `appUrl` (the design's page in their app, `/design/`; it opens without signing in, so it can be passed to anyone), `boxId` (only when you passed `id`) and `warnings` (content cut off a screen, an icon that does not exist, a diagram shrunk because it is too wide, a `ref` to a table not in the schema, characters the font lacks: fix them and call again). Then tell the person in one line what to look at. - Each result carries `tellThePerson`: the design's link and how to give feedback on it. Put it in your reply in the person's language with the link intact; the page opens without signing in, and sending feedback needs the account you are connected to. - In the app the person circles, talks and writes on a version and sends it (a draft can be read one phone at a time; the schema is a table of text with **Report here** under each table). That report comes back to the conversation that drew that version, like review feedback, naming the design and version (`Feedback on draft "Sign-in page" v1: … call sandbox_draft again with the same topic for the next version.`): it wakes a conversation set up for app feedback, and otherwise arrives as `fromHuman` on your next call to a design tool or to any tool on a box, or through the app's **Copy message for AI**. Read a report on a design with `sandbox_report { "reportId": "" }`, with no `id` (a box `id` given with it does no harm). Waking this conversation for a design drawn without `id` needs the stdio adapter `parallelsandbox-mcp` 0.6.0 or later (also for `parallelsandbox-agent`); 0.5.4 to 0.5.x wake it only for a design drawn with a box's `id`, and older ones register only `sandbox_review`. Claude Code and Gemini CLI hooks installed before 0.5.4 miss the design tools: 0.5.4 treats them as not installed and puts the install command (such as `npx -y parallelsandbox-mcp install claude-code`) in the server instructions and the design tools' results; ask the person before running it, since it changes their user settings. Only versions drawn after that wake the conversation; for a version drawn before, do not call `sandbox_review` with its `dsn_` id (0.5.4's install note suggests it; use 0.5.5, whose note does not), but read its report with `sandbox_report` once the person pastes **Copy message for AI**. Read the circled pictures, the transcript and the text written on the picture (`notes[].labels`). Change what they asked and call the same tool with the same `topic`, the whole spec again and a one-sentence `note` on what changed; that is the next version (v2, v3…). - A design is either not final or final. One that is not final stays under Ready for you in the person's app, next to the boxes handed over, until they report on its latest version or three days pass without a new version (your next version puts it back); a final one leaves it and stays reachable by its link and on its box's page. When the person agrees, call `sandbox_design_final { "designId": "" }` (`"final": false` undoes it); the person can also do it with one tap on the design's page. Going on to the next step does it by itself: drawing a later kind marks the earlier ones final, and `sandbox_review` marks all of them final and shows this conversation's designs on that box's page (same conversation or same box). A new version puts the design back to not final. - What the drawing does not accept fails with its path in your call's arguments, such as `boards[0].phones[0].html: ``` ## Initialise ```js import { init } from '@parallelsandbox/log'; const log = init({ writeKey: 'psw_...', // the project's write key; it names the project release: 'a1b2c3d', // build id; must match the release you upload source maps under }); ``` Call it once, as early as possible. `init` throws if `writeKey` does not start with `psw_`; calling it again replaces the previous logger. Options: | Option | Default | Meaning | |---|---|---| | `writeKey` | required | the project's write key | | `endpoint` | `https://log.parallelsandbox.com` | log service | | `release` | empty | build id; stacks are resolved only when it matches uploaded source maps | | `boxId` | from the page host | box id; read from the host of a box's URL (`-.box.parallelsandbox.com` or `--.box.parallelsandbox.com`), empty elsewhere | | `boxDomain` | `box.parallelsandbox.com` | domain of box hosts | | `captureConsole` | `true` | hook `console.debug`, `log`, `info`, `warn` and `error` | | `captureErrors` | `true` | capture `window` errors and unhandled promise rejections | | `levels` | `['info', 'warn', 'error']` | levels to send; add `'debug'` to send `console.debug` | | `flushIntervalMs` | `2000` | time between sends | | `batchSize` | `50` | entries per request, at most 200 | | `maxBuffer` | `1000` | entries kept in memory; newer ones are dropped beyond it | | `platform` | `'web'` | label sent with every batch | After `init`: - `console.log` is sent as `info`, the other console methods as their own level; an uncaught error becomes `[uncaught] at ::` with its stack, and an unhandled rejection `[unhandledrejection] `. - Entries are batched and sent every `flushIntervalMs`, and what is left is sent when the page is hidden or unloaded. - Every batch carries `release`, `platform`, the user agent, the page's path and query (`route`) and the box id. When the page is served through one of the box's URLs, the box id comes from its host and the key never leaves the page: every `-` in the batch becomes ``, and the log service does the same on arrival and takes the box id from the page's origin. A page opened at `localhost` inside the box has no box id unless you pass `boxId`. ## Manual calls `init` returns the logger: ```js log.info('checkout started', { cart: 3 }); log.warn('slow response', { ms: 2400 }); try { riskyThing(); } catch (err) { log.error(err, { step: 'riskyThing' }); // an Error keeps its stack } await log.flush(); // before navigating away in a test ``` `debug`, `info` and `warn` take a message and an optional `extra` object; `error` takes an `Error` or any value and an optional `extra`. `extra` is any JSON-serialisable object and is searchable with `logs_search`. The logger also has `setBox(id)`, `setRelease(release)`, `boxId` and `uninstall()`, which restores `console` and the window listeners. ## Source maps Minified stacks are useless to an agent. Upload the source maps of every build under the same `release` you pass to `init`, and `logs_errors` returns stacks resolved to original files and lines. ```bash curl -fsS -X POST https://log.parallelsandbox.com/v1/projects/prj_.../sourcemaps \ -H "Authorization: Bearer $PSBX_TOKEN" \ -F "release=a1b2c3d" \ -F "assets/app-ALQGRFWG.js.map=@dist/assets/app-ALQGRFWG.js.map;type=application/json" \ -F "assets/log-init-K6FPZHJN.js.map=@dist/assets/log-init-K6FPZHJN.js.map;type=application/json" ``` Each map is one file part, and the part's name is the path the map is served at, relative to the page origin (the script in the stack plus `.map`); one request can carry every map of a release. Uploading uses the account's token, not the write key. `GET /v1/projects/{id}/sourcemaps?release=` lists what was uploaded. [example-web-with-logs](https://github.com/parallel-sandbox/example-web-with-logs) has a script that does this for a whole `dist/` directory. A stack is resolved once, when the error arrives, for error-level entries that have a stack and a `release`. Upload the maps before the page runs; errors that arrived earlier keep their minified stack. ## Query from the agent ```json logs_errors { "project": "prj_...", "since": "30m", "boxId": "" } logs_search { "project": "prj_...", "since": "1h", "query": "checkout" } logs_tail { "project": "prj_...", "boxId": "" } ``` Rows have `ts`, `ingestedAt`, `level`, `box`, `release`, `platform`, `route`, `msg`, `stack`, `stackResolved`, `extra` and `stream`. `logs_search` and `logs_errors` return them oldest first with a `nextCursor`; `logs_tail` is a long poll that returns when new rows arrive or after `waitSec`, with a `cursor` for the next call. Parameters are in the [tool reference](https://parallelsandbox.com/en/docs/tools/#logs). ## Cost Log ingestion and retention are metered like everything else: | Usage | Credits | |---|---| | Written | 760 per GB | | Stored | 33 per GB per month | A page that reports a few hundred errors a day costs well under one credit a month. ================================================================================ Section 51 of 51: FAQ for engineers Source: https://parallelsandbox.com/en/docs/faq/ Markdown: https://parallelsandbox.com/en/docs/faq/index.md ================================================================================ # FAQ for engineers ParallelSandbox lines up the test builds your AI is developing in a row: you open one and use it, talk and circle what's wrong, and the AI makes the next version. That's how you iterate fast on your user experience. Before you hand work to an AI, find out how ParallelSandbox works, where your code and data go, and what stays behind. This page is for people; the AI reads [SKILL.md](https://parallelsandbox.com/en/skill/) and the [tool reference](https://parallelsandbox.com/en/docs/tools/). Your AI operates ParallelSandbox: you ask it in one sentence to start a box, set it up or delete it, and it calls the matching tool or REST endpoint. The `sandbox_*` tools and `/v1/...` endpoints below are there so you know what it actually does. ## What can ParallelSandbox do for me? - **A row of test builds**: your AI works on several versions at once. Each one is a real, running test build of your app (web, mobile or desktop), waiting in a row for you. - **Talk and circle what's wrong**: open any build and use it. See something wrong? Say it out loud and circle it on the screen. No forms, no screenshots to paste. - **Your AI makes the next version**: your words and circles go back to the same AI conversation that built it. It fixes what you pointed at and hands you the next version. Here is how that works behind the scenes: - Your AI (Claude Code, Codex, Cursor, Gemini CLI, or any client that speaks MCP) opens a **box** for each piece of work: a small remote Linux virtual machine with Docker, git, Node, Go, Chromium and a virtual display. - In the box the AI runs the services you changed, tests them in a real browser or an Android or iPhone simulator, takes screenshots and recordings, and hands the result to you to try. How you open it and send feedback that goes back to the same conversation: [How it works](https://parallelsandbox.com/en/docs/how-it-works/). - One box per piece of work, isolated from each other. Several can run at once without fighting over ports, databases or your own machine. - There is no AI inside the box. Your own AI does the work through MCP tools; ParallelSandbox itself never sends your code to an AI model. ### What is a box like? An x86_64 Linux machine (Debian 12). Each size unit is 2 vCPU, 8 GB of memory and 40 GB of disk, and a box is 1, 2 or 4 units (4 is the largest). Docker, git, Node, Go, Python, PHP, Chromium and a virtual display are built in; Java, Android, .NET, Rust and Flutter toolchains are added when needed. ## Where do I start? 1. See the real flow first: the [example repos](https://parallelsandbox.com/en/docs/examples/) are two public repos that run locally with `docker compose up`, and the page lists every step of running them in a box. 2. Connect: paste the line from the [quick start](https://parallelsandbox.com/en/docs/quickstart/) into your AI. It installs the skill and signs in to your account with OAuth; you do not hand it any key. 3. Make the first task small, for example "run this repo in a box, test the home page in a browser, and hand it to me for review". ## What does the architecture look like? ![ParallelSandbox architecture: your computer, ParallelSandbox (AWS), your network](https://parallelsandbox.com/img/faq-architecture-en.svg) | Part | Where | What it does | |---|---|---| | Your AI client | Your computer | Calls the MCP tools: start a box, run commands, take screenshots, hand over | | Local adapter `parallelsandbox-mcp` (optional) | Your computer | Needed only to send a local folder into a box (`sandbox_sync`) or pull files back to your machine (`sandbox_pull`) | | Control plane | AWS | MCP and REST API, accounts, secrets, metering | | Hosts and boxes | AWS | Each box is its own small virtual machine with its own disk and network, isolated from the others | | URL routing | AWS | Serves URLs like `https://-.box.parallelsandbox.com` from the web service in the box | | Storage and registry | AWS | Screenshots and recordings, fetched files, the build cache, the images you publish | | Android emulators | AWS | Android devices rented with `sandbox_device` | | iPhone simulators | Dedicated Mac hosts | iPhone devices rented with `sandbox_device` | | Connector (optional) | Your network | A container you run; it dials out to ParallelSandbox so boxes can reach the dev databases and services you list | ## How does one piece of work run, start to finish? 1. **Start**: the AI calls `sandbox_start` with what the box is for, the services it runs and the ports they listen on, the secrets to bring and the environment to plug into. The box starts from a clean snapshot that holds no account data. 2. **Design first** (when the work adds or changes screens, services or stored data): the AI sends `sandbox_draft` (phone screens, each a piece of HTML the AI writes), `sandbox_architecture` (services) and `sandbox_schema` (tables), and ParallelSandbox shows them on each design's page in the app (and on the box's page when the AI names the box): the draft as hand-drawn phone screens with what is new in red, the architecture as a clean diagram with what is new in blue, and the schema as text, every field with a short note. How you give feedback on them: [How it works](https://parallelsandbox.com/en/docs/how-it-works/#designs-before-building). This happens on the server, not in the box, and needs no box: the AI can design before starting one, and designs stay after a box stops. 3. **Code in**: the AI runs `git clone` in the box, or sends your local working tree into the box through the ParallelSandbox API with `sandbox_sync`. 4. **Run and test**: the AI builds, starts services and runs tests with `sandbox_exec`, and takes screenshots and recordings with `sandbox_shot`. 5. **Hand over**: the AI hands the box to you with `sandbox_review`: a link in its reply and a card under "Ready for you" in the app. What you do then: [How it works](https://parallelsandbox.com/en/docs/how-it-works/). 6. **Stop**: once you are done, the AI calls `sandbox_stop` (or you tap "Shut down" in the app) and the box is archived: its disk is kept 30 days, and opening it brings the same box back until then. The result lists what in `/work` is neither pushed to git nor kept in a persistent folder; push or pull back anything you want to keep longer. ### How long does a box stay? - **10 minutes** without activity → frozen: no credits are charged, memory and `/work` are kept, and the next call wakes it in a few seconds. - **24 hours** after its last use → archived: only its disk is kept, and opening it again brings back the same box in a minute or two, without what was in memory. To keep it longer before that, tell your AI "keep this box for 3 days"; it sets that when it starts the box, up to **7 days**. - **`sandbox_stop`** (or "Shut down" in the app) → archived at once, the same way, its disk kept 30 days from then; stopping an archived box deletes it right away. - A review waiting for you under "Ready for you" is closed when its box is archived or stopped: open it within 24 hours of the box's last use (opening it counts as use and starts the 24 hours again). - **30 days** after its last use → the archived disk is deleted, and the box with it. - Once deleted, the box's URLs stop working and `/work` does not come back; a new box has new URLs. ## My frontend and backend live in several repos. How does a box run them? ### Can one box run several repos? Yes. A box is a Linux machine: the AI can clone several repos under `/work` and run them together with `docker compose` or their own commands. Services find each other by name (for example `api:3000`), just like compose on your machine. ### Or one box per service? That works too. With services in different boxes, a [link](https://parallelsandbox.com/en/docs/tools/links-to-other-boxes/) points a name in box B at a port in box A: the programs in B call the host name they always use, with no config change. It fits two people (or two AI conversations) each changing one service and testing them together. ### Can boxes opened by two different people be linked? Yes, as long as they are in the same account: a team shares one ParallelSandbox account (see [team setup](https://parallelsandbox.com/en/docs/team-setup/#one-account-for-the-team)), which holds the boxes, environments, secrets, published versions and credits. Links only connect boxes of the same account. An account has no members or roles for now. ### What about the services I did not change? It depends on where they run: | Situation | What to do | |---|---| | They run in your dev or staging (AWS, Kubernetes, an office) | Create an [environment](https://parallelsandbox.com/en/docs/environments/): run the connector in your network and list the `host:port` addresses boxes may reach. A box then reaches the copy on your dev by its usual host name: the database, Redis and internal services alike. | | It is an HTTP service with a URL | Give `externalBaseUrl` when the box starts; HTTP to that service's name in the box goes to that URL. | | Someone already built it and published a version | Declare that version in `services` when the box starts; the box pulls the image and runs it without rebuilding ([run a published version](https://parallelsandbox.com/en/docs/tools/run-a-published-version/)). | Your AI sets environments up over REST; there is no screen for it. All you do is run the connector in your own network (one `docker run` line). New addresses or settings on an environment reach only boxes started afterwards. ### And services I do not own (another team, a third party)? If your network reaches it, a box can too: run a connector where it is reachable and list its `host:port`. External services that only accept known IPs are listed the same way, and the traffic leaves from your own network with your public IP. A service you cannot reach yourself, a box cannot reach either. ### How do I make my own servers leave from a fixed IP too? When an outside service only lets allowlisted IPs in (an exchange's API, for example) and you do not want the traffic to go through your own network, use the account's fixed IP: - Boxes: start them with `egress: "dedicated"`; however many of the account's boxes do so at once, they all leave from the same fixed IP ([`sandbox_start`](https://parallelsandbox.com/en/docs/tools/sandbox-start/)). Such a box only gets out over TCP, and its outbound UDP is blocked; for anything that needs UDP, such as WebRTC calls, use a regular box. - Your own servers, CI and programs on another cloud: have your AI call `POST /v1/egress-ip/proxy`, which returns `publicIp` and `proxyUrl`. Set `proxyUrl` as that program's HTTPS proxy (the `HTTPS_PROXY` environment variable, for example), and its outbound connections leave from the same `publicIp`; when `curl -x "$PROXY_URL" https://api.ipify.org` prints `publicIp`, it works ([REST](https://parallelsandbox.com/en/docs/tools/rest/#using-the-fixed-ip-from-your-own-programs)). - The egress credential in `proxyUrl` is the right to use this IP: keep it as a secret, never in front-end code or a public repo; if it leaks, replace it with `{"rotate": true}`. - Cost: 5 credits an hour for each running `dedicated` box; using it through `proxyUrl` is not billed by the minute ([Credits](https://parallelsandbox.com/en/docs/tools/credits/)). When the account has had no `dedicated` box and no traffic through its `proxyUrl` for more than 30 days, the fixed IP goes back to AWS, and the next one is a different address. ### Can a service on my dev call the copy I changed in the box? Not over your private network: the connector only lets boxes connect out, and nothing on your network can connect into a box through it; a service on your dev that calls an internal host name keeps calling the copy on your dev. The box's public URL (`https://-.box.parallelsandbox.com`), on the other hand, is reachable by anything on the internet, so callbacks such as webhooks can point at it. To test "caller → changed service", the simplest way is to put the caller in the same box too, or in another box linked to it. ## My code and data ### Will the box always have my whole repo? Not necessarily. It depends on how the AI puts it there: - **`git clone`**: the box fetches it itself. A private repo needs a token stored as a secret first (for example `GITHUB_TOKEN`), which the AI names when it starts the box. - **`sandbox_sync`**: sent from your computer. Only files git tracks, plus new files `.gitignore` does not exclude; or only the tree of one commit. Ignored files (`.env` and `node_modules` in most projects) are not sent by default. Keep files you do not want sent in `.gitignore`, or ask the AI to send only a commit. ### Where do my code and data go? - Boxes, the control plane, storage, the registry and the log service all run on AWS. - When you use an iPhone simulator, the app you built is sent to a dedicated Mac host and installed and run there. - A box connects wherever your programs connect: npm, GitHub, your dev, third-party APIs. - Traffic from a box to your dev goes through ParallelSandbox to your connector; the connector talks to ParallelSandbox over TLS, and your services' own TLS (your database's SSL, for example) is not unwrapped between the box and your service. - ParallelSandbox itself never gives your code to an AI model. What your AI sees (command output, screenshots) reaches your AI provider through your AI client, just as it does when you use it locally. - Voice input in the app is turned into text as you speak; neither the audio nor the text is stored. The full details are in the [privacy policy](https://parallelsandbox.com/en/privacy/). ### When a box stops, is its disk really wiped? Yes: - When a box stops or is archived, its virtual machine is shut down and its disk file on the host is deleted right away. Host disks are encrypted, and the whole disk is deleted when the host goes away. - An archived box keeps a compressed copy of the parts of its disk that differ from the box image, in encrypted storage on AWS. It is deleted 30 days after the box's last use, when the box is restored, or at once when the archived box is stopped. - While a box is frozen, its memory and `/work` may be kept in encrypted storage; they are deleted when the box resumes or stops. There is also a 10-day upper limit as a safety net, which normal use never reaches. - To be precise: this is "delete the files on encrypted disks", not overwriting every block. ### What is kept, for how long, and can it be deleted? To delete something, tell your AI (for example "delete this box's screenshots" or "clear the build cache"); it calls the REST endpoint in the table. | Data | Where | Kept | How to delete | |---|---|---|---| | The box's `/work` (code, containers, databases) | The box's disk on its host; once archived, a compressed copy in storage on AWS | Archived when the box is stopped, or 24 hours after its last use (up to 7 days if set); the archived disk is kept until 30 days after its last use | `sandbox_stop` or "Shut down" in the app archives it; doing it again on the archived box deletes it | | Files from `sandbox_get` and `sandbox_pull` | Storage on AWS | About 1 day | Deleted automatically | | Screenshots and recordings | Storage on AWS | Screenshots 30 days, recordings 7 days | `DELETE /v1/boxes/{id}/media`, one box at a time | | Frozen-box posters, review card images | Storage on AWS | Only the latest one per box | Same as above | | Drafts, architecture diagrams and schemas (every version) | Pictures of drafts and architecture diagrams in storage on AWS; what the AI sent, a schema's tables included, in the control plane database | Until the account is deleted; stopping a box or deleting its media leaves them | Only by deleting the account | | Build cache (`sandbox_build`) | Storage on AWS | At most 20 GB per account, oldest removed first | `DELETE /v1/build-cache`, the whole account at once | | Persistent folders (`/persist/`) | Storage on AWS | The latest saved copy of each, until you delete it | `DELETE /v1/persist/{name}` | | Images published as versions | Your account's image registry | No limit | `DELETE /v1/versions/{id}`, which also deletes the image when no other version uses it | | Logs and source maps | Log service | Until you delete the log project; in a project with `retentionDays`, logs only that many days | `DELETE /v1/projects/{id}` (log.parallelsandbox.com) | | Secrets | Control plane database, encrypted | Until you delete them | Secrets in the app's settings, or `DELETE /v1/secrets/{name}` | | An environment's service settings (environment variables) | Control plane database, encrypted | Until you delete them | `DELETE /v1/environments/{env}/services/{name}` | | Messages and activity records in the app | Control plane database | 7 days (a step that left a screenshot: 30 days) | Deleted automatically | When you delete your account, its boxes are deleted, archived ones included, and all of the above is deleted within 30 days at the latest. The REST details are on the [REST](https://parallelsandbox.com/en/docs/tools/rest/) page. ### Who can open a box's URL? Can I add a login or limit it by IP? - A box URL looks like `https://-.box.parallelsandbox.com`. The `key` is random, and a wrong one gets the same 404 as a box that does not exist; anyone with the full URL can open it, so treat it like a share link. - To limit where it can be opened from, give the account an IP allowlist: tell your AI "open box URLs only to our office's 203.0.113.0/24", and it calls `PUT /v1/box-access`. About 3 seconds later every box URL of the account accepts only those IPs; anything else gets 403 and does not wake a frozen box. There is one list per account, at most 50 entries, and only IPv4 is matched for now; to turn it off, ask for an empty list. - It suits teams with a company VPN or a fixed office IP. A colleague opening a review URL, or you testing on a phone over mobile data, must come from a listed IP (connect to the VPN first, say). - There is no extra login: a review URL has to work for a colleague straight away, without a ParallelSandbox account. - The takeover page and the app do not rely on the key in the URL: a takeover link is a one-time, expiring token from the control plane, and the app uses your sign-in. ## Databases and test data ### Is every box a fresh environment? Yes. Every box starts from the same clean snapshot, and a database running in the box lives only as long as the box: the same box keeps it while frozen or archived, and it is gone once the box is deleted (see [how long does a box stay?](https://parallelsandbox.com/en/docs/faq/#how-long-does-a-box-stay)). There is no disk shared live across boxes like a Kubernetes PVC; for files that should carry over from one box to the next, the account has persistent folders: a box started with `persist` gets each named folder at `/persist/`, saved when the box stops and restored into the next box that attaches it, one box at a time ([`sandbox_start`](https://parallelsandbox.com/en/docs/tools/sandbox-start/)). ### How do my services' environment variables (`DATABASE_URL` and so on) get into a box? Store them as an [environment](https://parallelsandbox.com/en/docs/environments/)'s service settings: import them from AWS ECS (with the SSM parameters and Secrets Manager values they reference), or upload a `.env`. A box started with that environment has `/work/.sbx/env/.env`, and a changed service starts with it, configured exactly as on your dev. The settings are stored encrypted and the API returns only variable names; changed settings reach only boxes started afterwards. ### Can I connect to my dev database directly? Yes: an environment plus a connector, with the service settings from the previous answer. Note: when a changed service starts with your dev settings, its migrations and writes land in your dev database for real. To only read it (checking data, reconciling a ledger), run `psbx-ro-psql ` in the box: it connects with that service's database setting in read-only transactions and hides the connection string in its output. ### I have a set of test data I want to keep using, without migrating and seeding every time. Keep that database in your own network (for example a Postgres in your dev just for tests) and let boxes reach it through an [environment](https://parallelsandbox.com/en/docs/environments/)'s connector. The data and the migration state stay with you, and every box carries on from where the last one left it. This is the way to keep it for good: ParallelSandbox does not keep the databases inside boxes for you. The account's persistent folders do carry files from one box to the next, but a database writing in one is stopped each time the box freezes or stops, and has to be started again after a wake ([`sandbox_start`](https://parallelsandbox.com/en/docs/tools/sandbox-start/)). ### I want a clean database every time. Run `psbx-testdb up ` in the box: it starts a fresh Postgres 16 (or MySQL 8.0 with `--mysql`) and writes its `DATABASE_URL` to `/work/.sbx/testdb/.env`; `psbx-testdb reset ` empties it again, and `psbx-testdb gotest ./...` gives every Go package a database of its own. Start other databases with your usual `docker compose`. For Redis, `psbx-testdb up --redis`. For an S3-compatible store, `psbx-testdb up --s3` starts one (rclone `serve s3`, since MinIO no longer publishes its image or binaries: `docker run minio/minio` fails with `pull access denied`, and dl.min.io answers 410) and writes `AWS_ENDPOINT_URL`, the keys, `AWS_REGION` and `S3_BUCKET` to its `.env`. ### In one line: what stays and what does not? - **Does not stay**: everything inside the box (code, containers, databases, `/work`) is gone once the box is deleted, 30 days after it is stopped or archived, except the account's persistent folders and what you pushed to a git remote. - **Stays**: what is in your own network (a database reached through the connector), the account's persistent folders (`/persist/`, saved when a box stops and restored into the next box that attaches them), images published to the registry, the build cache, and the stored files in the table above, each with its own limit. ## Secrets ### Where are secrets stored, and how do they reach a box? - One list for the whole account, stored encrypted in the control plane. Not one set per box. - Nothing goes into a box by default. The AI names the ones it needs when it starts the box, the box receives them the moment it is claimed, and they become environment variables of every command; they disappear with the box. - A stored value cannot be read back: tool results, `sandbox_status` and platform logs only show names. - Inside the box a secret is an environment variable. When a command prints it, what comes back to your AI has it masked as `****` (values of 8 characters or more), as are the secret-looking dev settings an environment puts in the box; files in the box, such as a log the program writes, still hold the real value, so do not fetch them to your AI if they may contain one. - Do not store ParallelSandbox's own API key as a secret; the box does not need it. ### Is there a settings screen? Yes: in [app.parallelsandbox.com](https://app.parallelsandbox.com/), the gear at the top right → Settings → Secrets. You can add, replace and delete them; it lists names and when each was last updated, and never shows a value. A value typed in the app never passes through your conversation with the AI, so it never reaches your AI provider; when the token is in your hands, use this. Your AI can also store one over REST ([Secrets](https://parallelsandbox.com/en/docs/secrets/)). ### What if my program needs AWS permissions (S3, SQS)? Do not store long-lived keys. Name an AWS role on the environment, and the box trades an OIDC token for temporary credentials that expire after an hour, the same way GitHub Actions connects to AWS ([AWS permissions inside a box](https://parallelsandbox.com/en/docs/environments/#aws-permissions-inside-a-box)). ParallelSandbox holds no long-lived access to your AWS account. ## Cost - A box is charged per minute from the moment it is ready; frozen boxes are free. It freezes after 10 minutes with no activity, so a box you forgot to stop does not keep burning credits. - Outbound traffic, logs and stored files are metered separately; environments and connectors are free. Rates are on [Credits](https://parallelsandbox.com/en/docs/tools/credits/). ## Example repos | Repo | What it shows | |---|---| | [example-compose-app](https://github.com/parallel-sandbox/example-compose-app) | A Node API and a Go worker wired together with compose; Playwright runs e2e in a real browser on the box's screen, with a recording, screenshots and a hand-over | | [example-web-with-logs](https://github.com/parallel-sandbox/example-web-with-logs) | A web page with the log SDK; error stacks restored with source maps; the write key brought into the box as a secret | Every tool call is on the [example repos](https://parallelsandbox.com/en/docs/examples/) page. A full example with several services, a dev split between AWS and an office network, connectors, and using a changed service from another box is in [team setup](https://parallelsandbox.com/en/docs/team-setup/). End of llms-full.txt.