# Accounts and sign-in Source: https://docs.boat.dev/account Sign-in methods, reinstalling or using a second computer, and which surface (CLI, API, SDKs, dashboard) does what. ## Sign-in methods There are four ways to sign in, on the CLI and on the [dashboard](https://boat.dev/dashboard): * GitHub * Google * A 6-digit code sent by email * [AgentID](https://agentid.com), for an AI agent that has its own AgentMail inbox. See [Sign up from an agent](/agent-auth#sign-in-with-agentid). No method is more correct than the others. Use the one you like. You can add the others later. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat login # asks: github, google, email, or agentid boat login --google boat login --email you@example.com boat login --agentid ``` Each method that you use is a **connection** on your account. [Dashboard > Account](https://boat.dev/dashboard?tab=account) lists them. * All connections open the same account, with the same sandboxes, settings and billing. * You can add or remove connections at any time. One connection must remain. * The **primary** connection sets the address that gets account notifications. To change that address, make a different connection primary. > [!NOTE] > > A sign-in with a method that is not connected yet makes a **separate** account. This is true also when the email address is the same. To add a second method to your account, do these steps: > > 1. Sign in with your usual method. > 2. Add the connection from the Account tab. > > To move a connection between two existing accounts, you must merge the accounts. Only support can do a merge. A sign-in with Google, email or AgentID does not give boat access to your code. To clone [repositories](/environments/repositories), you need a GitHub connection. You can add it when you first need it. ## Reinstalling, or a second computer Your plan, environment, sandboxes and settings are on your account, not on your computer. To reinstall boat, or to install it on a new computer, sign in on that computer: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat onboard # or: boat login ``` Sign in with the same method as the first time. `boat onboard` then finds your account: * It skips each step that your account has already done. * It does **not** open Stripe Checkout when your plan is active. > [!NOTE] > > Use the same sign-in method as before. A method that was never connected to your account opens a **separate** account, with its own empty plan. This is the usual cause when a reinstall asks you to subscribe again. ## What the sandboxes are for Onboarding asks what the sandboxes are for. There are two answers: * Your own work. * A platform of yours, used by third-party users. This is the default. The second answer marks your environment [safe for third parties](/environments#safe-for-third-parties). Then none of your credentials go to those sandboxes. You can change this at any time in [Dashboard > Environment](https://boat.dev/dashboard?tab=environment). ## Four ways to drive boat The four ways use the same platform. The code examples in these docs have **CLI**, **curl**, **TypeScript** and **Python** tabs. Select a tab one time, and the rest of the page uses it. | | Use it for | Auth | | - | - | - | | **CLI** (`boat`) | your terminal, CI jobs, shell scripts, and from inside a sandbox | browser sign-in or `BOAT_API_KEY` | | **REST API** | any language, webhooks, anything the SDKs do not cover yet | `BOAT_API_KEY` | | **SDKs** ([Python](/sdks/python), [TypeScript](/sdks/typescript)) | typed calls from your own service | `BOAT_API_KEY` | | **[Dashboard](https://boat.dev/dashboard)** | one-off work, and the things that must not be automatable | browser sign-in | The four ways are not identical. The differences are intentional: | Only in the dashboard | Only in the CLI | Only in the API and SDKs | | - | - | - | | [Webhook delivery history](/webhooks), removing [organization members](/organizations#members-and-invites), member roles and per-member caps, sign-in connections, per-sandbox metrics, [closing your account](/data-retention/close-account) | interactive SSH, SCP, port forwarding, `boat snapshot pull` | editing a webhook in place (`PATCH /webhooks/{webhookId}`), reading and writing files in a sandbox without SSH | Invites work from the CLI too: `boat org invite`. Read [Organizations](/organizations#members-and-invites). Some actions need a browser sign-in, on the CLI or on the dashboard. boat refuses them to an API key on purpose: * Rotate and revoke [API keys](/api-keys). * Turn on [zero data retention](/data-retention). To create an API key, use a browser sign-in, or an API key with the `admin` preset. A new key never gets more rights than the key that creates it. An agent can also sign itself in and claim a human. See [Sign up from an agent](/agent-auth). # Sign up from an agent Source: https://docs.boat.dev/agent-auth Let an AI agent register itself with boat, get a human to claim it, and start the free trial, without a pasted API key. An AI agent can sign up for boat without a human who pastes an API key. boat implements [auth.md](https://workos.com/blog/agent-registration-with-auth-md), the WorkOS agentic registration protocol. This page is about an agent that makes a boat account. For the agents that run inside a sandbox, read [Integrated agents](/integrated-agents). For an agent that uses boat every day from your computer, read [Use boat from your coding agent](/ai-tools). The contract is a machine-readable file at [boat.dev/auth.md](https://boat.dev/auth.md). This page is a human-readable copy of it. > [!NOTE] > > If you are an agent, fetch that file and follow it. Do not work from this page. Do not answer from search results about it. ## Start Give the agent this instruction: ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} Follow https://boat.dev/auth.md and start a sandbox free trial for me. ``` The agent then does these steps: 1. It finds the endpoints from `/.well-known/oauth-protected-resource`. 2. It registers. 3. Only after that, it calls the boat API. ## What the agent does ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark-default"}} %%{init: {"theme": "base", "fontFamily": "IBM Plex Mono", "themeVariables": {"fontFamily": "IBM Plex Mono", "fontSize": "14px", "primaryColor": "#F1F3F9", "primaryBorderColor": "#263FA9", "primaryTextColor": "#060606", "secondaryColor": "#E0E3F2", "tertiaryColor": "#FEFEFE", "lineColor": "#060606", "textColor": "#060606", "mainBkg": "#F1F3F9", "nodeBorder": "#263FA9", "clusterBkg": "#FEFEFE", "clusterBorder": "#C4C4C4", "edgeLabelBackground": "#FEFEFE", "actorBkg": "#F1F3F9", "actorBorder": "#263FA9", "actorTextColor": "#060606", "actorLineColor": "#9E9E9E", "signalColor": "#060606", "signalTextColor": "#060606", "labelBoxBkgColor": "#F1F3F9", "labelBoxBorderColor": "#263FA9", "noteBkgColor": "#E0E3F2", "noteBorderColor": "#E0E3F2", "noteTextColor": "#060606", "sectionBkgColor": "#F1F3F9", "altSectionBkgColor": "#FEFEFE", "taskBkgColor": "#263FA9", "taskBorderColor": "#263FA9", "taskTextColor": "#FEFEFE", "gridColor": "#E0E0E0"}, "flowchart": {"padding": 16, "nodeSpacing": 48, "rankSpacing": 48, "curve": "linear"}, "sequence": {"boxMargin": 16, "actorMargin": 48, "noteMargin": 16, "messageMargin": 32, "mirrorActors": false}, "state": {"padding": 16}, "gantt": {"barHeight": 24, "barGap": 8, "fontSize": 14, "sectionFontSize": 14}}}%% sequenceDiagram participant Agent participant boat participant Human Agent->>boat: GET /auth.md and well-known metadata Agent->>boat: POST /agent/identity (anonymous or email) alt anonymous boat-->>Agent: identity assertion (read-only) else email boat-->>Agent: user_code + verification URL end Agent->>Human: Open this link and type this 6-digit code Human->>boat: Sign in, enter the code boat-->>Agent: access_token (boat API key) Agent->>boat: POST /api/boat/billing/checkout Agent->>Human: Open Stripe Checkout to start the free trial Human->>boat: Card + trial Agent->>boat: POST /api/v1/sandboxes ``` There are two ways to register. | Method | Token | What the agent can do | | - | - | - | | **Anonymous** | Immediately | Only `GET /me` and `GET /limits`. A sandbox create returns `claim_required` until a human claims the agent. | | **Email (`service_auth`)** | After the person signs in and types the code | The agent must already know the user's email. | boat does not accept ID-JAG identity assertions. The agent must not send `identity_assertion` registration bodies. An agent that has its own AgentMail inbox can [sign in with AgentID](#sign-in-with-agentid) instead. ## Sign in with AgentID [AgentID](https://agentid.com) gives an AI agent its own identity: its AgentMail inbox. An agent with AgentID signs in to boat as itself. No human claims it, and no email code is necessary. * The boat account belongs to the agent's inbox address. * The agent's AgentMail organization must be verified by its human. * The free trial still needs a human to enter a card in Stripe Checkout. The agent does these steps: 1. It runs `boat login --agentid --json` and reads the `url` field. 2. It opens that URL in a browser. AgentID shows a waiting page with an `auth_token`. 3. It approves the sign-in with its AgentMail API key: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -X POST "https://api.agentmail.to/v0/inboxes/$AGENTMAIL_INBOX_ID/authorize" \ -H "Authorization: Bearer $AGENTMAIL_API_KEY" \ -H "Content-Type: application/json" \ --data '{"auth_token":"","accept_disclosure":true}' ``` 4. The browser returns to boat and shows "Login Complete". 5. It runs `boat onboard --wait --json` to finish the CLI login. The [dashboard](https://boat.dev/dashboard) also has a **Continue with AgentID** button. ## Expect approval prompts Almost every step sends a credential or an email address to a new host. Agent harnesses ask for approval before these actions. So the agent stops for approval more than once. This is correct behavior, not a failure. You can retry each step by itself. When an approval stops the agent, it does these steps: 1. It says what it is about to send. 2. It waits for approval. 3. It continues from the step where it stopped. ## Trial The trial uses the same Stripe Checkout that a human uses from the dashboard. 1. The agent calls `POST /api/boat/billing/checkout` with the claimed token. 2. The agent shows the URL that boat returns. 3. The human enters a card and starts the trial. These rules still apply: * A card is necessary. * boat runs trial-abuse checks. * There is one trial per identity. * An anonymous token cannot start a trial. For what the trial includes and its limits, read [Free trial](/free-trial). ## Prices An agent must never give a price from memory or from a web search. * `GET /api/v1/limits` returns the live plans, trial inclusions and caps. Read them there when necessary. * To estimate usage cost, send the human to [boat.dev](https://boat.dev). It has the calculator. * Search results and cached marketing pages are not a price source. Some of them describe other products. ## Endpoints The endpoints are on `https://boat.dev`. They are also under `/api/boat/...`, so they work behind the existing `/api` proxy. | Path | Purpose | | - | - | | `/auth.md` | Agent-readable walkthrough | | `/.well-known/oauth-protected-resource` | RFC 9728 discovery | | `/.well-known/oauth-authorization-server` | RFC 8414 + `agent_auth` block | | `POST /agent/identity` | Register | | `POST /agent/identity/claim` | Start or refresh the claim ceremony | | `GET /agent/identity/claim` | Human claim page | | `POST /oauth2/token` | Exchange assertion or poll claim | | `POST /oauth2/revoke` | Revoke one access token | A 401 from the boat API includes this header. An agent that only calls the API can use it to find the other endpoints. ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} WWW-Authenticate: Bearer resource_metadata="https://boat.dev/api/boat/.well-known/oauth-protected-resource" ``` # AI credentials and proxy Source: https://docs.boat.dev/ai-credentials Credential profiles, a second Claude or ChatGPT account when one runs out of credits, custom APIs, AI usage, and the proxy that keeps real keys out of your sandboxes. Your sandboxes get the AI credentials of a **credential profile**: Claude and ChatGPT sign-ins, API keys, and custom APIs. With the **AI credentials proxy** on, a sandbox gets placeholder keys, and the real keys stay with boat. | You want | Page | | - | - | | Connect your first key or subscription, or pass the keys of your users with `-e` | [Keys and subscriptions](/integrated-agents/keys) | | Share keys with a team, switch accounts, keep keys out of sandboxes, see AI usage | This page | | | CLI | API | SDKs | | - | - | - | - | | List profiles | `boat ai profiles` | `GET /credential-profiles` | `listCredentialProfiles` | | Create a profile | `boat ai profile new ` | `POST /credential-profiles` | `createCredentialProfile` | | Rename, make default | `boat ai profile rename` / `default` | `PUT /credential-profiles/{profile}` | `updateCredentialProfile` | | Delete a profile | `boat ai profile rm ` | `DELETE /credential-profiles/{profile}` | `deleteCredentialProfile` | | Set, remove an API key | `boat ai profile set-key` / `rm-key` | `PUT`, `DELETE /credential-profiles/{profile}/keys/{credential}` | `setCredentialProfileKey`, `deleteCredentialProfileKey` | | Switch a credential to another account | `boat ai accounts` / `switch` | `GET /credential-profiles/{profile}/accounts/{credential}`, `PUT …/{account}/active` | `listCredentialAccounts`, `switchCredentialAccount` | | Add, forget an account | `boat ai add-account` / `forget-account` | `POST /credential-profiles/{profile}/accounts/{credential}`, `DELETE …/{account}` | `addCredentialAccount`, `deleteCredentialAccount` | | Set, remove a custom API | `boat ai profile set-api` / `rm-api` | `PUT`, `DELETE /credential-profiles/{profile}/custom-apis/{name}` | `setCredentialProfileCustomApi`, `deleteCredentialProfileCustomApi` | | Proxy on or off | `boat ai proxy [on\|off]` | `GET`, `PUT /ai-proxy` | `getAiProxy`, `updateAiProxy` | | Usage | `boat ai usage [id]` | `GET /ai-usage`, `GET /sandboxes/{id}/ai-usage` | `getAiUsage`, `getSandboxAiUsage` | | Block, unblock a sandbox | `boat ai block` / `unblock` | `PUT /sandboxes/{id}/ai-access` | `setSandboxAiAccess` | The profile and proxy calls need an API key with `account.admin`. Account usage needs `account.read`. Sandbox usage needs `sandbox.read` on that sandbox. ## Credential profiles A credential profile is a named set of AI credentials. boat encrypts it at rest. The API never returns a secret value: it lists which credentials a profile holds (`connected`) and the names of its custom APIs. Each account has one **default** profile. A sandbox gets the default profile of its owner, unless its environment names another profile. The credentials you had before profiles existed are now the profile named `default`. On the dashboard **Agents & Proxying** page, pick a profile at the top. Both tabs then show and edit only that profile: its sign-ins and keys, its proxy switch, its custom APIs and its usage. | Credential | Kind | Set it with | | - | - | - | | `anthropic-api-key`, `openai-api-key`, `openrouter-api-key`, `llmgateway-api-key`, `deepseek-api-key`, `moonshot-api-key`, `mistral-api-key`, `xai-api-key`, `opencode-api-key` | API key | `set-key`, or the Agents & Proxying page | | `claude-subscription`, `chatgpt-subscription`, `kimi-subscription`, `mistral-vibe-subscription`, `grok-subscription` | Sign-in | The Agents & Proxying page | | `claude-bedrock`, `codex-bedrock` | AWS Bedrock | The Agents & Proxying page | You can remove any credential with `rm-key`. A sign-in sent to `set-key` returns `400 not_an_api_key`. ### Out of credits? Switch to another account A credential can hold several accounts: two ChatGPT sign-ins, two Claude sign-ins, two OpenAI keys. One account is in use. When it runs out of credits, switch the credential to another account. Every sandbox that uses the profile gets the other account at once, running sandboxes included. Nothing restarts, and the other credentials do not change. On the dashboard **Agents & Proxying** page, the account in use shows next to each credential. Click it to: * **switch** to another account, * **add another account**: sign in again, or paste another key. The current account stays, ready to switch back to, * **forget** an account. Forgetting the one in use switches to another account first. Sign-ins renew only while in use. An account set aside keeps its sign-in as it was, and renews when you switch back to it. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ai accounts chatgpt-subscription # # ACCOUNT # 1 you@work.dev in use # 2 you@home.dev boat ai switch chatgpt-subscription 2 # API keys: add a second key, then switch by number, or by its last characters echo "$OPENAI_API_KEY_2" | boat ai add-account openai-api-key boat ai switch openai-api-key …7f3a boat ai forget-account openai-api-key 2 ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/credential-profiles/default/accounts/chatgpt-subscription" \ -H "Authorization: Bearer $BOAT_API_KEY" # use the id of the account to switch to, from the list curl -sS -X PUT "$BOAT_API_BASE/credential-profiles/default/accounts/chatgpt-subscription/$ACCOUNT_ID/active" \ -H "Authorization: Bearer $BOAT_API_KEY" curl -sS -X POST "$BOAT_API_BASE/credential-profiles/default/accounts/openai-api-key" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"value":"'"$OPENAI_API_KEY_2"'"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { accounts } = await sandbox.listCredentialAccounts({ profile: "default", credential: "chatgpt-subscription" }); const other = accounts.find((a) => !a.active)!; await sandbox.switchCredentialAccount({ profile: "default", credential: "chatgpt-subscription", account: other.id }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} accounts = sandbox.list_credential_accounts("default", "chatgpt-subscription").accounts other = next(a for a in accounts if not a.active) sandbox.switch_credential_account("default", "chatgpt-subscription", other.id) ``` `--profile` picks another profile; the default is your default profile. The account list never shows a secret: a sign-in shows its email when the provider gives it, a key shows its last characters. To give different sandboxes different accounts at the same time, use one profile per account and name the profile on an environment (see [Environments](#environments)). ### Set and remove API keys `--copy-from` starts a new profile with a copy of the API keys and custom APIs of a profile you manage. Sign-ins are not copied: one sign-in in two profiles would sign itself out at the first renewal. Sign in again on the new profile. The CLI reads a key from stdin when you omit the value, so the key stays out of your shell history. A key is one token of up to 8192 printable characters, without spaces or line breaks; anything else returns `400`. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ai profile new ci --copy-from default echo "$ANTHROPIC_API_KEY" | boat ai profile set-key ci anthropic-api-key boat ai profile rm-key ci claude-subscription boat ai profile rename ci ci-bots boat ai profile rm ci-bots ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/credential-profiles" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"name":"ci","copyFrom":"default"}' curl -sS -X PUT "$BOAT_API_BASE/credential-profiles/ci/keys/anthropic-api-key" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"value":"'"$ANTHROPIC_API_KEY"'"}' curl -sS -X DELETE "$BOAT_API_BASE/credential-profiles/ci/keys/claude-subscription" \ -H "Authorization: Bearer $BOAT_API_KEY" curl -sS -X DELETE "$BOAT_API_BASE/credential-profiles/ci" -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.createCredentialProfile({ name: "ci", copyFrom: "default" }); await sandbox.setCredentialProfileKey({ profile: "ci", credential: "anthropic-api-key", value: process.env.ANTHROPIC_API_KEY!, }); await sandbox.deleteCredentialProfileKey({ profile: "ci", credential: "claude-subscription" }); await sandbox.deleteCredentialProfile({ profile: "ci" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import os from boat_sdk.models.create_credential_profile_request import CreateCredentialProfileRequest from boat_sdk.models.set_credential_key_request import SetCredentialKeyRequest sandbox.create_credential_profile(CreateCredentialProfileRequest(name="ci", copy_from="default")) sandbox.set_credential_profile_key("ci", "anthropic-api-key", SetCredentialKeyRequest(value=os.environ["ANTHROPIC_API_KEY"])) sandbox.delete_credential_profile_key("ci", "claude-subscription") sandbox.delete_credential_profile("ci") ``` Running sandboxes that use the profile get a changed key. You cannot delete a default profile (`409 is_default`) or a profile that an environment names (`409 in_use`). ### Organization profiles An organization can own profiles too. By default, every active member can use them. An owner can limit a profile to a list of members with `boat ai profile access`. Read [Limit who can use an environment or profile](/organizations#limit-who-can-use-an-environment-or-profile). Only organization owners create and change them, and only they see the account list. In a profile list, `owner.kind` is `org` and `canManage` tells you if you can change it. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat --org acme ai profile new team-claude echo "$ANTHROPIC_API_KEY" | boat ai profile set-key team-claude anthropic-api-key boat ai profiles --org-only ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/credential-profiles" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"name":"team-claude","org":"acme"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.createCredentialProfile({ name: "team-claude", org: "acme" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.create_credential_profile(CreateCredentialProfileRequest(name="team-claude", org="acme")) ``` To give the sandboxes of an organization the organization profile, name it on an organization environment. See [Shared sandboxes](/organizations/shared-sandboxes#shared-environments-and-ai-credentials). ### Your own Claude sign-in in a sandbox The Claude Code credential you select in your profile sets variables in the sandbox's shells. Only the selected one does. A connected Anthropic API key that you did not select is not in the sandbox, so it is never billed: | Selected credential | Variables | | - | - | | Claude subscription | `CLAUDE_CODE_OAUTH_TOKEN` | | Anthropic API key | `ANTHROPIC_API_KEY` | | OpenRouter or DeepSeek key for Claude Code | `ANTHROPIC_BASE_URL`, `ANTHROPIC_AUTH_TOKEN` | When you select another credential, running sandboxes drop the variables of the previous one. Claude Code prefers these variables to a sign-in. Remote Control needs a full claude.ai sign-in. To use it, run `claude` in the sandbox and sign in with `/login`. From the next shell, boat removes `CLAUDE_CODE_OAUTH_TOKEN`, `ANTHROPIC_BASE_URL` and `ANTHROPIC_AUTH_TOKEN`, and `claude` uses your sign-in. boat never removes that sign-in: it stays across stops, resumes and cold resumes. The agent that `boat prompt` runs still uses the profile. ## Custom APIs A custom API is a secret for any HTTPS API, such as Stripe or your own service. You give it a name, a value and a base URL. The sandbox gets two variables: | Variable | Value | | - | - | | `` | The secret. A placeholder when the proxy is on | | `_BASE_URL` | The base URL. The proxy URL when the proxy is on | The name is an environment variable name: `A-Z`, `0-9` and `_`, up to 64 characters. Provider names (`ANTHROPIC_*`, `OPENAI_*`, `AWS_*`, and so on) and names that end in `_BASE_URL` are reserved. The base URL must use HTTPS on the default port, with a public DNS name. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} echo "$STRIPE_KEY" | boat ai profile set-api default STRIPE_KEY --base-url https://api.stripe.com/v1 boat ai profile rm-api default STRIPE_KEY ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PUT "$BOAT_API_BASE/credential-profiles/default/custom-apis/STRIPE_KEY" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"value":"'"$STRIPE_KEY"'","baseUrl":"https://api.stripe.com/v1"}' curl -sS -X DELETE "$BOAT_API_BASE/credential-profiles/default/custom-apis/STRIPE_KEY" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.setCredentialProfileCustomApi({ profile: "default", name: "STRIPE_KEY", value: process.env.STRIPE_KEY!, baseUrl: "https://api.stripe.com/v1", }); await sandbox.deleteCredentialProfileCustomApi({ profile: "default", name: "STRIPE_KEY" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.set_custom_api_request import SetCustomApiRequest sandbox.set_credential_profile_custom_api("default", "STRIPE_KEY", SetCustomApiRequest( value=os.environ["STRIPE_KEY"], base_url="https://api.stripe.com/v1", )) sandbox.delete_credential_profile_custom_api("default", "STRIPE_KEY") ``` Code in the sandbox must send its requests to `$_BASE_URL`. With the proxy on, a request sent straight to the API with the placeholder fails. ## The AI credentials proxy Without the proxy, a sandbox holds your real keys and sign-ins. Anyone with a shell in it can copy them. With the proxy on, the real keys never enter the sandbox. ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox Boat provider ANTHROPIC_API_KEY= ANTHROPIC_BASE_URL= agent ── request + placeholder ──▶ proxy: placeholder valid? sandbox blocked? swap in the real key ── request + real key ──▶ api.anthropic.com ◀──────── reply ───────────── count tokens ◀─────────── reply ────────────── ``` | | The sandbox holds | boat holds | | - | - | - | | Proxy off | The real keys and sign-ins | The real keys and sign-ins | | Proxy on | Placeholders and the proxy URL | The real keys and sign-ins, and renews the sign-ins | * A placeholder is worthless outside boat. It does not contain the real key. * A copied placeholder stops working when the sandbox stops. Each start gives the sandbox new placeholders. * The proxy sends each credential only to its own provider. An Anthropic key never goes to another host. * The proxy puts a provider key only in the `Authorization` or `x-api-key` header. A placeholder in another header or in the URL stays a placeholder, so a provider that echoes it cannot return the real key. * A custom API gets its secret in any request header and in the query string, never in the path. Pick a base URL you trust: a host that echoes requests shows the secret to the sandbox. * boat renews Claude, ChatGPT and Grok sign-ins behind the proxy. The sandbox never sees a renew token. ### What the proxy covers | Proxied | Not proxied | | - | - | | Claude sign-in and Anthropic API key (Claude Code) | AWS Bedrock (`claude-bedrock`, `codex-bedrock`) | | ChatGPT sign-in and OpenAI API key (Codex) | Kimi Code sign-in (`kimi-subscription`) | | OpenRouter, LLM Gateway, DeepSeek, Moonshot API keys | | | Mistral API key and Mistral Vibe sign-in | | | Grok sign-in and xAI API key | | | OpenCode key (Go and pay-as-you-go) | | | Custom APIs | | Bedrock signs each request with AWS keys, so there is nothing to swap. The Kimi Code CLI renews its sign-in itself. While the proxy is on, boat withholds these credentials from sandboxes. Use a Moonshot API key in place of the Kimi sign-in. ### Turn it on The switch is per account: one for you, one for each organization. Only an organization owner can change the organization switch. On the dashboard, open **Agents & Proxying**, then the **Proxying** tab. It holds the switch, the custom APIs and the AI usage, for the account in view: you, or the organization you selected. A sandbox goes through the proxy when either switch is on: * the switch of the account that owns its credential profile, or * the switch of the organization that pays for the sandbox. An organization can make sure that no real key enters its sandboxes, whoever's profile they use. Running sandboxes switch at their next start. Stop and resume a sandbox to switch it now. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ai proxy # state and price boat ai proxy on boat --org acme ai proxy on ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/ai-proxy" -H "Authorization: Bearer $BOAT_API_KEY" curl -sS -X PUT "$BOAT_API_BASE/ai-proxy" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"enabled":true}' curl -sS -X PUT "$BOAT_API_BASE/ai-proxy?org=acme" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"enabled":true}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const proxy = await sandbox.getAiProxy(); console.log(proxy.enabled, proxy.pricing); await sandbox.updateAiProxy({ enabled: true }); await sandbox.updateAiProxy({ org: "acme", enabled: true }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.update_ai_proxy_request import UpdateAiProxyRequest proxy = sandbox.get_ai_proxy() print(proxy.enabled, proxy.pricing) sandbox.update_ai_proxy(UpdateAiProxyRequest(enabled=True)) sandbox.update_ai_proxy(UpdateAiProxyRequest(enabled=True), org="acme") ``` The proxy applies to sandboxes that use a profile of an account with the switch on. A sandbox that uses an organization profile follows the organization switch. ## Safe for third parties, with AI credentials An environment marked [safe for third parties](/environments#safe-for-third-parties) passes nothing of yours. Turn on `proxyAiCredentials` on that environment to still pass AI credentials, as placeholders. The sandbox user can run the agents, but cannot take your keys. You can block the sandbox at any time. `proxyAiCredentials` needs the proxy on for the account that owns the profile. If it is off, the call returns `400 ai_proxy_off`. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ai proxy on boat env set customers --safe-for-third-parties true --proxy-ai-credentials true --credential-profile ci ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PUT "$BOAT_API_BASE/environments/$ENV_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"safeForThirdParties":true,"proxyAiCredentials":true,"credentialProfileId":"ci"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.updateEnvironment({ environmentId: envId, safeForThirdParties: true, proxyAiCredentials: true, credentialProfileId: "ci", }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.update_sandbox_environment_request import UpdateSandboxEnvironmentRequest sandbox.update_environment(env_id, UpdateSandboxEnvironmentRequest( safe_for_third_parties=True, proxy_ai_credentials=True, credential_profile_id="ci", )) ``` ## Environments An environment can name the profile its sandboxes get, with `credentialProfileId` (an id or a name). `null`, or `--credential-profile default` in the CLI, means the default profile of the sandbox owner. Like every environment change, this makes a new version. Running sandboxes move at `boat env upgrade`. See [Environments](/environments/access#ai-credentials). ## Usage For each proxied sandbox, boat counts requests and errors, and the tokens per UTC day, credential and model. The token counts are the numbers the provider reports in its replies: input, output, cache read and cache write. A sandbox that holds real keys has no usage here, because its requests do not go through boat. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ai usage # every sandbox of the account in scope boat ai usage bx_23456789 --days 7 # one sandbox, per day and model ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/ai-usage?days=30" -H "Authorization: Bearer $BOAT_API_KEY" curl -sS "$BOAT_API_BASE/sandboxes/bx_23456789/ai-usage?days=7" -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const account = await sandbox.getAiUsage({ days: 30 }); for (const s of account.sandboxes) console.log(s.sandboxId, s.totals.requests, s.dollars); const one = await sandbox.getSandboxAiUsage({ sandboxId: "bx_23456789", days: 7 }); console.log(one.blocked, one.totals.inputTokens, one.totals.outputTokens); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} account = sandbox.get_ai_usage(days=30) for s in account.sandboxes: print(s.sandbox_id, s.totals.requests, s.dollars) one = sandbox.get_sandbox_ai_usage("bx_23456789", days=7) print(one.blocked, one.totals.input_tokens, one.totals.output_tokens) ``` The account view covers the wallet in scope: your own, or an organization with `--org`, `org` or `X-Boat-Org`. In the dashboard, open the **⋯** menu of a sandbox and select **AI usage**. `dollars` in these responses is the boat proxy charge: \$1 per 1,000 requests. It is not your provider bill. The provider bills your tokens on your own provider account. ### Cap AI spend boat has no automatic AI spend cap. The member spend cap of an organization limits sandbox time, not provider tokens. To cap AI spend yourself: 1. Read the usage of each sandbox with `GET /sandboxes/{id}/ai-usage` on a schedule. 2. When the tokens pass your limit, [block the sandbox](#block-a-sandbox). This works only for proxied sandboxes. Also set a spend limit in the console of your provider. ### Block a sandbox Block a sandbox to stop its AI requests at once, running or stopped. The proxy refuses its placeholders with `403`. Unblock it to accept them again. Blocking has no effect on a sandbox that holds real keys (proxy off). The sandbox creator and the managers of its profile can block it. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ai block bx_23456789 boat ai unblock bx_23456789 ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PUT "$BOAT_API_BASE/sandboxes/bx_23456789/ai-access" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"blocked":true}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.setSandboxAiAccess({ sandboxId: "bx_23456789", blocked: true }); await sandbox.setSandboxAiAccess({ sandboxId: "bx_23456789", blocked: false }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.set_sandbox_ai_access_request import SetSandboxAiAccessRequest sandbox.set_sandbox_ai_access("bx_23456789", SetSandboxAiAccessRequest(blocked=True)) sandbox.set_sandbox_ai_access("bx_23456789", SetSandboxAiAccessRequest(blocked=False)) ``` ## Pricing Profiles, custom APIs and usage tracking are free. The proxy costs money. The [wallet](/billing#wallet) pays it, not the plan's included time: | Charge | Price | Paid by | | - | - | - | | Each UTC day the proxy is on | \$1 | The wallet of the account with the switch on | | Proxied requests | \$1 per 1,000 | The wallet each sandbox bills | `dollars` in the usage responses is the request charge for the period. It does not include the daily charge. The provider bills your tokens as usual, on your own provider account. ## Related * [Keys and subscriptions](/integrated-agents/keys) * [Environments](/environments) * [Organizations](/organizations) * [Integrated agents](/integrated-agents) * [Pricing](/pricing) * [CLI reference](/cli-reference#boat-ai) # Use boat from your coding agent Source: https://docs.boat.dev/ai-tools Let Claude Code, Codex or Cursor on your computer start and drive boat sandboxes: the boat CLI, the docs MCP server, llms.txt, skills, and an AGENTS.md snippet. Your coding agent drives boat with the `boat` CLI, the same as you. Give it three things: 1. The CLI, signed in. 2. The boat docs, through the MCP server or `llms.txt`. 3. A short rule in `AGENTS.md` or `CLAUDE.md` that says when to use a sandbox. This page is about an agent on your computer. For the agents inside a sandbox, read [Integrated agents](/integrated-agents). ## 1. Install the CLI and sign in ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -fsSL https://boat.dev/install | sh ``` On Windows, run `irm https://boat.dev/install.ps1 | iex` in PowerShell. Open a new terminal after the install. An agent runs commands without a browser. Sign it in with an [API key](/api-keys): ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} echo "$BOAT_API_KEY" | boat login --key-stdin ``` No account yet? The agent can make one itself. Read [Sign up from an agent](/agent-auth). ## 2. Give the agent the docs | Source | URL | Use it when | | - | - | - | | MCP server | `https://docs.boat.dev/mcp` | The agent supports MCP. It can search the docs and read pages. | | Index | `https://docs.boat.dev/llms.txt` | The agent can only fetch URLs. Every page, with a one-line summary. | | Full text | `https://docs.boat.dev/llms-full.txt` | You want all the docs in one file. It is large: about 135,000 tokens. | | One page as Markdown | Add `.md` to any page URL, for example `https://docs.boat.dev/quickstart.md` | The agent needs one page. | Add the MCP server: ```bash Claude Code theme={"theme":{"light":"github-light","dark":"github-dark-default"}} claude mcp add --transport http boat-docs --scope user https://docs.boat.dev/mcp ``` ```bash Codex theme={"theme":{"light":"github-light","dark":"github-dark-default"}} codex mcp add boat-docs --url https://docs.boat.dev/mcp ``` ```json Cursor theme={"theme":{"light":"github-light","dark":"github-dark-default"}} { "mcpServers": { "boat-docs": { "url": "https://docs.boat.dev/mcp" } } } ``` For Cursor, put the JSON in `~/.cursor/mcp.json`, or in `.cursor/mcp.json` in your project. The **⋯** menu on every docs page also has one-click entries for Claude, ChatGPT, Cursor and VS Code. ## 3. Add a rule to AGENTS.md Put this in `AGENTS.md` (Codex, Cursor and most agents) or `CLAUDE.md` (Claude Code) in your project: ```markdown AGENTS.md theme={"theme":{"light":"github-light","dark":"github-dark-default"}} ## Cloud sandboxes (Boat) Use a Boat sandbox for builds, tests, untrusted code, Docker, and long jobs. Never run them on this computer. Docs: https://docs.boat.dev/llms.txt. Prices and limits: run `boat limits`; never quote prices from memory. - Create: `id=$(boat new --json | jq -r 'select(.event=="ready") | .id')` - One-shot job: `boat run --push . -- npm test` (new sandbox, run, cost, delete; exits with the test exit code) - Run: `boat exec "$id" --cwd my-app "npm test"` (30 s timeout; `--timeout 0` = no limit) - Server: `boat exec "$id" --detach "npm run dev"`, then `boat exec "$id" --status ` - Copy files: `boat push "$id" ./my-app` (git-tracked files, to /home/user/my-app) or clone the repo inside the sandbox - Public URL for a port: `boat ssh "$id" "host 3000 --private"` - Always pass the sandbox id. `current` does not work in a non-interactive shell. - When done: `boat stop "$id"` (keeps the disk for at least 14 days) or `boat delete "$id" --yes` (erases it) ``` The `--json` output of `boat new` is one JSON object per line. The `ready` line holds the `id`. ## Skills The open skill pack installs boat skills for Claude Code, Codex, Cursor and other agents: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} npx skills add ariana-dot-dev/cloud-sandbox-vm-skills ``` It has 13 skills, for example `cloud-sandbox`, `parallel-agents`, `background-worker` and `public-url-hosting`. Each skill tells the agent when to use boat and which commands to run. > [!WARNING] > > Some skills in the pack still show older values: the `on.ascii.dev` domain, an 80 GB disk and a fixed cap of 100 sandboxes. These docs are correct. Public URLs use `on.boat.dev`. For sizes and limits, read [Pricing](/pricing). Inside a sandbox, every integrated agent already has a `boat` skill. You do not install it. ## Related * [CLI reference](/cli-reference) * [Run a coding agent on your repo](/recipes/agent-on-repo) * [Run many agents in parallel](/recipes/parallel-agents) * [API keys](/api-keys) # API keys and tokens Source: https://docs.boat.dev/api-keys Create scoped, expiring boat API keys, use them as bearer tokens, and revoke a leaked key. Create a key for CI or a server: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat api-key create ci --preset ci --ttl 90d ``` Store the secret as `BOAT_API_KEY`. Send it as a bearer token: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS https://boat.dev/api/v1/me -H "Authorization: Bearer $BOAT_API_KEY" ``` * A new key starts with `boat_`. Older keys start with `box_` and still work. * Every new key expires. The maximum is 365 days. * Every new key has a scope. boat checks it on each request. * A key acts as you. It is either an **organization key** or an **account key**. | Key | Made from | Bills and sees | Account settings | | - | - | - | - | | Organization key | The dashboard with that organization selected, `boat --org api-key create`, `boat api-key create` while that organization is active, or `"org": ""` (or `X-Boat-Org: `) on `POST /api-keys/scoped` | That organization only. A request that names another organization or Personal gets `403 api_key_org_mismatch`. | Refused (`403 api_key_org_forbidden`): webhooks, AI credentials, billing, keys, members. | | Account key | The dashboard with Personal selected, `boat --org personal api-key create`, or a request that names no organization | The organization a request names with `X-Boat-Org: `, else your active wallet. Read [Active wallet](/organizations/active-wallet). | Allowed, if the scope allows it. | The dashboard lists the keys of the selected organization. Personal lists the account keys. > [!WARNING] > > A key leaked? Revoke it now. Read [Key leaked](/api-keys/store-rotate-revoke#key-leaked). > [!WARNING] > > Treat API keys as secrets. Do not commit them, print them in logs or put them into images. ## Main task 1. [Create a key](/api-keys/create-and-list#create-a-key) with the smallest scope that does the job. 2. [Store it](/api-keys/store-rotate-revoke#store-a-key) as `BOAT_API_KEY` in your platform secret manager. 3. [Use it](/api-keys/create-and-list#use-the-key) from the CLI, the API or an SDK. 4. [Rotate or revoke it](/api-keys/store-rotate-revoke) when you need to. ## Production guidance * Use one key per job. * Use the shortest TTL that works for you. * Use `read-only` or `ci`. Full account access requires an explicit `--preset admin`. * Pass at least one of `--preset`, `--actions`, `--sandbox` or `--env`. * Limit a key to sandboxes or environments with `--sandbox` or `--env` when you can. * For keys inside your end users' sandboxes, read [Security for platforms](/security). ## Learn more > [card] [Scopes](/api-keys/scopes) > > Actions, presets, the in-sandbox API key and scope errors. > [card] [Create and list keys](/api-keys/create-and-list) > > Create a key, use it, list your keys and see the usage of one key. > [card] [Store, rotate and revoke](/api-keys/store-rotate-revoke) > > Revoke a leaked key, store a key and replace its secret. > [!NOTE] > > Keys created before scoped keys existed have no expiry and full access. Replace them with new scoped keys. `boat api-key list` shows them with no expiry. # Create and list keys Source: https://docs.boat.dev/api-keys/create-and-list Create a scoped boat API key, use it, list your keys and see the usage of one key. ## Create a key To create a key, you need one of these: * A browser session: `boat login` with no key, or the dashboard. * A key with the `account.admin` action, or an `admin` key. The new key cannot have more actions, more sandboxes or a later expiry than this key. The create endpoint is `POST https://boat.dev/api/v1/api-keys/scoped`. > [!NOTE] > > During a credential rollout, boat can turn off key creation for a short time. `GET /api/v1/api-keys` reports this in `catalog.scopedCreationEnabled`. While creation is off, the create endpoint returns a typed 503. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat api-key create my-project --ttl 90d --preset ci --sandbox bx_123 boat api-key create readonly --ttl 30d --preset read-only boat api-key create admin --ttl 7d --preset admin boat api-key create custom --ttl 24h --actions sandbox.read,exec,file.read ``` | Flag | Rule | | - | - | | `--ttl` | The maximum is 365 days. `--ttl never` makes a key that works until you revoke it. A key that expires cannot create one that never expires. | | `--sandbox`, `--env` | You can give each one more than one time. | | `--actions`, `--preset` | Use one or the other, not both. | | No `--ttl` | The key expires after 90 days. | | No scope flags | The command fails. Pass at least one of `--actions`, `--preset`, `--sandbox` or `--env`. | > [!WARNING] > > Full account access requires an explicit `--preset admin`. An admin key can also create more keys. A key that never expires is still a scoped key. If it leaks, it works until you revoke or rotate it. Read [Store, rotate and revoke](/api-keys/store-rotate-revoke). For the actions and presets, read [Scopes](/api-keys/scopes). With the API: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST https://boat.dev/api/v1/api-keys/scoped \ -H "Authorization: Bearer $BOAT_ADMIN_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"tenant-42","ttl":"30d","preset":"full-sandbox","sandboxIds":["bx_123"]}' ``` The body takes `name`, `ttl`, `preset` or `actions`, `sandboxIds` and `environmentIds`. Pass at least one non-empty scope field. Full account access requires `"preset":"admin"`. boat shows the secret one time only. In scripts, capture it like this: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} BOAT_API_KEY="$(boat api-key create my-project --preset ci --ttl 90d --json | jq -r '.secret')" ``` You can also use the **API Keys** tab in the dashboard. It has expiry presets, action presets, a raw action picker, and sandbox and environment selectors. ## Use the key ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat login --key-stdin --json <<< "$BOAT_API_KEY" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/me" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { BoatApi, Configuration } from "@boatdev/sdk"; const sandbox = new BoatApi(new Configuration({ basePath: "https://boat.dev/api/v1", accessToken: process.env.BOAT_API_KEY!, })); const me = await sandbox.me(); console.log(me.user.login); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import os from boat_sdk import ApiClient, Configuration from boat_sdk.api.boat_api import BoatApi config = Configuration(host="https://boat.dev/api/v1", access_token=os.environ["BOAT_API_KEY"]) with ApiClient(config) as client: sandbox = BoatApi(client) me = sandbox.me() print(me.user.login) ``` ## What a key cannot do * Create needs a browser session or an admin-scoped token. A credential that can make more credentials defeats least privilege. * Rotate and revoke need a browser session or a key that can create keys. Such a key can rotate or revoke itself and any key that it could create. * To approve an agent claim, you need a browser session. API keys cannot approve agent claims. This includes admin keys and legacy keys. Use `boat api-key create|rotate|revoke`, or use the [API Keys](https://boat.dev/dashboard?tab=api-keys) tab. ## List The CLI, the API, the SDKs and the dashboard can list keys. boat never returns the secrets. Each row shows: * The id, the name, the prefix and the last four characters * The scope and the expiry * The last use * The request total for the last 30 days * How many sandboxes and Agents the key created that still exist boat labels expired keys and keys that expire soon. A key limited with `--sandbox` or `--env` gets an empty `apiKeys` list. A browser session, a CLI session or a key with no such limit gets the full list. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat api-key list boat api-key list --all # include per-sandbox machine keys ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const keys = await sandbox.apiKeys(); for (const key of keys.apiKeys) { console.log(key.id, key.name, key.usage.requests, key.resources.total); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} keys = sandbox.api_keys() for key in keys.api_keys: print(key.id, key.name, key.usage.requests, key.resources.total) ``` ## See usage for one key `boat api-key usage ` prints the 30-day request total and the count of live resources. These are the same numbers as in the list. * Add `--verbose` to see the split between sandboxes and Agents, and the list of created resources. * The matching API is `GET /api-keys/{id}/usage`. * Usage still works after you revoke the key, if you still have the id. Revoke stops the secret. It does not delete the sandboxes or Agents that the key created. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat api-key usage sak_123 boat api-key usage sak_123 --verbose ``` # Scopes Source: https://docs.boat.dev/api-keys/scopes What a scoped boat API key can do: actions, presets, the in-sandbox API key and scope errors. This page covers what each API key can do. For the full security picture, read [Security and isolation](/security). ## How boat checks a request boat grants a request only when **both** of these are true: 1. The action is in the action set of the key. 2. The target sandbox is in the sandbox set of the key, or in one of its environments. The default is deny. boat refuses unknown routes for scoped keys. ## Snapshots and environments | You want to | The key needs | | - | - | | Create a sandbox from a saved snapshot | `sandbox.create` for the destination, and `snapshot.read` access to the source | | Replace a saved snapshot | Access to its existing source, and access to the sandbox that you save | A destination environment does not give access to snapshots from other environments. ## Actions | Action | What it unlocks | | - | - | | `sandbox.create` | Create a sandbox | | `sandbox.read` | List and inspect sandboxes | | `sandbox.update` | Rename, recover, and other sandbox writes | | `sandbox.stop` | Stop | | `sandbox.resume` | Resume | | `sandbox.fork` | Fork | | `sandbox.delete` | Delete | | `sandbox.delete-own` | Delete only the sandboxes this key created | | `agent.prompt` | Prompt the sandbox agent | | `exec` | Run a command | | `file.read` / `file.write` | Read or write files | | `ssh` | SSH, scp, and port forward | | `desktop` | Desktop stream | | `host` | Host a port | | `snapshot.read` / `snapshot.write` | Snapshots | | `environment.read` / `environment.write` | Environments | | `account.read` | `/me`, limits, organization discovery, list keys (a key limited to sandboxes or environments sees an empty list) | | `account.admin` | Billing, teams, webhooks, identities, account writes | | `*` | Admin wildcard | ## Presets | Preset | Use | | - | - | | `read-only` | Inspect sandboxes, files, snapshots, environments | | `full-sandbox` | Operate a sandbox without create / resume / fork / delete / account writes | | `ci` | Everything in `full-sandbox`, plus create, resume, fork, and delete the sandboxes this key created. No account admin | | `admin` | `*` | A key keeps the actions that it had when you created it. Resume, SSH and `sandbox.delete-own` joined the `ci` preset later. An older `ci` key does not get them. To get them, create a new `ci` key. ## In-sandbox API key boat writes an API key into each sandbox for the boat CLI there. The file is `~/.config/ascii/boat/config.json`. The key works on **that sandbox** only. It is not listed by `boat api-key list` unless you add `--all`. | It can, on its own sandbox | It cannot | | - | - | | Read, rename and stop the sandbox | Create, resume, fork or delete sandboxes | | Prompt, exec, read and write files | Reach any other sandbox | | SSH, desktop, host a port | Write environments | | Read and save snapshots | Administer the account, billing, webhooks or keys | * *Safe for third parties*, `--no-env` and the **boat credentials** toggle set to off remove this key. * A separate token, `ASCII_TOKEN`, always stays. It can only host ports of its own sandbox. Read [Security for platforms](/security) before you give end users shell access. ## Errors Scoped keys return typed 403 errors: | `error` | Meaning | | - | - | | `api_key_expired` | The TTL elapsed | | `api_key_action_forbidden` | The action is not on the key | | `api_key_sandbox_forbidden` | The sandbox or the environment is not on the key | The bearer header and the SDK configuration do not change. # Store, rotate and revoke Source: https://docs.boat.dev/api-keys/store-rotate-revoke Revoke a leaked boat API key, store a key safely, and replace its secret with or without downtime. ## Key leaked Do these steps now, in this order. 1. Sign in with a browser session. Revoke needs a session or a key that can create keys. A key with less access cannot revoke. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat login ``` 2. Find the key and revoke it. Find the id by its name, prefix or last four characters. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat api-key list boat api-key revoke ``` 3. See what the key created. Delete the sandboxes that you do not know. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat api-key usage --verbose ``` 4. Look for new keys that you did not create. An `admin` key or a key with `account.admin` can create keys. Revoke them too. 5. Create a replacement with the smallest scope. Update your secret manager. Read [Create a key](/api-keys/create-and-list#create-a-key). You can also click **Revoke** in the [API Keys](https://boat.dev/dashboard?tab=api-keys) tab of the dashboard. ## Store a key | Platform | Store as | | - | - | | Railway | Variable named `BOAT_API_KEY` | | GitHub Actions | Repository or environment secret named `BOAT_API_KEY` | | Docker Compose | Environment variable or secret named `BOAT_API_KEY` | | Kubernetes | Secret mounted or exposed as `BOAT_API_KEY` | Do not put API keys in: * Dockerfiles * Images * Source code * Shell history * Public CI logs ## Rotate a key Rotate does these things: * It revokes the old secret immediately. * It keeps the id, the scope and the expiry date of the key. * It replaces the secret and shows the new secret one time only. Rotate does not extend the lifetime of the key. It does not change a legacy key into a scoped key. You cannot rotate an expired scoped key. The API returns `409 api_key_expired`. Create a replacement key instead. Rotate needs a browser session. Read [What a key cannot do](/api-keys/create-and-list#what-a-key-cannot-do). ### Rotate with downtime Use **Rotate** only when you can update the deployed secret immediately. 1. Rotate the key. Run `boat api-key rotate `, or use the dashboard. To find the id, run `boat api-key list`. 2. Copy the new secret. 3. Update `BOAT_API_KEY` in your platform secret manager. 4. Redeploy or restart the workers that use the key. ### Replace without downtime 1. Create a new key. 2. Update the platform secret to the new key. 3. Redeploy or restart the workers. 4. When the new deployment is live, revoke the old key. ## Revoke a key Run `boat api-key revoke `, or click **Revoke** in the dashboard. Revoke needs a browser session. The command does not take `--yes`. * Revoke turns off the key immediately. * The next boat API request with that secret fails with an auth error. This includes existing CLI configs and running processes. * The sandboxes and Agents that the key created stay. * `boat api-key usage ` still shows their totals. # Create a scoped API key Source: https://docs.boat.dev/api/reference/account/create-scoped-api-key openapi/boat-v1.yaml POST /api-keys/scoped Create an API key limited to some actions, sandboxes or environments, with an expiry. Same as boat api-key create. # Create webhook Source: https://docs.boat.dev/api/reference/account/create-webhook openapi/boat-v1.yaml POST /webhooks Create an account-wide sandbox lifecycle webhook endpoint. # Delete webhook Source: https://docs.boat.dev/api/reference/account/delete-webhook openapi/boat-v1.yaml DELETE /webhooks/{webhookId} Delete a sandbox lifecycle webhook endpoint and its queued deliveries. # Get account data-retention policy Source: https://docs.boat.dev/api/reference/account/get-account-data-retention-policy openapi/boat-v1.yaml GET /account/data-retention Read the account zero-data-retention setting. # Get API key usage Source: https://docs.boat.dev/api/reference/account/get-api-key-usage openapi/boat-v1.yaml GET /api-keys/{apiKeyId}/usage Get the 30-day request total and created sandboxes and Agents for one API key. # Get account limits Source: https://docs.boat.dev/api/reference/account/get-boat-limits openapi/boat-v1.yaml GET /limits Check remaining machine starts, included VM time, the wallet, overage prices, access readiness, and concurrent-sandbox capacity for the wallet a create would bill: the `org` / `X-Boat-Org` you pass (id or name), else the account's active wallet, else personal. The response carries `teamId` when an organization wallet was read. # Get account secrets (legacy) Source: https://docs.boat.dev/api/reference/account/get-boat-secrets-setup openapi/boat-v1.yaml GET /secrets Returns the environment variables and secret files configured for sandboxes. # Get current user Source: https://docs.boat.dev/api/reference/account/get-current-boat-user openapi/boat-v1.yaml GET /me Returns GitHub identity for the authenticated Boat account. # Get deletion operation Source: https://docs.boat.dev/api/reference/account/get-deletion-operation openapi/boat-v1.yaml GET /deletion-operations/{operationId} Poll an accepted sandbox or snapshot deletion operation. # Get OpenTelemetry export Source: https://docs.boat.dev/api/reference/account/get-opentelemetry-export openapi/boat-v1.yaml GET /telemetry Read the account's OTLP endpoint, header names, and last export result. # Get webhook Source: https://docs.boat.dev/api/reference/account/get-webhook openapi/boat-v1.yaml GET /webhooks/{webhookId} Get one sandbox lifecycle webhook endpoint without its signing secret. # List API keys Source: https://docs.boat.dev/api/reference/account/list-api-keys openapi/boat-v1.yaml GET /api-keys Lists API key metadata only. Raw key secrets are not returned after creation/rotation. Results include expiry and scope. A restricted API-key caller receives `apiKeys: []`; only an unrestricted account key or browser/CLI session receives the account inventory. Bearer header is unchanged; scope lives on the key. # List GitHub repositories Source: https://docs.boat.dev/api/reference/account/list-github-repositories-available-to-sandbox openapi/boat-v1.yaml GET /repos Returns GitHub repositories grouped by installation plus the current selected repositories for new Sandboxes. # List organizations Source: https://docs.boat.dev/api/reference/account/list-organizations openapi/boat-v1.yaml GET /orgs The wallets this account can bill: your personal account first, then every organization you belong to, each with its id and name. Either spelling works wherever an org is passed (`org`, `X-Boat-Org`, `teamId`). `active` marks the wallet new sandboxes bill when a request names none; change it with `PATCH /orgs/active`. # List webhooks Source: https://docs.boat.dev/api/reference/account/list-webhooks openapi/boat-v1.yaml GET /webhooks List account-wide sandbox lifecycle webhook endpoints. # Remove OpenTelemetry export Source: https://docs.boat.dev/api/reference/account/remove-opentelemetry-export openapi/boat-v1.yaml DELETE /telemetry Stop the export and remove the account's OTLP endpoint. # Revoke an API key Source: https://docs.boat.dev/api/reference/account/revoke-api-key openapi/boat-v1.yaml DELETE /api-keys/{apiKeyId} Turn off an API key at once. Sandboxes that the key created keep running. Same as boat api-key revoke. # Rotate an API key Source: https://docs.boat.dev/api/reference/account/rotate-api-key openapi/boat-v1.yaml POST /api-keys/{apiKeyId}/rotate Replace the secret of an API key. The old secret stops working and the new one shows once. Same as boat api-key rotate. # Rotate webhook signing secret Source: https://docs.boat.dev/api/reference/account/rotate-webhook-signing-secret openapi/boat-v1.yaml POST /webhooks/{webhookId}/rotate Replace a webhook signing secret and return the new secret once. # Select a repository Source: https://docs.boat.dev/api/reference/account/select-repository-for-sandboxes openapi/boat-v1.yaml POST /repos Idempotently selects one repository for the sandbox environment. Use `databaseId` from `GET /repos` as `repositoryId`; selecting an already-selected repository updates its `baseBranch`. # Set the active organization Source: https://docs.boat.dev/api/reference/account/set-active-organization openapi/boat-v1.yaml PATCH /orgs/active Set the wallet new sandboxes bill when a request names none, for this account on every client: the API, the CLI (`boat org switch` sets the same value) and the dashboard. Pass an organization id or name you belong to, or `personal` (or `null`) for your own account. `GET /limits` follows it. Sandboxes already running keep the wallet they were created with; leaving or deleting the organization resets the account to personal. # Set OpenTelemetry export Source: https://docs.boat.dev/api/reference/account/set-opentelemetry-export openapi/boat-v1.yaml PUT /telemetry Set or replace the account's OTLP endpoint and send a test export. # Update account data-retention policy Source: https://docs.boat.dev/api/reference/account/update-account-data-retention-policy openapi/boat-v1.yaml PATCH /account/data-retention Enable or disable account zero data retention using a sandbox session. # Update account secrets (legacy) Source: https://docs.boat.dev/api/reference/account/update-boat-secrets-setup openapi/boat-v1.yaml POST /secrets Save a new version of your account's sandbox environment variables and secret files. Omitted fields stay unchanged. Send an empty value to clear one. Running sandboxes keep their current version until you upgrade them. # Update organization settings Source: https://docs.boat.dev/api/reference/account/update-organization openapi/boat-v1.yaml PATCH /orgs/{org} The owner renames the organization with `name`. Requests that name the organization by its old name fail after the rename; its id does not change. The billing name on new invoices follows when it is still the organization name. If Stripe does not answer, the request fails with 502 and nothing changes. Owners and admins set whether new sandboxes of the organization start private (only their creator can use them) or shared (every member can use those that hold none of their creator's logins). The default is shared. Existing sandboxes keep their setting; their creators change it with `POST /sandboxes/{sandboxId}/share` and `POST /sandboxes/{sandboxId}/unshare`. A fork of a private sandbox is private. # Update webhook Source: https://docs.boat.dev/api/reference/account/update-webhook openapi/boat-v1.yaml PATCH /webhooks/{webhookId} Update a sandbox lifecycle webhook endpoint. # Attach to a detached command Source: https://docs.boat.dev/api/reference/agent/attach-command openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/commands/{processId}/stream Stream the output of a command started with detached: true as it writes it, until it ends. Reconnect with the offsets every 10 minutes to follow it with no time limit. # Add an SSH key Source: https://docs.boat.dev/api/reference/agent/configure-sandbox-ssh-key openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/sshkey Adds an OpenSSH public key to the running sandbox so the caller can SSH as user `user`. The response carries `machineIp`, which is the host to connect to on port 22. This is also how you reach your own machine from inside a sandbox without the CLI: authorize the key, then open a reverse tunnel with stock OpenSSH, and a port on your machine answers at `127.0.0.1:` inside the sandbox for as long as the ssh process runs. ```bash ssh -o ExitOnForwardFailure=yes -i ~/.ssh/id_ed25519 -N -R 7777:127.0.0.1:7777 user@ ``` `boat forward --reverse --local 7777` is the same tunnel with the key handling and redial done for you. # Get a download URL for a sandbox file Source: https://docs.boat.dev/api/reference/agent/create-download-url openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/files/download-url A short-lived signed URL the sandbox serves itself. GET it to download a file of any size. # Create a directory Source: https://docs.boat.dev/api/reference/agent/create-sandbox-folder openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/files/folder Create a directory in a sandbox, with its missing parents and optional permissions. # Get an upload URL for a sandbox file Source: https://docs.boat.dev/api/reference/agent/create-upload-url openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/files/upload-url A short-lived signed URL the sandbox serves itself. PUT a file of any size to it. # Delete a file Source: https://docs.boat.dev/api/reference/agent/delete-sandbox-file openapi/boat-v1.yaml DELETE /sandboxes/{sandboxId}/files Delete a sandbox file, or a directory and its contents with recursive=true. # Download a file Source: https://docs.boat.dev/api/reference/agent/download-sandbox-artifact openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/artifacts Download a file from a sandbox by its path, returned as a binary artifact. # Run a command Source: https://docs.boat.dev/api/reference/agent/execute-sandbox-command openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/commands Run a shell command in a sandbox and get stdout, stderr and the exit code. Default timeout 30 s, maximum 600 s. Stream the output or run it detached. # Expose a port on a public URL Source: https://docs.boat.dev/api/reference/agent/expose-a-port openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/host Give a port inside a sandbox a stable HTTPS URL on on.boat.dev, private with a token or public. Same as boat host. # Find text in files Source: https://docs.boat.dev/api/reference/agent/find-in-sandbox-files openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/files/find Find every line that contains a text or a regular expression, in all files under a sandbox directory. # Get a command from the history Source: https://docs.boat.dev/api/reference/agent/get-command openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/command-history/{commandId} Get one command's record: its text, mode, status, exit code and output size. # Get command status Source: https://docs.boat.dev/api/reference/agent/get-command-status openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/commands/{processId} Get the status and recent log output of a detached command running in a sandbox. Use tailBytes to limit how much log is returned. # Get the desktop URL Source: https://docs.boat.dev/api/reference/agent/get-desktop-streaming-url openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/desktop Create or fetch a secret-bearing desktop/noVNC URL for live computer-use visibility. Use `?vnc=1` for noVNC; a `provisioning: true` response means poll again. # Get prompt run status Source: https://docs.boat.dev/api/reference/agent/get-prompt-run-status openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/prompts/{promptId} Returns first-class status for a queued/running/finished prompt so clients do not infer completion from sandbox state and events. # Get file details Source: https://docs.boat.dev/api/reference/agent/get-sandbox-file-info openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/files/info Get the size, type, permissions and modification time of one sandbox file or directory. # Interrupt running work Source: https://docs.boat.dev/api/reference/agent/interrupt-running-agent-work openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/interrupt Interrupt running agent work. By default this stops **every** conversation on the sandbox. Pass `conversation` to stop just one, leaving the others running. See [Integrated agents](/integrated-agents). # List the command history Source: https://docs.boat.dev/api/reference/agent/list-command-history openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/command-history List the commands run in a sandbox in the last 90 days, newest first. Works while the sandbox is stopped. # List conversations Source: https://docs.boat.dev/api/reference/agent/list-sandbox-conversations openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/conversations Every conversation on the sandbox, most recently prompted first, with what you need to pick one: how many prompts it holds, whether a turn is running in it right now, the last harness and model it ran on, a preview of its last prompt, and `current`, the one a `POST /prompt` without `new` or `conversationId` would continue. Pass an `id` back as `conversationId` on `POST /prompt` to resume that thread, or as `conversation` on `POST /steer`, `POST /interrupt` and `GET /events` to scope those. See [Integrated agents](/integrated-agents). # List sandbox events Source: https://docs.boat.dev/api/reference/agent/list-sandbox-events openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/events Return Sandbox work, lifecycle, and progress events so product UIs can show what the sandbox is doing. A Sandbox runs many conversations in parallel; this streams **all** of them by default and every event carries a `conversationId`. Filter to one or more with `conversation`. Event payloads are extensible. Clients can long-poll this endpoint with `sort=asc` and a cursor to stream responses. Response events expose agent text, streaming partials via `data.is_streaming`, and tool calls/results via `data.tools`. When you poll, send the last `ETag` back in `If-None-Match`. An unchanged page answers `304 Not Modified` with no body. # List a directory Source: https://docs.boat.dev/api/reference/agent/list-sandbox-files openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/files/list List the files and directories in one sandbox directory, with size, permissions and modification time. # List sandbox processes Source: https://docs.boat.dev/api/reference/agent/list-sandbox-processes openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/processes List the processes in a running sandbox, or the last stored sample of a stopped one. # Move or rename a file Source: https://docs.boat.dev/api/reference/agent/move-sandbox-file openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/files/move Move or rename a sandbox file or directory, also between /home/user and /tmp. # Prompt the agent Source: https://docs.boat.dev/api/reference/agent/prompt-sandbox-agent openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/prompt Queue a natural-language work item for an agent harness (Codex, Claude Code, pi, OpenCode, or Prime Agent) inside the sandbox. Observe progress with `GET /sandboxes/{sandboxId}/events`. A Sandbox runs many conversations in parallel. Set `new: true` to start a fresh one, `conversationId` to continue a specific one, or omit both to continue the most-recently-active conversation; the response returns the `conversationId`. See [Integrated agents](/integrated-agents). # Read command logs Source: https://docs.boat.dev/api/reference/agent/read-command-logs openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/command-history/{commandId}/logs Read the stored stdout or stderr of a command from a byte offset. Works while the sandbox is stopped. # Read a file Source: https://docs.boat.dev/api/reference/agent/read-sandbox-file openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/files Read a file from a sandbox by its path, as UTF-8 text by default or base64 for binary content. # Replace text in files Source: https://docs.boat.dev/api/reference/agent/replace-in-sandbox-files openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/files/replace Replace every occurrence of a text in a list of sandbox files, with one result per file. # Search files by name Source: https://docs.boat.dev/api/reference/agent/search-sandbox-files openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/files/search Find the sandbox files and directories whose names match a glob pattern such as *.py. # Set file permissions Source: https://docs.boat.dev/api/reference/agent/set-sandbox-file-permissions openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/files/permissions Set the permission bits of a sandbox file or directory. # Steer a running turn (API) Source: https://docs.boat.dev/api/reference/agent/steer-a-running-turn openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/steer Send a new message to a turn that is already running, without losing what the agent is doing. This is what typing into a coding agent while it works does: the instruction is taken into account and the work continues. Where the harness has a native mid-turn primitive (Claude Code, Codex, pi, Prime Agent) nothing is interrupted and the response has `native: true`. Where it does not (OpenCode), Boat interrupts that turn and immediately continues the SAME conversation with the instruction, keeping the session and its memory, and the response has `native: false`. Refused with **409 `no_running_turn`** when the conversation has nothing in flight; queue work with `POST /prompt` instead. `error.details.reason` says why: `turn_ended` (with `error.details.lastTurn.status` and `.error` of the newest turn), `turn_not_started` (the turn is starting; retry in a moment), `no_turn`, `not_running` (the sandbox is not running) or `delivery_failed` (the sandbox did not accept the steer; check the turn before sending more work). The steer shows up in `GET /events` as a `steer` event. See [Integrated agents](/integrated-agents). # Stop a detached command Source: https://docs.boat.dev/api/reference/agent/stop-command openapi/boat-v1.yaml DELETE /sandboxes/{sandboxId}/commands/{processId} Stop a command started with detached: true, and every process it started. The response holds its final history record. # Write a file Source: https://docs.boat.dev/api/reference/agent/write-sandbox-file openapi/boat-v1.yaml PUT /sandboxes/{sandboxId}/files Write or overwrite a file in a sandbox at a given path, as UTF-8 text or base64-encoded binary content. # Add another API key to a credential Source: https://docs.boat.dev/api/reference/ai-credentials/add-credential-account openapi/boat-v1.yaml POST /credential-profiles/{profile}/accounts/{credential} Keep a second key ready to switch to. # Block or unblock sandbox AI access Source: https://docs.boat.dev/api/reference/ai-credentials/block-or-unblock-sandbox-ai-access openapi/boat-v1.yaml PUT /sandboxes/{sandboxId}/ai-access Refuse or accept a sandbox's AI placeholders again. # Create a credential profile Source: https://docs.boat.dev/api/reference/ai-credentials/create-credential-profile openapi/boat-v1.yaml POST /credential-profiles Create a personal or organization AI credential profile, empty or as a copy. # Delete a credential profile Source: https://docs.boat.dev/api/reference/ai-credentials/delete-credential-profile openapi/boat-v1.yaml DELETE /credential-profiles/{profile} Delete a profile that is not the default and that no environment names. # Forget an account of a credential Source: https://docs.boat.dev/api/reference/ai-credentials/forget-credential-account openapi/boat-v1.yaml DELETE /credential-profiles/{profile}/accounts/{credential}/{account} Delete an account; the one in use is replaced by another first. # Get AI credentials proxy Source: https://docs.boat.dev/api/reference/ai-credentials/get-ai-credentials-proxy openapi/boat-v1.yaml GET /ai-proxy Read the AI credentials proxy switch and its price. # Get AI usage Source: https://docs.boat.dev/api/reference/ai-credentials/get-ai-usage openapi/boat-v1.yaml GET /ai-usage Proxied AI usage of every sandbox of the wallet in scope. # Get sandbox AI usage Source: https://docs.boat.dev/api/reference/ai-credentials/get-sandbox-ai-usage openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/ai-usage Proxied AI usage of one sandbox, per day, credential and model. # List the accounts of a credential Source: https://docs.boat.dev/api/reference/ai-credentials/list-credential-accounts openapi/boat-v1.yaml GET /credential-profiles/{profile}/accounts/{credential} Every account of one credential, the one in use first. # List credential profiles Source: https://docs.boat.dev/api/reference/ai-credentials/list-credential-profiles openapi/boat-v1.yaml GET /credential-profiles List the AI credential profiles you can use, yours and your organizations'. # Remove a credential profile credential Source: https://docs.boat.dev/api/reference/ai-credentials/remove-credential-profile-credential openapi/boat-v1.yaml DELETE /credential-profiles/{profile}/keys/{credential} Remove one API key or sign-in from a profile. # Remove a custom API Source: https://docs.boat.dev/api/reference/ai-credentials/remove-custom-api openapi/boat-v1.yaml DELETE /credential-profiles/{profile}/custom-apis/{name} Remove one custom API from a profile. # Set a credential profile API key Source: https://docs.boat.dev/api/reference/ai-credentials/set-credential-profile-api-key openapi/boat-v1.yaml PUT /credential-profiles/{profile}/keys/{credential} Set one API key in a profile. # Set a custom API Source: https://docs.boat.dev/api/reference/ai-credentials/set-custom-api openapi/boat-v1.yaml PUT /credential-profiles/{profile}/custom-apis/{name} Add or replace a custom API: a secret and its HTTPS base URL. # Switch a credential to another account Source: https://docs.boat.dev/api/reference/ai-credentials/switch-credential-account openapi/boat-v1.yaml PUT /credential-profiles/{profile}/accounts/{credential}/{account}/active Out of credits on one account: every sandbox on the profile moves to another one at once. # Turn the AI credentials proxy on or off Source: https://docs.boat.dev/api/reference/ai-credentials/turn-the-ai-credentials-proxy-on-or-off openapi/boat-v1.yaml PUT /ai-proxy Give sandboxes placeholder keys instead of real keys, or stop. # Update a credential profile Source: https://docs.boat.dev/api/reference/ai-credentials/update-credential-profile openapi/boat-v1.yaml PUT /credential-profiles/{profile} Rename a profile, or make it its owner's default. # Connect GitHub for CI Source: https://docs.boat.dev/api/reference/ci/connect-ci-github openapi/boat-v1.yaml POST /ci/connect Get a link to install the boat CI GitHub App or link an existing installation. # Get CI job Source: https://docs.boat.dev/api/reference/ci/get-ci-job openapi/boat-v1.yaml GET /ci/jobs/{jobId} One job's state, wait, run time, cost, sandbox and error. # Get CI job log Source: https://docs.boat.dev/api/reference/ci/get-ci-job-log openapi/boat-v1.yaml GET /ci/jobs/{jobId}/logs One job's log from GitHub, up to the last 1 MB. # Get CI overview Source: https://docs.boat.dev/api/reference/ci/get-ci-overview openapi/boat-v1.yaml GET /ci Setup steps, jobs boat did not run, linked GitHub accounts and repositories, 7-day stats and jobs. # Set CI public repositories Source: https://docs.boat.dev/api/reference/ci/set-ci-public-repos openapi/boat-v1.yaml POST /ci/public Turn jobs from a linked account's public repositories on or off, and limit them to listed GitHub users. # Add environment repository Source: https://docs.boat.dev/api/reference/environments/add-environment-repo openapi/boat-v1.yaml POST /environments/{environmentId}/repos Adds a repository (or updates its base branch) by database id from the repository list. Mints a new immutable version. # Create an environment Source: https://docs.boat.dev/api/reference/environments/create-sandbox-environment openapi/boat-v1.yaml POST /environments Create a new named environment. It starts on version 1 with all fine-grained flags on and `safeForThirdParties` off. # Remove environment repository Source: https://docs.boat.dev/api/reference/environments/delete-environment-repo openapi/boat-v1.yaml DELETE /environments/{environmentId}/repos/{repositoryId} Removes one repository from the environment's selection. Mints a new immutable version. # Remove environment secret file Source: https://docs.boat.dev/api/reference/environments/delete-environment-secret-file openapi/boat-v1.yaml DELETE /environments/{environmentId}/secret-files Removes the secret file at `path`. Mints a new immutable version. # Remove environment variable Source: https://docs.boat.dev/api/reference/environments/delete-environment-var openapi/boat-v1.yaml DELETE /environments/{environmentId}/vars/{key} Removes a single variable. Mints a new immutable version. # Delete an environment Source: https://docs.boat.dev/api/reference/environments/delete-sandbox-environment openapi/boat-v1.yaml DELETE /environments/{environmentId} Soft-deletes an environment. The default environment cannot be deleted, and at least one environment is always kept. # List environments Source: https://docs.boat.dev/api/reference/environments/list-sandbox-environments openapi/boat-v1.yaml GET /environments Returns every non-deleted sandbox environment with its latest-version flags, contents, and per-version sandbox usage. A default environment named `base` is created on first access if none exists. # Write environment secret file Source: https://docs.boat.dev/api/reference/environments/set-environment-secret-file openapi/boat-v1.yaml PUT /environments/{environmentId}/secret-files Adds or replaces a single secret file by path. Mints a new immutable version. # Set environment variable Source: https://docs.boat.dev/api/reference/environments/set-environment-var openapi/boat-v1.yaml PUT /environments/{environmentId}/vars/{key} Sets or replaces a single variable without reading or rewriting the rest. Mints a new immutable version. # Update an environment Source: https://docs.boat.dev/api/reference/environments/update-sandbox-environment openapi/boat-v1.yaml PUT /environments/{environmentId} Rename, set as default, and/or edit flags and contents. Any flag or content change mints a new immutable version; existing sandboxes stay on their pinned version until you call upgrade. # Upgrade sandboxes to the latest environment version Source: https://docs.boat.dev/api/reference/environments/upgrade-sandbox-environment openapi/boat-v1.yaml POST /environments/{environmentId}/upgrade Repoints the caller's active sandboxes from an older version of this environment to its latest version, scrubbing any owner secrets the new version drops and hot-pushing the new config. # Create sandbox Source: https://docs.boat.dev/api/reference/sandboxes/create-sandbox openapi/boat-v1.yaml POST /sandboxes Provision a new cloud computer. Store the returned `sandbox.id` with your product job/session record. Send an `Idempotency-Key` header to make this call safe to retry after a lost response without creating a second billable sandbox. # Fork sandbox Source: https://docs.boat.dev/api/reference/sandboxes/fork-sandbox openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/fork Provision a new sandbox from an existing one. Send an `Idempotency-Key` header to make this call safe to retry after a lost response without creating a second billable fork. # Get sandbox Source: https://docs.boat.dev/api/reference/sandboxes/get-sandbox openapi/boat-v1.yaml GET /sandboxes/{sandboxId} Poll this endpoint after create, stop, resume, or fork operations. # Get sandbox usage Source: https://docs.boat.dev/api/reference/sandboxes/get-sandbox-usage openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/usage Machine time one sandbox consumed and its cost, over its life or a billing window, for per-sandbox billing of your own users. # Get a stop Source: https://docs.boat.dev/api/reference/sandboxes/get-stop openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/stops/{stopId} Returns one stop of this sandbox by the id that `POST /sandboxes/{sandboxId}/stop` returned. Old stops stay readable after a resume or a later stop. Returns 404 when the id is unknown or belongs to another sandbox. # List sandboxes Source: https://docs.boat.dev/api/reference/sandboxes/list-sandboxes openapi/boat-v1.yaml GET /sandboxes Your sandboxes. In an organization's scope (the active wallet, `org`, or `X-Boat-Org`) the list also holds every sandbox that organization pays for, whoever created it; `createdBy` and `access` say whose it is and what you may do with it. An unknown query parameter is refused with `400 invalid_query`, which names it. # Delete sandbox Source: https://docs.boat.dev/api/reference/sandboxes/permanently-delete-sandbox-data openapi/boat-v1.yaml DELETE /sandboxes/{sandboxId} Confirm and accept irreversible background deletion of a sandbox. # Recover sandbox Source: https://docs.boat.dev/api/reference/sandboxes/recover-sandbox openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/recover Deprecated. Power-cycle the machine of a sandbox that stopped responding, without touching its disk. > [!WARNING] > > Deprecated. boat removes this endpoint soon. After a kernel crash, the machine restarts by itself in about 15 seconds. If a sandbox still does not answer, stop it with `force`, then resume it. You lose what was written after the last good snapshot. Read [A sandbox does not answer](/troubleshooting#a-sandbox-does-not-answer). # Resume sandbox Source: https://docs.boat.dev/api/reference/sandboxes/resume-sandbox openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/resume Resume a stopped sandbox from its snapshot, optionally with a different environment or time-to-live. # Share sandbox with the organization Source: https://docs.boat.dev/api/reference/sandboxes/share-sandbox openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/share Let every member of the organization that pays for this sandbox use it. A sandbox that holds none of your personal logins is shared at once. A sandbox that holds them: your personal logins (GitHub token, Claude and Codex logins, environment secrets, the sandbox's own CLI key) are never pushed to it again and are wiped off its disk at its next start, so a teammate never acts as you. Files you wrote stay. The wipe is one-way: the sandbox stays like a `noEnv` sandbox from then on. A running sandbox stays `view` for the organization until you stop and resume it (`restartRequired`): its running programs hold your logins in memory. Teammates never read history recorded before the share. Only the person who created the sandbox can share it, and only a sandbox billed to an organization. Sharing an already shared sandbox is a no-op. Undo with `POST /sandboxes/{sandboxId}/unshare`. # Stop sandbox Source: https://docs.boat.dev/api/reference/sandboxes/stop-and-archive-sandbox openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/stop Stop active work and archive/snapshot the sandbox for later resume or fork. A stop always saves the sandbox's disk first. If that save is failing, the stop is refused and the sandbox keeps running so your work is not discarded, we retry automatically and email you. You are not billed for time spent in that state. The stop is an operation: the response and the sandbox carry it as `stop`, with an `id` and a `status`. Poll `GET /sandboxes/{sandboxId}` until `stop.status` is `completed`. A failed attempt shows `failing` with its `error` and is retried until the sandbox archives; commands and prompts you send meanwhile do not cancel it. Only a resume ends it early (`superseded`). Calling stop again while one is pending returns the same `id`. Set `force: true` to stop anyway, keeping the last successful snapshot and losing everything written since then. This is irreversible; only reach for it after a stop has already failed. A force on a stop that is already pending escalates that stop. A stop never fails because the sandbox is already stopping or stopped: you get `202` with the stop in progress, or `200` with the last stop once the sandbox is stopped. `statusUrl` is the path that reads the stop. # Make an organization sandbox private Source: https://docs.boat.dev/api/reference/sandboxes/unshare-sandbox openapi/boat-v1.yaml POST /sandboxes/{sandboxId}/unshare Make a shared organization sandbox private again, at once. Only you can then use it. Teammates still see it in their list and can stop it. Their SSH keys are removed from the running machine. Nothing on the sandbox changes: files, installs and its environment stay. Undo with `POST /sandboxes/{sandboxId}/share`. Only the person who created the sandbox can make it private, and only a sandbox billed to an organization. Making a private sandbox private is a no-op. # Update sandbox Source: https://docs.boat.dev/api/reference/sandboxes/update-sandbox openapi/boat-v1.yaml PATCH /sandboxes/{sandboxId} Update a sandbox's name, time-to-live, or the subdomain it is hosted on. # Share a saved snapshot Source: https://docs.boat.dev/api/reference/snapshots/create-snapshot-share openapi/boat-v1.yaml POST /saved-snapshots/{name}/shares Make a secret code that lets any Boat account create a sandbox from this saved snapshot (`boat snapshot share ` in the CLI). The response shows the code once; Boat stores only a hash. Re-saving the name changes what the code deploys. Removing the name removes its codes. Everything on the disk is shared, so do not keep secrets in files on it. Needs `snapshot.write`. # Delete all snapshots of a sandbox Source: https://docs.boat.dev/api/reference/snapshots/delete-sandbox-snapshots openapi/boat-v1.yaml DELETE /sandboxes/{sandboxId}/snapshots Delete every ordinary snapshot of one sandbox and keep the sandbox and its saved snapshots. Same as boat snapshot delete --all. # Delete a saved snapshot Source: https://docs.boat.dev/api/reference/snapshots/delete-saved-snapshot openapi/boat-v1.yaml DELETE /saved-snapshots/{name} Remove a saved snapshot and release its storage (`boat snapshot rm ` in the CLI). Sandboxes already deployed from it are unaffected. # Get the latest snapshot of a sandbox Source: https://docs.boat.dev/api/reference/snapshots/get-latest-sandbox-snapshot openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/snapshots/latest Return the most recent completed snapshot for this sandbox, or `null` if it has none. # Get a saved snapshot Source: https://docs.boat.dev/api/reference/snapshots/get-saved-snapshot openapi/boat-v1.yaml GET /saved-snapshots/{name} Get a saved snapshot and its status. Poll this after saving one until the status settles at ready or failed. # Get snapshot download Source: https://docs.boat.dev/api/reference/snapshots/get-snapshot-download openapi/boat-v1.yaml GET /snapshots/{snapshotId}/download Return time-limited signed URLs for every chunk needed to reconstruct the sandbox filesystem at this snapshot (the full chain, base through this generation), plus the inventory. Download the chunks and reassemble them as described by `reconstruct`. The `boat snapshot pull` CLI command does this for you. A snapshot whose older layers were cleaned up answers 409 `snapshot_compacted`: read its files from `GET /snapshots/{snapshotId}/files` instead, which `boat snapshot pull` does for you too. # Download a file or folder from a snapshot Source: https://docs.boat.dev/api/reference/snapshots/get-snapshot-file openapi/boat-v1.yaml GET /snapshots/{snapshotId}/files Stream a single file's bytes, or a folder subtree as a tar archive, directly out of a snapshot, the sandbox can be stopped or archived; the machine is never contacted. Use `GET /snapshots/{snapshotId}/tree` to list paths, then pass one here. Paths are relative to the snapshot root (same space as `tree` entries; docker volumes under `__dockervol__/`). An empty or `/` path downloads the whole snapshot as a tar. Folder responses set `X-Snapshot-File-Count`, `X-Snapshot-Total-Size-Bytes` and `X-Snapshot-Skipped-Base-Image-Files` headers; both response shapes set `X-Snapshot-Entry-Kind` (`file` or `dir`). File responses accept a single `Range: bytes=` header and answer 206 with `Content-Range`, so large files can be downloaded in parts and resumed. # Get snapshot file tree Source: https://docs.boat.dev/api/reference/snapshots/get-snapshot-tree openapi/boat-v1.yaml GET /snapshots/{snapshotId}/tree List the files and folders captured in a snapshot, with sizes. Returns a flat list of entries you can render as a tree. # List snapshots of a sandbox Source: https://docs.boat.dev/api/reference/snapshots/list-sandbox-snapshots openapi/boat-v1.yaml GET /sandboxes/{sandboxId}/snapshots List visible completed snapshots for one sandbox with uncapped cursor pagination. # List saved snapshots Source: https://docs.boat.dev/api/reference/snapshots/list-saved-snapshots openapi/boat-v1.yaml GET /saved-snapshots List your saved snapshots, newest first. An unknown query parameter is refused with `400 invalid_query`, which names it. # List share codes of a saved snapshot Source: https://docs.boat.dev/api/reference/snapshots/list-snapshot-shares openapi/boat-v1.yaml GET /saved-snapshots/{name}/shares List the share codes of a saved snapshot, active and revoked (`boat snapshot shares ` in the CLI). The full codes are not returned. Needs `snapshot.read`. # List snapshots Source: https://docs.boat.dev/api/reference/snapshots/list-snapshots openapi/boat-v1.yaml GET /snapshots List visible completed snapshots across all of your sandboxes using immutable ownership attribution. Pinned, deletion-scheduled, and privacy-fenced sandbox snapshots are omitted. Follow `nextCursor` through the complete history; there is no hidden 500-snapshot cap. An unknown query parameter is refused with `400 invalid_query`, which names it. # Delete snapshot Source: https://docs.boat.dev/api/reference/snapshots/permanently-delete-snapshot-data openapi/boat-v1.yaml DELETE /snapshots/{snapshotId} Confirm and accept irreversible background deletion of a snapshot. # Revoke a share code Source: https://docs.boat.dev/api/reference/snapshots/revoke-snapshot-share openapi/boat-v1.yaml DELETE /saved-snapshots/{name}/shares/{shareId} Revoke a share code (`boat snapshot unshare ` in the CLI). The code stops creating new sandboxes. Sandboxes already created from it keep their own copy. Needs `snapshot.write`. # Save a saved snapshot Source: https://docs.boat.dev/api/reference/snapshots/save-saved-snapshot openapi/boat-v1.yaml POST /saved-snapshots Freeze a sandbox's current state under a name (`boat snapshot ` in the CLI). Answers `202` immediately with the snapshot in `saving`; a running sandbox takes a fresh capture first, which can run minutes. Poll `GET /saved-snapshots/{name}` until the status settles at `ready` or `failed`. Reusing one of your existing names replaces that snapshot's artifact once the new save is ready. # API overview Source: https://docs.boat.dev/api/v1 The boat HTTP API: base URL, bearer authentication, a create-run-stop example, errors, limits and retries, pagination, idempotency, and every endpoint by group. The base URL is `https://boat.dev/api/v1`. Send your API key as a bearer token. For typed clients, use the [Python SDK](/sdks/python) or the [TypeScript SDK](/sdks/typescript). > [!NOTE] > > Used the `box` API before? Read [Migrating from Box](/migrating-from-box). ## Quick path: create, run, stop ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} export BOAT_API_BASE="https://boat.dev/api/v1" export BOAT_API_KEY="boat_..." # from `boat api-key create` or the dashboard # 1. Create a sandbox (auto-stop after 1 hour) SANDBOX_ID=$(curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"ttlSeconds":3600}' | jq -r '.sandbox.id') # 2. Run a command. It waits up to 60 s while the sandbox starts. curl -sS -X POST "$BOAT_API_BASE/sandboxes/$SANDBOX_ID/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"echo hi && uname -a"}' | jq '{exitCode, stdout}' # 3. Stop it. Boat saves the disk and stops billing. curl -sS -X POST "$BOAT_API_BASE/sandboxes/$SANDBOX_ID/stop" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ## Recommended flow 1. Create a boat API key with `boat api-key create --preset ci` or in the dashboard. 2. Create a sandbox with `POST /sandboxes`. To continue earlier work, resume or fork a sandbox instead. 3. Poll `GET /sandboxes/{sandboxId}` until the state is `ready`, `idle` or `running`. 4. Run code with `POST /sandboxes/{sandboxId}/commands`. Send `stream: true` for live output, or `detached: true` for a long job. 5. To give work to an integrated agent, send `POST /sandboxes/{sandboxId}/prompt`. Read `GET /sandboxes/{sandboxId}/events` while it runs. 6. To expose a port, send `POST /sandboxes/{sandboxId}/host`. To watch the screen, send `POST /sandboxes/{sandboxId}/desktop`. 7. Stop, resume, fork or delete the sandbox as your retention policy requires. The API does all that the boat CLI does, except billing, the wallet, seats and plans. For those, use `boat billing`, `boat wallet` or the dashboard. To run a high-frequency control loop, run your own daemon in the sandbox. See [the daemon pattern](/platform-guide/agents#bring-your-own-harness-the-daemon-pattern). ## Authentication Send a boat API key as a bearer token on each request: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "https://boat.dev/api/v1/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` * New keys start with `boat_`. Keys that start with `box_` still work. * Create, rotate and revoke keys with `boat api-key`, the dashboard, or the [API key endpoints](#account-and-api-keys). See [API keys](/api-keys). * A per-sandbox key works only on its sandbox. For reads across the account, use an account key. * `PATCH /account/data-retention` refuses API keys. It needs a browser sign-in session. > [!WARNING] > > Keep API keys and desktop URLs secret. Desktop and VNC URLs can contain access tokens. Redact them before you log or store them. ## Try it (playground) Each reference page has a **Try it** panel. * It sends real requests to production. * Paste a `boat_...` key. Use a [scoped key](/api-keys/scopes) with a short expiry. * A create, fork or resume starts a sandbox that bills your account. Stop or delete it when you are done. ## Response envelope Each JSON response has `ok` and `type`: ```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}} { "ok": true, "type": "sandbox.list", "sandboxes": [] } ``` | Field | Description | | - | - | | `ok` | `true` for success, `false` for failure. | | `type` | Stable response discriminator, such as `sandbox.list`, `sandbox.created`, `sandbox.stopping` or `prompt.queued`. An error has `type: "sandbox.error"`. This is not the `sandbox.error` [webhook event](/webhooks). | ## Error model The HTTP status is the primary signal. The body has a structured envelope: ```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}} { "ok": false, "type": "sandbox.error", "status": 409, "code": "provider_not_configured", "message": "Prompting is locked until Codex is configured on the Agents page.", "error": { "code": "provider_not_configured", "message": "Prompting is locked until Codex is configured on the Agents page.", "status": 409, "details": { "provider": "codex", "setupUrl": "https://boat.dev/dashboard?tab=agents" } }, "requestId": "req_..." } ``` | Status | Typical codes | What to do | | - | - | - | | `400` | `invalid_json`, `prompt_required`, `provider_required`, `invalid_name`, `no_changes`, `invalid_path`, `invalid_timeout`, `invalid_env`, `unknown_environment`, `trial_auto_stop_required`, `fast_mode_not_supported` | Fix the request. | | `400` | `invalid_query` | A list call got a query parameter that it does not know. Remove it. | | `400` | `machine_not_running` (desktop, browser, port hosting, SSH key) | The sandbox has no running machine. Resume it, then retry. | | `401` | `unauthorized` | Send a valid bearer token. | | `402` | `billing_required`, `team_member_cap_reached` | Send the user to the returned billing URL. Or ask the organization owner to raise the member's usage cap. | | `403` | `trial_machine_class_not_allowed`, `org_suspended` | The size needs a paid plan, or the organization wallet is suspended. See [Free trial](/free-trial). | | `404` | `not_found`, `snapshot_not_found` | The sandbox, key or saved snapshot does not exist. Refresh your local state. | | `413` | `file_too_large` | A file read is above 5 MiB. Get a link with `POST /sandboxes/{sandboxId}/files/download-url`. | | `409` | `account_not_ready`, `provider_not_configured`, `sandbox_not_promptable`, `resume_failed`, `fork_failed`, `sandbox_resuming`, `sandbox_stopping`, `sandbox_securing`, `snapshots_disabled`, `idempotency_in_progress`, `idempotency_key_reused` | Resolve the prerequisite or the state conflict. | | `409` | `sandbox_running_stop_first` | You asked a running sandbox to resume with a new size, environment or `noEnv`. Stop it, then resume with the change. | | `409` | `machine_not_running`, `sandbox_starting`, `sandbox_not_ready` (commands, files, processes) | See [Commands, files and processes](#commands-files-and-processes). | | `429` | `rate_limited`, `limit_reached`, `member_limit_reached`, `trial_compute_limit_reached`, `IP_RATE_LIMIT_EXCEEDED` | A limit is full. See [Limits and retries](#limits-and-retries). | | `500` | `http_500` and other `*_failed` codes | Retry idempotent calls with jitter. Give the `requestId` when you contact support. | | `502` | `sandbox_direct_failed` | See [Commands, files and processes](#commands-files-and-processes). | | `503` | `no_ready_machine`, `out_of_capacity`, `browser_not_ready`, `ssh_host_key_unavailable` | Retry after the `retryAfterSeconds` in the body, or after a few seconds. | ### Commands, files and processes These calls go to the machine of the sandbox: * `POST /sandboxes/{sandboxId}/commands` * `GET` and `PUT /sandboxes/{sandboxId}/files` * The process calls A command sent while the sandbox starts (for example right after a resume) waits up to 60 seconds. It fails only if the sandbox is still not ready after that. | Status | Code | Retryable | Meaning | | - | - | - | - | | `409` | `machine_not_running` | No | The sandbox has no machine. It is stopped, or it never started. Resume it, wait until `GET` reports `ready`, `idle` or `running`, then retry. | | `409` | `sandbox_starting` | Yes | The sandbox was still starting after 60 seconds. Retry every few seconds. | | `409` | `sandbox_not_ready` | No | The sandbox is in a state that cannot run commands, such as `error` or `archived`. Resume it first. | | `502` | `sandbox_direct_failed` | See `error.details.retryable` | The machine did not complete the call. When `retryable` is `true`, send the call again. A file read or write gives the same result again. A command with message `sandbox_restoring` did not run. A command with a different message possibly ran: check its effect before you send it again. When `retryable` is `false`, the command can still be running. Do not run it again without a check. | | `502` | `sandbox_direct_failed` with message `sandbox_restoring` | Yes | The sandbox mounts its files in the first seconds of a resume or fork. Retry after 1-3 seconds. | The body has the flag in `error.details.retryable`: ```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}} { "ok": false, "type": "sandbox.error", "status": 502, "code": "sandbox_direct_failed", "message": "sandbox_restoring", "error": { "code": "sandbox_direct_failed", "status": 502, "details": { "retryable": true, "message": "sandbox_restoring" } } } ``` A synchronous command times out after 30 seconds by default. Set `timeoutSeconds` up to 600. For a server or a longer job, send `"detached": true`, then [attach](/long-running-tasks/background-commands#attach-to-a-background-process) to its output. A detached command has no time limit. The SDK helper `run_command` / `runCommand` does both steps. ## Limits and retries The full list of limits per plan is on [Limits](/limits). The ones that a program hits: | Plan | Starts (create, fork, resume) per minute / hour / day | Sandboxes at once | | - | - | - | | \$20 | 12 / 60 / 200 | 100 | | \$100 | 30 / 210 / 840 | 300 | | \$500 | 65 / 420 / 1,680 | 1,000 | | \$2000 | 90 / 600 / 2,400 | 2,000 | | [Free trial](/free-trial) | 5 / 25 / 75 | 2 | | Limit hit | Error | | - | - | | Starts | `429 rate_limited` | | Sandboxes at once | `429 limit_reached` | | More than 10,000 HTTP requests in 60 seconds from one IP address (an open stream counts once) | `429` with `code: IP_RATE_LIMIT_EXCEEDED` | Organization limits grow with the seats. Read [Seats](/organizations/seats-and-limits#seats). * Every `429` sends a `Retry-After` header in seconds. The body also carries the wait. * Every answer carries the IP limit: `RateLimit-Policy: "ip";q=10000;w=60` and `RateLimit: "ip";r=;t=60`. * Create, resume and fork answers also carry your start limits: policies `starts-minute`, `starts-hour` and `starts-day`. Read [Limits and errors](/limits#retry-rules). * `rate_limited` names the `window` (`minute`, `hour` or `day`) and the `limit`. The `starts` object shows what remains in each window. * `IP_RATE_LIMIT_EXCEEDED` carries `retryAfter` in seconds. * A `503` carries `retryAfterSeconds`. * A refused start does not count against your start limits. * Check before a batch: `GET /limits` returns `canStart` and `starts.minute.remaining`. Pace a batch of starts to the minute limit. A retry loop does not help against an hour or day limit: ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import time from boat_sdk.exceptions import ApiException def create_with_backoff(boat, request, attempts=6): for attempt in range(attempts): try: return boat.create(create_sandbox_request=request) except ApiException as exc: if exc.status not in (429, 503): raise time.sleep(min(60, 2 ** attempt)) raise RuntimeError("start limit still full") ``` ## Pagination List endpoints (`GET /sandboxes`, `GET /snapshots`, `GET /sandboxes/{sandboxId}/events`, `GET /repos` and others) use a cursor. * `limit`: 1 to 200 items. The default is 100. * `sort`: `desc` (newest first, the default) or `asc`. * The response has `pageInfo`: `nextCursor`, `hasMore` and `limit`. * To read the next page, send `cursor=`. Stop when `hasMore` is `false`. * `GET /sandboxes` also filters by `namePrefix`, `name` (exact match), `label=key=value` and `state`. * `GET /saved-snapshots` also filters by `namePrefix` and `name`. * A query parameter that the list does not know returns `400 invalid_query`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} cursor="" while :; do page=$(curl -sS "$BOAT_API_BASE/sandboxes?limit=200${cursor:+&cursor=$cursor}" \ -H "Authorization: Bearer $BOAT_API_KEY") echo "$page" | jq -r '.sandboxes[].id' [ "$(echo "$page" | jq -r '.pageInfo.hasMore')" = "true" ] || break cursor=$(echo "$page" | jq -r '.pageInfo.nextCursor') done ``` ## Idempotent sandbox creation `POST /sandboxes` and `POST /sandboxes/{sandboxId}/fork` each make a new sandbox that bills when it succeeds. A response can get lost, for example on a timeout or a `5xx` after boat accepted the sandbox. Then you do not know if you can retry. To make create and fork safe to retry, send an `Idempotency-Key` header. Use your own value that is unique in your account, for example a UUID. 1. The first request creates the sandbox and links it to the key. 2. Each retry with the **same account, key and request body** returns that same sandbox. It does not create a second sandbox that bills. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Idempotency-Key: 6f9619ff-8b86-d011-b42d-00cf4fc964ff" \ -H "Content-Type: application/json" \ -d '{"from":"web-stack","noEnv":true,"ttlSeconds":1800}' ``` | Situation | Result | | - | - | | Retry after a lost `202` or a `5xx` | The same key returns the original sandbox. | | Retry while the first sandbox is still being created | `409 idempotency_in_progress`. Retry shortly with the same key. | | Same key, different request body | `409 idempotency_key_reused`. | | Create that failed before the sandbox existed | The key releases within about 2 minutes, so a retry can create the sandbox. | boat keeps keys for 24 hours. A key belongs to your account, so two accounts can use the same value. Without the header, create and fork are not idempotent. In the SDKs, pass `idempotency_key=` (Python) or `idempotencyKey` (TypeScript) to `create` and `fork`. ## Sandbox lifecycle The API reports a stopped sandbox as `archived`. The CLI shows the same state as `stopped`. | State | Meaning | Client behavior | | - | - | - | | `provisioning`, `provisioned`, `cloning` | The sandbox is being created or prepared. | Poll `GET /sandboxes/{sandboxId}`. A command sent now waits up to 60 seconds. | | `ready`, `idle` | The sandbox accepts commands, prompts and access. | Run commands, prompt, open the desktop, SSH. | | `running` | An integrated agent is working. | Read events. Commands also work. | | `archiving` | The stop is in progress: boat saves the disk. | Poll until `archived`. | | `archived` | The sandbox is stopped. Its disk is in a snapshot. | Resume or fork. | | `error` | Start or runtime failed. | Resume or fork it, or delete it. See [Troubleshooting](/troubleshooting). | > [!NOTE] > > `idle` and `running` show only work queued with `POST /sandboxes/{sandboxId}/prompt`. Processes that you start yourself do not change the state. A sandbox can show `idle` while your own program works inside it. ## Providers, models and reasoning `POST /sandboxes/{sandboxId}/prompt` runs work through one of 7 agent harnesses (providers): | Provider | Aliases | Notes | | - | - | - | | `codex` | | OpenAI Codex models | | `claude-code` | `claude` | Claude Code models | | `pi` | | Multi-model: Anthropic, OpenAI and OpenRouter or llmgateway models | | `opencode` | | Multi-model | | `prime-agent` | `prime` | Multi-model | | `kimi` | `kimi-code` | Kimi Code CLI: Kimi models (subscription or Moonshot API key) | | `mistral` | | Mistral Vibe: Mistral models (subscription or Mistral API key) | `provider` is optional. Without it, boat uses the harness saved on the dashboard (Agents & Proxying). **Models and reasoning efforts change over time.** Get them from the live catalog. Do not hardcode lists. * `GET /provider-models` returns each model of each provider and the `reasoningEffort` levels that it accepts: `none`, `low`, `medium`, `high`, `xhigh`, `max`. Some models accept none. * `boat prompt --help` prints the same catalog. * `pi`, `opencode` and `prime-agent` also accept routed model ids like `openrouter:anthropic/claude-sonnet-4.5`. * Without `model`, boat uses the default saved on the dashboard for that harness. To run a prompt in fast mode, set `fast: true`. The model stays the same and answers faster. The provider bills it at its higher fast rate. Only models with `"fastMode": true` in `GET /provider-models` accept it. Other models return `400 fast_mode_not_supported`. Before the first prompt, connect a key or a subscription on the dashboard (Agents & Proxying). Without it, the API returns `409 provider_not_configured` with a setup URL. > [!NOTE] > > A sandbox runs **many conversations in parallel**. `POST /prompt` takes `new` or `conversationId` and returns the `conversationId`. `GET /events` and `POST /interrupt` take a `conversation` filter. See [Integrated agents](/integrated-agents). ## Request examples These examples are raw HTTP. Each feature page has the CLI, TypeScript and Python form: [Snapshots](/snapshots), [Environments](/environments), [Webhooks](/webhooks), [Data retention](/data-retention), [Desktop](/desktop-streaming), [Public URLs](/hosting). The examples use the variables from [Quick path](#quick-path-create-run-stop). Create a sandbox without auto-stop: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"ttlSeconds":null}' ``` Read the state: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/sandboxes/$SANDBOX_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" | jq -r '.sandbox.state' ``` Stream the output of a command as it runs (newline-delimited JSON): ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -N -X POST "$BOAT_API_BASE/sandboxes/$SANDBOX_ID/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"npm test","timeoutSeconds":600,"stream":true}' ``` Start a server in the background, then expose its port: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/$SANDBOX_ID/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"python3 -m http.server 8000","detached":true}' curl -sS -X POST "$BOAT_API_BASE/sandboxes/$SANDBOX_ID/host" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"port":8000,"public":true}' | jq -r '.url' ``` Prompt the agent to work in a repository: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/$SANDBOX_ID/prompt" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "provider": "codex", "prompt": "Run the tests, fix the failures, and commit the result." }' ``` Read the work events of the agent: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/sandboxes/$SANDBOX_ID/events" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` Get a VNC desktop URL that needs no access token: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/$SANDBOX_ID/desktop?vnc=1" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"publicAccess":true}' ``` Delete a sandbox and its snapshots. The confirmation header must hold the exact sandbox id. The header name keeps the old brand. The call returns `202`, and you cannot cancel it: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X DELETE "$BOAT_API_BASE/sandboxes/$SANDBOX_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "X-Ascii-Confirm-Delete: $SANDBOX_ID" ``` Poll `GET /deletion-operations/{operationId}` until `status` is `completed`. See [Data retention and deletion](/data-retention). ## Endpoint reference The OpenAPI file is [`/openapi/boat-v1.yaml`](/openapi/boat-v1.yaml). Generate a client for another language from it. ### Sandboxes | Endpoint | Reference | CLI | | - | - | - | | `GET /sandboxes` | [List sandboxes](/api/reference/sandboxes/list-sandboxes) | `boat list` | | `POST /sandboxes` | [Create sandbox](/api/reference/sandboxes/create-sandbox) | `boat new` | | `GET /sandboxes/{sandboxId}` | [Get sandbox](/api/reference/sandboxes/get-sandbox) | `boat info` | | `PATCH /sandboxes/{sandboxId}` | [Update sandbox](/api/reference/sandboxes/update-sandbox) | `boat extend` | | `POST /sandboxes/{sandboxId}/stop` | [Stop sandbox](/api/reference/sandboxes/stop-and-archive-sandbox) | `boat stop` | | `GET /sandboxes/{sandboxId}/stops/{stopId}` | [Get a stop](/api/reference/sandboxes/get-stop) | `boat stop --status` | | `POST /sandboxes/{sandboxId}/resume` | [Resume sandbox](/api/reference/sandboxes/resume-sandbox) | `boat resume` | | `POST /sandboxes/{sandboxId}/fork` | [Fork sandbox](/api/reference/sandboxes/fork-sandbox) | `boat fork` | | `POST /sandboxes/{sandboxId}/recover` | [Recover sandbox](/api/reference/sandboxes/recover-sandbox) (deprecated) | `boat recover` | | `POST /sandboxes/{sandboxId}/share` | [Share sandbox with the organization](/api/reference/sandboxes/share-sandbox) | `boat share` | | `POST /sandboxes/{sandboxId}/unshare` | [Make an organization sandbox private](/api/reference/sandboxes/unshare-sandbox) | `boat unshare` | | `GET /sandboxes/{sandboxId}/usage` | [Get sandbox usage](/api/reference/sandboxes/get-sandbox-usage) | `boat usage` | | `DELETE /sandboxes/{sandboxId}` | [Delete sandbox](/api/reference/sandboxes/permanently-delete-sandbox-data) | `boat delete` | ### Commands | Endpoint | Reference | CLI | | - | - | - | | `POST /sandboxes/{sandboxId}/commands` | [Run a command](/api/reference/agent/execute-sandbox-command) | `boat exec` | | `GET /sandboxes/{sandboxId}/commands/{processId}` | [Get command status](/api/reference/agent/get-command-status) | `boat exec --status` | | `GET /sandboxes/{sandboxId}/commands/{processId}/stream` | [Attach to a detached command](/api/reference/agent/attach-command) | `boat exec --attach` | | `DELETE /sandboxes/{sandboxId}/commands/{processId}` | [Stop a detached command](/api/reference/agent/stop-command) | `boat exec --kill` | | `GET /sandboxes/{sandboxId}/command-history` | [List the command history](/api/reference/agent/list-command-history) | `boat history` | | `GET /sandboxes/{sandboxId}/command-history/{commandId}` | [Get a command from the history](/api/reference/agent/get-command) | `boat history ` | | `GET /sandboxes/{sandboxId}/command-history/{commandId}/logs` | [Read command logs](/api/reference/agent/read-command-logs) | `boat history ` | | `GET /sandboxes/{sandboxId}/processes` | [List sandbox processes](/api/reference/agent/list-sandbox-processes) | `boat ps` | ### Files and access | Endpoint | Reference | CLI | | - | - | - | | `GET /sandboxes/{sandboxId}/files` | [Read a file](/api/reference/agent/read-sandbox-file) | `boat scp` | | `PUT /sandboxes/{sandboxId}/files` | [Write a file](/api/reference/agent/write-sandbox-file) | `boat scp` | | `DELETE /sandboxes/{sandboxId}/files` | [Delete a file](/api/reference/agent/delete-sandbox-file) | | | `GET /sandboxes/{sandboxId}/files/list` | [List a directory](/api/reference/agent/list-sandbox-files) | | | `GET /sandboxes/{sandboxId}/files/info` | [Get file details](/api/reference/agent/get-sandbox-file-info) | | | `GET /sandboxes/{sandboxId}/files/search` | [Search files by name](/api/reference/agent/search-sandbox-files) | | | `GET /sandboxes/{sandboxId}/files/find` | [Find text in files](/api/reference/agent/find-in-sandbox-files) | | | `POST /sandboxes/{sandboxId}/files/folder` | [Create a directory](/api/reference/agent/create-sandbox-folder) | | | `POST /sandboxes/{sandboxId}/files/move` | [Move or rename a file](/api/reference/agent/move-sandbox-file) | | | `POST /sandboxes/{sandboxId}/files/permissions` | [Set file permissions](/api/reference/agent/set-sandbox-file-permissions) | | | `POST /sandboxes/{sandboxId}/files/replace` | [Replace text in files](/api/reference/agent/replace-in-sandbox-files) | | | `POST /sandboxes/{sandboxId}/files/upload-url` | [Get an upload URL](/api/reference/agent/create-upload-url) | | | `POST /sandboxes/{sandboxId}/files/download-url` | [Get a download URL](/api/reference/agent/create-download-url) | | | `GET /sandboxes/{sandboxId}/artifacts` | [Download a file](/api/reference/agent/download-sandbox-artifact) | `boat scp` | | `POST /sandboxes/{sandboxId}/host` | [Expose a port on a public URL](/api/reference/agent/expose-a-port) | `boat host` | | `POST /sandboxes/{sandboxId}/desktop` | [Get the desktop URL](/api/reference/agent/get-desktop-streaming-url) | `boat desktop` | | `POST /sandboxes/{sandboxId}/sshkey` | [Add an SSH key](/api/reference/agent/configure-sandbox-ssh-key) | `boat ssh` | ### Integrated agents | Endpoint | Reference | CLI | | - | - | - | | `POST /sandboxes/{sandboxId}/prompt` | [Prompt the agent](/api/reference/agent/prompt-sandbox-agent) | `boat prompt` | | `GET /sandboxes/{sandboxId}/prompts/{promptId}` | [Get prompt run status](/api/reference/agent/get-prompt-run-status) | | | `GET /sandboxes/{sandboxId}/events` | [List sandbox events](/api/reference/agent/list-sandbox-events) | `boat events` | | `GET /sandboxes/{sandboxId}/conversations` | [List conversations](/api/reference/agent/list-sandbox-conversations) | `boat conversations` | | `POST /sandboxes/{sandboxId}/steer` | [Steer a running turn](/api/reference/agent/steer-a-running-turn) | `boat steer` | | `POST /sandboxes/{sandboxId}/interrupt` | [Interrupt running work](/api/reference/agent/interrupt-running-agent-work) | `boat interrupt` | ### Snapshots | Endpoint | Reference | CLI | | - | - | - | | `GET /snapshots` | [List snapshots](/api/reference/snapshots/list-snapshots) | `boat snapshots` | | `GET /sandboxes/{sandboxId}/snapshots` | [List snapshots of a sandbox](/api/reference/snapshots/list-sandbox-snapshots) | `boat snapshots ` | | `GET /sandboxes/{sandboxId}/snapshots/latest` | [Get the latest snapshot of a sandbox](/api/reference/snapshots/get-latest-sandbox-snapshot) | `boat snapshot latest` | | `GET /snapshots/{snapshotId}/tree` | [Get snapshot file tree](/api/reference/snapshots/get-snapshot-tree) | `boat snapshot tree` | | `GET /snapshots/{snapshotId}/files` | [Download a file or folder from a snapshot](/api/reference/snapshots/get-snapshot-file) | | | `GET /snapshots/{snapshotId}/download` | [Get snapshot download](/api/reference/snapshots/get-snapshot-download) | `boat snapshot pull` | | `DELETE /snapshots/{snapshotId}` | [Delete snapshot](/api/reference/snapshots/permanently-delete-snapshot-data) | `boat snapshot delete` | | `DELETE /sandboxes/{sandboxId}/snapshots` | [Delete all snapshots of a sandbox](/api/reference/snapshots/delete-sandbox-snapshots) | `boat snapshot delete --all` | ### Saved snapshots | Endpoint | Reference | CLI | | - | - | - | | `GET /saved-snapshots` | [List saved snapshots](/api/reference/snapshots/list-saved-snapshots) | | | `POST /saved-snapshots` | [Save a saved snapshot](/api/reference/snapshots/save-saved-snapshot) | `boat snapshot ` | | `GET /saved-snapshots/{name}` | [Get a saved snapshot](/api/reference/snapshots/get-saved-snapshot) | | | `DELETE /saved-snapshots/{name}` | [Delete a saved snapshot](/api/reference/snapshots/delete-saved-snapshot) | `boat snapshot rm` | | `POST /saved-snapshots/{name}/shares` | [Share a saved snapshot](/api/reference/snapshots/create-snapshot-share) | `boat snapshot share` | | `GET /saved-snapshots/{name}/shares` | [List share codes of a saved snapshot](/api/reference/snapshots/list-snapshot-shares) | `boat snapshot shares` | | `DELETE /saved-snapshots/{name}/shares/{shareId}` | [Revoke a share code](/api/reference/snapshots/revoke-snapshot-share) | `boat snapshot unshare` | ### Environments and repositories | Endpoint | Reference | CLI | | - | - | - | | `GET /environments` | [List environments](/api/reference/environments/list-sandbox-environments) | `boat env list` | | `POST /environments` | [Create an environment](/api/reference/environments/create-sandbox-environment) | `boat env new` | | `PUT /environments/{environmentId}` | [Update an environment](/api/reference/environments/update-sandbox-environment) | `boat env set` | | `DELETE /environments/{environmentId}` | [Delete an environment](/api/reference/environments/delete-sandbox-environment) | `boat env rm` | | `POST /environments/{environmentId}/upgrade` | [Upgrade sandboxes to the latest environment version](/api/reference/environments/upgrade-sandbox-environment) | `boat env upgrade` | | `PUT /environments/{environmentId}/vars/{key}` | [Set environment variable](/api/reference/environments/set-environment-var) | `boat env set-var` | | `DELETE /environments/{environmentId}/vars/{key}` | [Remove environment variable](/api/reference/environments/delete-environment-var) | `boat env rm-var` | | `PUT /environments/{environmentId}/secret-files` | [Write environment secret file](/api/reference/environments/set-environment-secret-file) | `boat env set-file` | | `DELETE /environments/{environmentId}/secret-files` | [Remove environment secret file](/api/reference/environments/delete-environment-secret-file) | `boat env rm-file` | | `POST /environments/{environmentId}/repos` | [Add environment repository](/api/reference/environments/add-environment-repo) | `boat env add-repo` | | `DELETE /environments/{environmentId}/repos/{repositoryId}` | [Remove environment repository](/api/reference/environments/delete-environment-repo) | `boat env rm-repo` | | `GET /repos` | [List GitHub repositories](/api/reference/account/list-github-repositories-available-to-sandbox) | | | `POST /repos` | [Select a repository](/api/reference/account/select-repository-for-sandboxes) | | | `GET /secrets` | [Get account secrets (legacy)](/api/reference/account/get-boat-secrets-setup) | | | `POST /secrets` | [Update account secrets (legacy)](/api/reference/account/update-boat-secrets-setup) | | ### AI credentials | Endpoint | Reference | CLI | | - | - | - | | `GET /credential-profiles` | [List credential profiles](/api/reference/ai-credentials/list-credential-profiles) | `boat ai profiles` | | `POST /credential-profiles` | [Create a credential profile](/api/reference/ai-credentials/create-credential-profile) | `boat ai profile new` | | `PUT /credential-profiles/{profile}` | [Update a credential profile](/api/reference/ai-credentials/update-credential-profile) | `boat ai profile rename`, `default` | | `DELETE /credential-profiles/{profile}` | [Delete a credential profile](/api/reference/ai-credentials/delete-credential-profile) | `boat ai profile rm` | | `PUT /credential-profiles/{profile}/keys/{credential}` | [Set a credential profile API key](/api/reference/ai-credentials/set-credential-profile-api-key) | `boat ai profile set-key` | | `DELETE /credential-profiles/{profile}/keys/{credential}` | [Remove a credential profile credential](/api/reference/ai-credentials/remove-credential-profile-credential) | `boat ai profile rm-key` | | `GET /credential-profiles/{profile}/accounts/{credential}` | [List the accounts of a credential](/api/reference/ai-credentials/list-credential-accounts) | `boat ai accounts` | | `POST /credential-profiles/{profile}/accounts/{credential}` | [Add another API key to a credential](/api/reference/ai-credentials/add-credential-account) | `boat ai add-account` | | `PUT /credential-profiles/{profile}/accounts/{credential}/{account}/active` | [Switch a credential to another account](/api/reference/ai-credentials/switch-credential-account) | `boat ai switch` | | `DELETE /credential-profiles/{profile}/accounts/{credential}/{account}` | [Forget an account of a credential](/api/reference/ai-credentials/forget-credential-account) | `boat ai forget-account` | | `PUT /credential-profiles/{profile}/custom-apis/{name}` | [Set a custom API](/api/reference/ai-credentials/set-custom-api) | `boat ai profile set-api` | | `DELETE /credential-profiles/{profile}/custom-apis/{name}` | [Remove a custom API](/api/reference/ai-credentials/remove-custom-api) | `boat ai profile rm-api` | | `GET /ai-proxy` | [Get AI credentials proxy](/api/reference/ai-credentials/get-ai-credentials-proxy) | `boat ai proxy` | | `PUT /ai-proxy` | [Turn the AI credentials proxy on or off](/api/reference/ai-credentials/turn-the-ai-credentials-proxy-on-or-off) | `boat ai proxy on` | | `GET /ai-usage` | [Get AI usage](/api/reference/ai-credentials/get-ai-usage) | `boat ai usage` | | `GET /sandboxes/{sandboxId}/ai-usage` | [Get sandbox AI usage](/api/reference/ai-credentials/get-sandbox-ai-usage) | `boat ai usage ` | | `PUT /sandboxes/{sandboxId}/ai-access` | [Block or unblock sandbox AI access](/api/reference/ai-credentials/block-or-unblock-sandbox-ai-access) | `boat ai block` | ### Account and API keys | Endpoint | Reference | CLI | | - | - | - | | `GET /me` | [Get current user](/api/reference/account/get-current-boat-user) | `boat status` | | `GET /limits` | [Get account limits](/api/reference/account/get-boat-limits) | `boat limits` | | `GET /orgs` | [List organizations](/api/reference/account/list-organizations) | `boat org list` | | `PATCH /orgs/active` | [Set the active organization](/api/reference/account/set-active-organization) | `boat org switch` | | `PATCH /orgs/{org}` | [Update organization settings](/api/reference/account/update-organization) | `boat org default-visibility` | | `GET /api-keys` | [List API keys](/api/reference/account/list-api-keys) | `boat api-key list` | | `POST /api-keys/scoped` | [Create a scoped API key](/api/reference/account/create-scoped-api-key) | `boat api-key create` | | `POST /api-keys/{apiKeyId}/rotate` | [Rotate an API key](/api/reference/account/rotate-api-key) | `boat api-key rotate` | | `DELETE /api-keys/{apiKeyId}` | [Revoke an API key](/api/reference/account/revoke-api-key) | `boat api-key revoke` | | `GET /api-keys/{apiKeyId}/usage` | [Get API key usage](/api/reference/account/get-api-key-usage) | `boat api-key usage` | ### Webhooks and OpenTelemetry | Endpoint | Reference | CLI | | - | - | - | | `GET /webhooks` | [List webhooks](/api/reference/account/list-webhooks) | `boat webhook list` | | `POST /webhooks` | [Create webhook](/api/reference/account/create-webhook) | `boat webhook create` | | `GET /webhooks/{webhookId}` | [Get webhook](/api/reference/account/get-webhook) | | | `PATCH /webhooks/{webhookId}` | [Update webhook](/api/reference/account/update-webhook) | | | `DELETE /webhooks/{webhookId}` | [Delete webhook](/api/reference/account/delete-webhook) | `boat webhook remove` | | `POST /webhooks/{webhookId}/rotate` | [Rotate webhook signing secret](/api/reference/account/rotate-webhook-signing-secret) | `boat webhook rotate` | | `GET /telemetry` | [Get OpenTelemetry export](/api/reference/account/get-opentelemetry-export) | `boat telemetry` | | `PUT /telemetry` | [Set OpenTelemetry export](/api/reference/account/set-opentelemetry-export) | `boat telemetry set` | | `DELETE /telemetry` | [Remove OpenTelemetry export](/api/reference/account/remove-opentelemetry-export) | `boat telemetry unset` | boat sends 6 webhook events: `ready`, `error`, `archived` (stopped), `hydrated`, `degraded` and `recovered`. See [Webhooks](/webhooks). ### Data retention | Endpoint | Reference | CLI | | - | - | - | | `GET /account/data-retention` | [Get account data-retention policy](/api/reference/account/get-account-data-retention-policy) | `boat data-retention status` | | `PATCH /account/data-retention` | [Update account data-retention policy](/api/reference/account/update-account-data-retention-policy) | `boat data-retention enable` | | `GET /deletion-operations/{operationId}` | [Get deletion operation](/api/reference/account/get-deletion-operation) | `boat deletion status` | # Plan, wallet and running out Source: https://docs.boat.dev/billing What your plan includes and what the wallet pays for overage. Pay and auto top-up, the bonus table, billing commands, per-sandbox cost, how to control spend, and what happens when the wallet is empty. [Pricing](/pricing) gives prices and sizes. This page tells what your plan includes and what your wallet pays. For the card, invoices, cancel and refunds, read [Card, invoices and plan changes](/billing/plan-changes). ## Plans Your money goes to two places: | | Plan | Wallet | | - | - | - | | What it is | A monthly price that your card pays | One balance in US dollars, per account or organization | | It pays for | Your limits, and the VM time and saved snapshots that the plan includes | Overage: use past the plan | | At the end of the billing period | Included amounts reset. Unused VM time expires. | Nothing changes. The money stays until you spend it. | | You add to it | `boat billing plan 100` | `boat wallet pay 50`, or auto top-up | The wallet never pays the plan. Stripe always charges the plan to your card. For every amount, read [Plans](/pricing#plans). Example: a \$20 plan. You use \$25 of VM time in one month. The plan pays the first \$20 (555 h of `default`). The wallet pays \$5. ## Wallet Each account and each organization has one wallet, in US dollars. * It pays only for what you use above your plan. * It can go below zero during the [grace period](#running-out). The dashboard then shows what you owe, for example `-$3.20`. * Money in your personal wallet stays personal. It does not move to an organization. * For an organization, only the owner can add money or change auto top-up. ### Pay Pay adds money to the wallet one time. You need a plan first. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat wallet pay 50 ``` On the dashboard, open the [Billing](https://boat.dev/dashboard?tab=billing) tab, enter an amount and click **Pay**. Stripe Checkout opens. * Whole dollars, from \$15 to \$100,000. * The dashboard and the CLI show the bonus before you pay. ### Bonus A payment of \$200 or more gets a bonus. Pay and auto top-up get the same bonus. The bonus grows evenly on a log scale, from 2% at \$200 to 25% at \$10,000. | You pay | Bonus | The wallet gets | | - | - | - | | \$15 to \$199 | none | the same amount | | \$200 | +2% | \$204 | | \$500 | +7.4% | \$537 | | \$1,000 | +11.5% | \$1,115 | | \$2,000 | +15.5% | \$2,310 | | \$5,000 | +20.9% | \$6,045 | | \$10,000 | +25% | \$12,500 | | \$100,000 | +25% | \$125,000 | ### Auto top-up Auto top-up adds money when the wallet runs low, so your sandboxes do not stop. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat wallet card # add a card (Stripe) boat wallet auto-top-up 500 # add $500 each time the wallet runs low boat wallet auto-top-up off ``` On the dashboard, open the [Billing](https://boat.dev/dashboard?tab=billing) tab, choose an amount and turn on **Auto top-up**. * Choose an amount from \$15 to \$100,000. Each top-up gets the bonus. * boat charges your card when the wallet drops below 10% of the amount, and never below \$5. Example: with \$500, the charge comes when the wallet drops below \$50. * It needs a saved card and a paid plan. It does not work during the free trial. * With more than one card, boat tries them in order. * After 3 declined charges in a row, auto top-up turns itself off. The owner gets an email. Fix the card, then turn auto top-up on again. ## From the CLI ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat billing # plan, renewal date, included time left boat billing plan 100 # start or change the plan boat billing portal # card and invoices (Stripe) boat wallet # wallet balance, auto top-up, cards boat wallet pay 50 # add $50 to the wallet boat wallet auto-top-up 500 # turn on auto top-up with $500 boat wallet auto-top-up off boat wallet card # add a card boat billing extra-starts on # pay per extra start on the next invoice, see Limits boat billing extra-starts off boat limits # included time left, starts left, sandboxes at once ``` Add `--org ` to run them on an organization: `boat --org acme wallet pay 50`. ### From code The wallet routes are part of the account API that the dashboard uses. Its base is `https://boat.dev/api/boat`, not `$BOAT_API_BASE`. These routes are not in the [v1 API reference](/api/v1) and can change. The API key needs `account.admin`. ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} API=https://boat.dev/api/boat curl -sS "$API/billing/wallet" -H "Authorization: Bearer $BOAT_API_KEY" # -> { balanceDollars, autoTopUp: { enabled, amountDollars, triggerBelowDollars, quote }, graceUntil, cards, trialWallet, trialNote? } curl -sS "$API/billing/wallet/quote?dollars=1000" -H "Authorization: Bearer $BOAT_API_KEY" # -> { dollars: 1000, bonusPercent: 11.5, bonusDollars: 115, creditedDollars: 1115 } curl -sS -X POST "$API/billing/wallet/pay" -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" -d '{"dollars": 1000}' # -> { url, quote } open url to pay in Stripe Checkout curl -sS -X POST "$API/billing/wallet/auto-top-up" -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" -d '{"enabled": true, "amountDollars": 500}' curl -sS -X POST "$API/billing/wallet/cards" -H "Authorization: Bearer $BOAT_API_KEY" # -> { url } open url to add a card ``` * For an organization wallet, add `teamId` (the id or the name): in the query on `GET`, in the body on `POST`. Only the owner can call them. * `pay` answers `402 subscription_required` without a plan. * During the free trial, the wallet pays only the [AI credentials proxy](/ai-credentials#pricing). `pay` answers `409 requires_active_plan` when the proxy is off, your sandboxes did not use it in the last 7 days, and the wallet is not in debt. When it accepts, the answer has a `trialNote`. `GET` shows the case in `trialWallet`: `ai_proxy`, `end_trial` or `null` outside the trial. * `auto-top-up` answers `409 requires_active_plan` during the trial. It answers `409 card_required` with an `addCardUrl` when no card is saved. boat keeps the amount. Open `addCardUrl`, then turn auto top-up on again. * An amount out of range gives `400 invalid_amount`. ## Control your spend A personal account has no dollar cap. Use these controls: | Control | Effect | | - | - | | Leave auto top-up off | Spend stops at your plan and your wallet. Then the [running-out rules](#running-out) apply. | | [Auto-stop](/long-running-tasks/auto-stop) | Each sandbox stops after its time, 1 hour by default. | | `boat usage `, the **Cost** column | Shows what one sandbox cost. Read [Per-sandbox usage](#per-sandbox-usage). | | Per-member caps on an [organization](/organizations/seats-and-limits#per-member-caps) | Cap the time and the sandboxes of each member. | A stopped sandbox costs nothing in VM time. Two charges continue while sandboxes are stopped: * [Saved snapshots](/snapshots/templates) above your plan's included count: \$0.056 a day each, from the wallet. * The [AI credentials proxy](/ai-credentials#pricing), while it is on: \$1 a day, from the wallet. A stopped sandbox keeps its disk for free for at least 14 days. After that, automated retention cleanup can delete it once enabled. The job currently reports candidates without deleting them in production. Read [Keep a stopped sandbox longer than 14 days](/snapshots/stop#keep-a-stopped-sandbox-longer-than-14-days). ## Check your balance ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat wallet boat limits boat limits --json ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/limits" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const limits = await boat.limits(); console.log(limits.canStart, limits.starts?.day?.remaining, limits.wallet?.balanceDollars, limits.planIncluded?.vmHoursRemaining); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} limits = boat.limits() day = getattr(limits.starts, "day", None) print(limits.can_start, getattr(day, "remaining", None), getattr(limits.wallet, "balance_dollars", None), getattr(limits.plan_included, "vm_hours_remaining", None)) ``` `BOAT_API_BASE` is `https://boat.dev/api/v1`. `boat` is the SDK client from the [Quickstart](/quickstart#from-code). For every field, read [Get limits](/api/reference/account/get-boat-limits). ## Per-sandbox usage Every sandbox meters its own machine time. A platform can bill its own users from the same numbers that your plan and your wallet pay. In the dashboard: * The **Sandboxes** page has a **Cost** column: what each sandbox cost this calendar month (UTC). Sort by it to find the most expensive one. * The **Billing** page lists **Cost by sandbox this month**, most expensive first, with the total. For an organization, it lists every sandbox the organization pays for. One **Deleted sandboxes** line holds the machine time of sandboxes you deleted this month. For all sandboxes in one call, add `include=cost` to the list. Deleted sandboxes are not in the list but still billed — add `include=deletedCost` (comma-separated with `cost` if you want both) for their total: ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/sandboxes?include=cost,deletedCost" -H "Authorization: Bearer $BOAT_API_KEY" # -> sandboxes: [{ id, name, type, ..., cost: { since, seconds, dollars } }] # deletedCost: { since, seconds, dollars } (sandboxes deleted this month) ``` Read one sandbox over any window, while it runs or after it stops: ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat usage bx_23456789 boat usage bx_23456789 --since 2026-09-01 --until 2026-10-01 boat usage bx_23456789 --json ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/sandboxes/bx_23456789/usage?since=2026-09-01T00:00:00Z&until=2026-10-01T00:00:00Z" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const usage = await boat.usage({ sandboxId: "bx_23456789", since: "2026-09-01T00:00:00Z", until: "2026-10-01T00:00:00Z" }); console.log(usage.seconds, usage.dollars, usage.running); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} usage = boat.usage("bx_23456789", since="2026-09-01T00:00:00Z", until="2026-10-01T00:00:00Z") print(usage.seconds, usage.dollars, usage.running) ``` | Field | Means | | - | - | | `seconds` | Billable machine time, with the size already applied. A `large` sandbox that ran ten minutes reads 1200. | | `dollars` | `seconds` at list price. | | `running` | `true` while the sandbox runs and the number grows. `false` after it stops, and while a refused stop keeps the meter paused. | * boat never counts stopped time. * boat does not count time after a [refused stop](/snapshots/stop#when-a-stop-is-refused). * Omit `since` and `until` to get the full life of the sandbox. * If a billing month ends while a sandbox runs, boat splits that stretch between the two months. For every field, read [Get sandbox usage](/api/reference/sandboxes/get-sandbox-usage). ## AI credentials proxy The [AI credentials proxy](/ai-credentials#the-ai-credentials-proxy) is paid from the wallet: | Charge | Price | Paid by | | - | - | - | | Each UTC day the proxy is on | \$1 | The wallet of the account with the switch on | | Proxied requests | \$1 per 1,000 | The wallet each sandbox bills | `boat ai usage` and `GET /ai-usage` show the requests per sandbox, and `dollars` is their charge. ## Organizations A team shares one plan and one wallet through an organization. Everything on this page applies to an organization in the same way. Read [Organizations](/organizations). ## Running out When the wallet is empty: * [Extra starts](/limits#extra-starts) fail with `rate_limited`, unless they are on your invoice. * Saved snapshots above the included count get 7 days. Then boat deletes them. Read [When your wallet is empty](/snapshots/templates#when-your-wallet-is-empty). When the wallet is empty and the plan's included time is used: 1. You get a **24-hour grace period**. 2. Your sandboxes keep running. boat sends you an email. Add money before anything stops. 3. If you do not pay in that window, boat stops your running sandboxes. Each stop takes a snapshot. boat stops them earlier if the grace period adds more new debt than 25% of the plan price, or \$50 on smaller plans. 4. Nothing is lost. Resume the sandboxes after you add money. During the grace period, the wallet goes below zero: * The wallet shows what you owe, for example `-$3.20`. * Your next payment pays that amount first. * You pay for exactly the seconds that you used. If your plan ends and the wallet has money, running sandboxes keep running on the wallet. An organization drops to the limits of one seat. ## Related * [Pricing](/pricing) * [Card, invoices and plan changes](/billing/plan-changes) * [Limits and errors](/limits) * [Free trial](/free-trial) * [Organizations](/organizations) * [FAQ](/faq) # Card, invoices and plan changes Source: https://docs.boat.dev/billing/plan-changes Change your card, get invoices and receipts, add a VAT ID, upgrade or downgrade, cancel the plan, refunds, and move a plan between a personal account and an organization. boat bills through Stripe. Open the Stripe billing portal for your card and your invoices: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat billing portal ``` On the dashboard: [Billing](https://boat.dev/dashboard?tab=billing) > **Manage billing**. ## Card, invoices and receipts | You want to | Do this | | - | - | | Change the card | Open the portal. Add the new card and make it the default. | | Pay an invoice that failed | Open the portal. Pay the open invoice there. This never charges twice. | | Get invoices and receipts | Open the portal. Every invoice and receipt is there. | | Add a VAT or tax ID | Enter it at checkout. It goes on every invoice. To add it later, [contact support](/support). | | Know the charge on your bank statement | Statements show **DEDALE AI**, the company behind boat. | * Checkout does not add VAT or sales tax on top of the plan price. * For an organization, add `--org `: `boat --org acme billing portal`. Only the owner can open it. ## Upgrade or downgrade ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat billing plan # list the plans boat billing plan 100 # move to the $100 plan ``` On the dashboard, click **Upgrade to …** or **Downgrade to …** on the Billing tab. The confirm dialog shows the exact charge. A change applies at once, up or down: 1. A new billing month starts that day. 2. Stripe credits the unused part of the old plan: the smaller of the unused days and the unused included time. 3. Stripe charges the full price of the new plan, minus that credit. 4. The new plan's limits and included time apply at once. The time that you used so far counts against the old plan. * Example: on day 10 of the \$500 plan, you used all the included time. No included time is unused, so the credit is zero. The invoice shows the credit for the unused days and a line for the included time used, and they cancel out. * When the credit is larger than the new price, Stripe charges nothing. The rest stays as credit for your next invoices. * If the card fails, the plan does not change. Your sandboxes keep running on the old plan. * A plan change during the [free trial](/free-trial) ends the trial. ## Cancel the plan Run `boat billing cancel`. Or open [Dashboard > Billing](https://boat.dev/dashboard?tab=billing) and click **Cancel plan**. To pause, take the offer in that step, or run `boat billing cancel --keep-disks`. The plan stops, you pay nothing more, and boat keeps the disks of your stopped sandboxes for 90 days after the paid month, not 14. To resume them, subscribe again. | When | What happens | | - | - | | Until the end of the paid month | Nothing changes. The plan does not renew. Click **Keep plan active** to undo the cancel. | | At the end of the paid month, with money in the wallet | Running sandboxes keep running on the wallet. An organization drops to the limits of one seat. | | At the end of the paid month, with an empty wallet | boat stops your running sandboxes. Their disks stay. Resume them after you subscribe again. | * boat does not refund the rest of the month after a cancel. * The money in your wallet stays on your account. * Saved snapshots stay. Your included count follows the new plan. Each one above it costs \$0.056 a day from the wallet. * To subscribe again, pick a plan on the Billing tab. You get no second trial. * An organization owner cancels the organization plan in the Stripe portal: `boat --org acme billing portal`. To cancel a trial, read [Free trial](/free-trial#cancel-the-trial). To close the account and delete your data, read [Close your account](/data-retention/close-account). A close cancels the plan at once. ## Refunds boat does not refund unused time in general. boat refunds by itself in these cases: | Case | Refund | | - | - | | You [move a personal plan to an organization](/organizations/move-personal-plan) | The unused share of the month, to your card | | Stripe takes a payment after the plan was cancelled | The full payment | | A stop is refused because a snapshot failed | No charge for that time. You do not need to ask. | For any other case, [contact support](/support) with the invoice number. ## Move a plan between personal and organization | From | To | How | | - | - | - | | Personal | Organization | `boat --org acme org migrate`. Read [Move a personal plan in](/organizations/move-personal-plan). | | Organization | Personal | No single command. See the steps below. | To move from an organization back to a personal plan: 1. Make your personal account the active wallet: `boat org switch personal`. 2. Start a personal plan: `boat billing plan 20`. 3. Optional: delete the organization with `boat org delete`. You must be the owner and the last member. When you delete the organization: * Its plan ends at once. boat does not refund the rest of the month. * Each sandbox goes back to the personal billing of the person who created it. ## Seats An organization pays one plan price per seat. Seat changes are prorated. Read [Seats, limits and caps](/organizations/seats-and-limits). # CI with boat Source: https://docs.boat.dev/ci Run GitHub Actions jobs on boat sandboxes with runs-on: boat, or drive boat from any CI with the CLI. Two ways to run CI on boat: | Way | Setup | Use it when | | - | - | - | | [GitHub Actions runners](#github-actions-runners-runs-on-boat) | Install the boat CI GitHub App, change `runs-on` | Your CI is GitHub Actions | | [The CLI from any CI](#the-cli-from-any-ci) | An API key and a few `boat` commands | GitLab CI, CircleCI, Buildkite, or one step of a GitHub job | ## GitHub Actions runners: `runs-on: boat` Each job gets a fresh sandbox, billed per second, deleted when the job ends. CI needs the \$20/month plan or higher. On the free trial, or without a plan, boat refuses each job once and says why in `boat ci` and on the dashboard. Start a plan, then re-run the job. ### Set up in 2 steps 1. Install the boat CI GitHub App on your GitHub organization or account. Pick the repositories: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ci connect # jobs bill the wallet in scope (see `boat org`) boat ci connect --org acme # jobs bill the acme organization ``` The command opens GitHub in your browser. GitHub asks you to authorize the app: boat uses that to check that you can manage the installation. GitHub lets an app add runners to one repository only with the repository permission **Administration: write**. If your organization cannot grant it, install **Boat CI for orgs** instead: on the CI tab, click **Connect an organization without repo admin**. It needs only the organization permission **Self-hosted runners: write**. Boat makes one runner group per repository, named `boat `, so a runner only takes jobs of its own repository. It works on GitHub organizations only. If the app is already installed, an owner of the GitHub organization can link it without reinstalling: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ci connect --org acme --account acme-github ``` Use the GitHub account name after `--account`, not the repository name. The owner can open a link generated by a boat organization admin. After authorizing on GitHub, boat shows which boat account will own the jobs, and nothing is linked until the owner confirms. Only open a link from someone you trust: that account can read the jobs' logs and sandboxes. The CI tab also has **Already installed on GitHub? Link it here**. 2. In your workflow, change `runs-on`: ```yaml theme={"theme":{"light":"github-light","dark":"github-dark-default"}} jobs: test: runs-on: boat # was: ubuntu-latest steps: - uses: actions/checkout@v4 - run: npm ci && npm test ``` GitHub Actions secrets, `services:`, `container:`, `actions/cache` and `actions/upload-artifact` work as on GitHub-hosted runners. Boat does not pass your own environment to the job: no saved variables, secret files, GitHub token or model provider keys. Use GitHub Actions secrets for anything the job needs. Run `boat ci` to see the last jobs. ### Sizes and options | Label | Sandbox | | - | - | | `boat-small` | `small`: 2 vCPU, 4 GB | | `boat` | `default`: 4 vCPU, 8 GB | | `boat-large` | `large`: 8 vCPU, 16 GB | | `boat-xlarge` | `xlarge`: 16 vCPU, 32 GB | A job can use the RAM of its size plus all the swap on the sandbox: 4 GB from boat, plus any swapfile a step adds. When a process needs more, the kernel kills it, and boat adds an "Out of memory on Boat" warning to the run. Then use a larger size. The job runs in `$HOME/actions-runner/_work`, under `$HOME` as on GitHub-hosted runners. Add options after the size with `/`, for example `runs-on: boat-large/from=ci-base/debug`: | Option | Effect | | - | - | | `from=` | Start from a [saved snapshot](/snapshots/templates), with your toolchain and dependencies in place. Boat keeps the disk and removes the owner secrets before the job starts. Prepare it as in [step 2 below](#2-prepare-a-saved-snapshot-one-time). | | `debug` | When the job fails, boat keeps the sandbox for 30 minutes. Run `boat ssh ` to look around. | | Every sandbox has `/dev/kvm`, so virtual machines need no option. An old `/kvm` option still works and changes nothing. | | A label with an unknown option never runs: boat refuses the job and `boat ci` shows the reason. ### Docker, containers and virtual machines Each job runs on a full Linux virtual machine with Docker, not in a container: * `docker build`, `docker run` and `docker compose` work in steps. * `services:` containers (Postgres, Redis) start next to the job, on `localhost`. * `container:` runs the steps inside the image that you name. * The job can start its own virtual machines: QEMU, Firecracker, the Android emulator. Every sandbox has `/dev/kvm`. Each job starts from a clean sandbox, so Docker pulls its images again. A `from=` snapshot does not remove the pulls: boat pulls registry images again at each start. See [What a snapshot saves](/snapshots/whats-saved#docker). ### Android emulator tests The emulator is hardware-accelerated on every sandbox. Nothing is boat-specific: the job installs the Android SDK and accepts its license, as on any runner: ```yaml theme={"theme":{"light":"github-light","dark":"github-dark-default"}} jobs: android: runs-on: boat-large steps: - uses: actions/setup-java@v5 with: { distribution: temurin, java-version: 17 } - uses: android-actions/setup-android@v4 - uses: reactivecircus/android-emulator-runner@v2 with: api-level: 34 arch: x86_64 target: google_apis script: ./gradlew connectedCheck ``` An Android 14 emulator boots in about 25 seconds. Use `setup-android@v4`: `@v3` asks the SDK for the `tools` package, which Google removed, so it fails on every runner that does not ship an Android SDK. ### Windows programs with Wine boat has no Windows runners. To build Windows executables and test them, cross-compile on Linux and run the `.exe` with [Wine](https://www.winehq.org/): ```yaml theme={"theme":{"light":"github-light","dark":"github-dark-default"}} jobs: windows: runs-on: boat steps: - uses: actions/checkout@v4 - run: sudo apt-get update && sudo apt-get install -y --no-install-recommends wine64 mingw-w64 - run: x86_64-w64-mingw32-gcc main.c -o app.exe && /usr/lib/wine/wine64 app.exe ``` The install takes about 17 seconds. On Ubuntu 24.04 the `wine64` package puts its program at `/usr/lib/wine/wine64`, not on the `PATH`. For Rust MSVC targets, [cargo-xwin](https://github.com/rust-cross/cargo-xwin) builds on Linux and `cargo xwin test` runs the tests with Wine. Wine runs most console programs and tests. It is not Windows: GUI, driver and installer tests need a real Windows machine. ### See and debug jobs The **CI on Boat VMs** tab of the dashboard shows your setup steps, the repositories the app can see, every job with its wait, run time, cost and log, and why a job did not run. The CLI and the API show the same data: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ci # setup steps, problems, 7-day stats, last jobs boat ci --repo acme/api --state failed # filter: --account, --repo, --state all|active|failed, --limit boat ci repos # repositories the app can see, and their status boat ci job # wait, run time, cost, sandbox, error boat ci logs --follow # the GitHub log, live while the job runs ``` Add `--json` for the full data. In the [API](/api/v1) and the [SDKs](/sdks/overview): | API | TypeScript | Python | | - | - | - | | [`GET /ci`](/api/reference/ci/get-ci-overview) | `getCiOverview({ repo, state })` | `get_ci_overview(repo=, state=)` | | [`POST /ci/connect`](/api/reference/ci/connect-ci-github) | `connectCiGithub({})` | `connect_ci_github(...)` | | [`POST /ci/public`](/api/reference/ci/set-ci-public-repos) | `setCiPublicRepos({ account, allow, users })` | `set_ci_public_repos(...)` | | [`GET /ci/jobs/{jobId}`](/api/reference/ci/get-ci-job) | `getCiJob({ jobId })` | `get_ci_job(job_id)` | | [`GET /ci/jobs/{jobId}/logs`](/api/reference/ci/get-ci-job-log) | `getCiJobLog({ jobId })` | `get_ci_job_log(job_id)` | Reading needs an API key with `account.read`; connecting GitHub and public repositories need `account.admin`. Each job shows its true state and its reason: what it waits for, or why it did not run. When boat refuses a job, it says why: no paid plan, an unknown label such as `boat-huge`, a public repository, a GitHub account not linked to boat, or a sandbox boat cannot create (for example a `from=` snapshot that does not exist). The job then shows as refused, with the reason, in all three places. A full minute start limit or too many running sandboxes do not refuse the job: boat retries every 15 seconds. For the hour and day start limits, read [What happens at a limit](#what-happens-at-a-limit). Each job is a normal sandbox named `ci--`. It shows in the dashboard and in `boat list` while it runs. Run `boat ssh ` on a running job, or on a failed `/debug` job. ### Public repositories Jobs from public repositories do not run on boat by default. Anyone can open a pull request on a public repository, and its jobs would run on your bill. Turn them on per GitHub account, and list the GitHub users whose runs may use boat: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ci public my-account on --users "me, @a-teammate" boat ci public my-account # show the setting boat ci public my-account off ``` The CI tab in the dashboard has the same switch. It checks each name on GitHub as you type. * A run uses boat only when both its author and the user who started it (for example a re-run) are on the list. A pull request from someone else is refused with the reason, even when you re-run it. * `--anyone` clears the list: every run uses boat, pull requests from forks too. To keep that safe, set "Require approval for all outside collaborators" in the repository's Actions settings on GitHub. * Only the person who linked the account, or an owner or admin of its org, can change this. ### Safety * Jobs from public repositories do not run on boat unless you [turn them on](#public-repositories). * Each job starts with your Boat [environment](/environments) off. The job gets no Boat environment variables, secret files, GitHub token or model provider keys. A `/from=` snapshot keeps its disk, but Boat removes the owner secrets before the job starts. * Use GitHub Actions secrets for job secrets. `runs-on: boat` jobs do not read a Boat environment, so values set with `boat env set-var` are not present. * A job runs for at most 6 hours, the GitHub limit. boat deletes any CI sandbox that outlives its job. * A job past your [start limits](#what-happens-at-a-limit) waits or fails. It depends on the limit. ## The CLI from any CI Each CI job creates one sandbox, runs the tests in it, and deletes it. `boat exec` exits with the exit code of the tests, so the job fails when the tests fail. ### 1. Create a CI key and a secret Create a key with the `ci` preset. It can create, use and delete sandboxes. Then store it as a repository secret: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat api-key create github-ci --preset ci --ttl 90d gh secret set BOAT_API_KEY # paste the boat_... secret that the command printed once ``` The key expires after 90 days. Rotate it with `boat api-key rotate `. See [API keys](/api-keys). ### 2. Prepare a saved snapshot (one time) Install your toolchain and dependencies once. Save the result as a saved snapshot. Each CI sandbox then starts with them in place: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} id=$(boat new --json | jq -r 'select(.event == "ready") | .id') boat exec "$id" --timeout 600 -- bash -lc 'sudo apt-get update && sudo apt-get install -y postgresql-client' boat exec "$id" --timeout 600 -- bash -lc 'docker pull postgres:16 && docker create --name keep-postgres postgres:16' boat snapshot "$id" ci-base boat delete "$id" --yes ``` > [!WARNING] > > **A saved snapshot keeps only the Docker images that a container uses.** A plain `docker pull` is lost. Create a container from each image that you need, as above: `docker create --name keep- `. The container does not need to run. boat pulls registry images again at each start, so a large image adds start time. See [What a snapshot saves](/snapshots/whats-saved#docker). 10 saved snapshots are free. Run the same steps again to update `ci-base`: a save with the same name replaces it. See [Saved snapshots](/snapshots/templates). ### 3. The workflow ```yaml .github/workflows/boat-tests.yml theme={"theme":{"light":"github-light","dark":"github-dark-default"}} name: Tests on Boat on: pull_request: push: branches: [main] jobs: test: runs-on: ubuntu-latest timeout-minutes: 30 env: BOAT_API_KEY: ${{ secrets.BOAT_API_KEY }} steps: - uses: actions/checkout@v4 - name: Install the Boat CLI run: | mkdir -p "$HOME/.local/bin" curl -fsSL "https://boat.dev/api/boat/cli/download?platform=linux-x64&channel=prod" \ -o "$HOME/.local/bin/boat" chmod +x "$HOME/.local/bin/boat" echo "$HOME/.local/bin" >> "$GITHUB_PATH" - name: Sign in run: printf '%s' "$BOAT_API_KEY" | boat login --key-stdin --json - name: Create a sandbox from the saved snapshot id: sandbox run: | id=$(boat new --from ci-base --type small --ttl 1800 --json | jq -r 'select(.event == "ready") | .id') test -n "$id" echo "id=$id" >> "$GITHUB_OUTPUT" - name: Copy the code run: | git archive --format=tar.gz -o /tmp/src.tgz HEAD boat scp /tmp/src.tgz "${{ steps.sandbox.outputs.id }}:/home/user/src.tgz" boat exec "${{ steps.sandbox.outputs.id }}" "mkdir -p repo && tar xzf src.tgz -C repo" - name: Run the tests run: | set +e boat exec "${{ steps.sandbox.outputs.id }}" --cwd repo --timeout 600 --stream -- bash -lc 'npm ci && npm test' code=$? boat scp "${{ steps.sandbox.outputs.id }}:/home/user/repo/junit.xml" ./junit.xml || true exit $code - name: Delete the sandbox if: always() && steps.sandbox.outputs.id != '' run: boat delete "${{ steps.sandbox.outputs.id }}" --yes --json ``` What each part does: | Part | Why | | - | - | | Static binary download | The install script opens a browser sign-in. The binary needs none. Use `platform=linux-arm64` on an ARM runner. | | `boat login --key-stdin` | Keeps the key out of the process list. | | `--from ci-base` | Starts with the toolchain and dependencies in place. | | `--ttl 1800` | Auto-stop after 30 minutes, if the delete step never runs. | | `--timeout 600 --stream` | Stops the tests after 600 seconds. `--stream` prints the output live. `--timeout 0` = no limit. | | `set +e` and `exit $code` | Copies the test report out, then fails the job with the exit code of the tests. | | `if: always()` | Deletes the sandbox also when a step failed or the job was cancelled. Billing stops at the delete. | Use the sandbox ID in every command. The `current` alias does not work in CI: each step runs in a new shell. ### Tests that run longer than 10 minutes Give a longer `--timeout`, or `--timeout 0` for no limit. The CLI prints the output live until the command ends, and exits with its exit code: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec "$id" --cwd repo --timeout 0 -- bash -lc 'npm run test:e2e' ``` See [Background commands](/long-running-tasks/background-commands). ### One command instead of the steps above `boat run` creates the sandbox, copies the checkout in, runs the tests, prints the cost and deletes the sandbox. It exits with the exit code of the tests: ```yaml theme={"theme":{"light":"github-light","dark":"github-dark-default"}} - name: Run the tests run: boat run --from ci-base --type small --push . -- bash -lc 'npm ci && npm test' ``` The copy holds the files that git tracks and the new files that `.gitignore` does not exclude. A cancelled job deletes the sandbox too. If the runner dies, the sandbox stops by itself within 15 minutes. See [`boat run`](/cli-reference#boat-run-command). ### Fast apt-get: use the French Ubuntu mirror GitHub Actions scripts often set `azure.archive.ubuntu.com`. From a sandbox, that mirror is slow. Use `fr.archive.ubuntu.com`: | Mirror | Speed from a sandbox | | - | - | | `fr.archive.ubuntu.com` | about 95 MB/s | | `archive.ubuntu.com` (sandbox default) | 23 to 105 MB/s | | `azure.archive.ubuntu.com` | 3 to 87 MB/s | Run this before `apt-get install`, or put it in the saved snapshot: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sudo sed -i 's#http://[a-z.]*archive.ubuntu.com#http://fr.archive.ubuntu.com#g' /etc/apt/sources.list.d/ubuntu.sources sudo apt-get update ``` ## Many jobs at once: start limits Each job starts one sandbox. Your plan includes a number of starts. Create, fork and resume each count as a start. | Plan | Starts included per minute / hour / day | Sandboxes at once | | - | - | - | | \$20 | 12 / 60 / 200 | 100 | | \$100 | 30 / 210 / 840 | 300 | | \$500 | 65 / 420 / 1,680 | 1,000 | | \$2000 | 90 / 600 / 2,400 | 2,000 | | [Free trial](/free-trial) | 5 / 25 / 75 | 2 | * Above the included number, a job uses an [extra start](/limits#extra-starts). * A matrix of 30 jobs on the \$20 plan: 12 start free. With money in the wallet, the other 18 cost \$0.90 and start in the same minute. Without extra starts, all 30 need about 3 minutes to start. To stay free, cap it with `strategy.max-parallel: 12`. * To fail at once when no machine is free, add `--fail-fast` to `boat new`. Retry the job later. ### What happens at a limit This applies when no extra start can run. | Limit | `runs-on: boat` job | `boat new` in your own CI | | - | - | - | | Minute | Waits. boat retries every 15 seconds | Fails with `rate_limited` and `window: minute` | | Hour | Waits when a start frees within 15 minutes of the job's arrival. If not, fails with the reason | Fails with `rate_limited` and `window: hour` | | Day | Fails at once, with the reason | Fails with `rate_limited` and `window: day` | A refused start does not count as a start. All limits and how to raise them: [Limits](/limits). A job that a limit stopped shows as **paused** in `boat ci` and the CI tab, not as failed. On GitHub it shows the title "Paused by plan limit" and what you can do. It does not restart by itself, and turning on extra starts does not restart it. A full limit shows above the job list in the CI tab and first in `boat ci`. `boat ci` prints the command, and the CI tab links to the run. `boat ci --all` shows every job and every limit: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} gh run rerun --failed --repo / ``` Run it after the job fails on GitHub, or use **Re-run failed jobs** on the GitHub run page. ## Cost A job costs VM time, and an extra start when it falls above the included starts. * boat bills each second that the sandbox runs. A `small` sandbox costs \$0.018 an hour. A 6-minute run costs about \$0.002. A deleted sandbox costs nothing more. * The plan price comes back as VM time. A team pays the higher of the plan price and its VM time, plus its extra starts. ### Worked examples These examples use today's prices. They assume 32 jobs per developer per workday, 22 workdays a month, 6 minutes per job on `default`, and 16% of the day's jobs in the busiest hour. | Developers | Jobs a day | Busiest hour | VM time a month | Plan | Extra starts a month | Total a month | Per job | | - | - | - | - | - | - | - | - | | 5 | 160 | 26 | \$13 | \$20 | \$0 | \$20 | \$0.006 | | 20 | 640 | 102 | \$51 | \$100 | \$0 | \$100 | \$0.007 | | 100 | 3,200 | 512 | \$253 | \$500 | \$1,302 | \$1,802 | \$0.026 | * At 100 developers, the day goes above 1,680 included starts. 840 starts cost \$0.03 and 680 cost \$0.05, which is \$59.20 a day. * The same team on the \$2000 plan pays \$2,528. * The busiest hour (512) is above the 420 included starts of the \$500 plan. Starts in that hour that are still inside the day limit add up to \$61 a month. * At this volume, extra starts set the bill, not the job length. 2-minute `small` jobs still cost \$1,802 a month. A runner that bills per minute can cost less for short jobs at this volume. See [Pricing](/pricing). ## Private repositories and secrets A `runs-on: boat` job uses GitHub Actions secrets. It does not read a Boat environment. The CLI workflow above copies the checked-out code, so its sandbox needs no GitHub access. To give those tests secrets, set them on a Boat [environment](/environments) and start with `--environment `, or pass one value with `-e KEY=VALUE`. Check that a value arrived: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec "$id" 'echo ${DATABASE_URL:+set}' ``` An environment that is safe for third parties withholds all your secrets. See [Secrets](/environments/secrets). ## Other CI systems The steps are the same in GitLab CI, CircleCI or Buildkite: download the binary, sign in with `--key-stdin`, `boat new --json`, `boat exec`, and `boat delete --yes` in a step that always runs. In code, use the [Python](/sdks/python#run-one-job-and-delete-the-sandbox) or [TypeScript](/sdks/typescript#run-one-job-and-delete-the-sandbox) SDK instead. Each page has the same job as `boat run`: create, copy the code in, run with no time limit, print the cost, delete. # CLI reference Source: https://docs.boat.dev/cli-reference Every boat CLI command and flag: install, sign in, create, run, stop, resume, fork, snapshots, public URLs, environments, prompts, billing. JSON output for scripts and CI. ## Install the CLI ```bash macOS theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -fsSL https://boat.dev/install | sh ``` ```bash Linux theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -fsSL https://boat.dev/install | sh ``` ```powershell Windows theme={"theme":{"light":"github-light","dark":"github-dark-default"}} irm https://boat.dev/install.ps1 | iex ``` The installer signs you in and adds a shell function. **Open a new terminal** after the install. See [Quickstart](/quickstart). On macOS and Linux, the installer also links the binary into `~/.local/bin`. Agents and CI jobs run shells that read no startup file, and these shells find `boat` there when `~/.local/bin` is on their `PATH`. Ubuntu and Debian add it at login. To update, run `boat self-update`. The CLI also updates itself, at most every 6 hours, after a command ends. It never asks a question and never changes a command that runs. To keep one version for a whole script or benchmark, set `BOAT_NO_UPDATE=1` or pass `--no-update`. > [!NOTE] > > Used the `box` CLI before? Read [Migrating from Box](/migrating-from-box). *** ## Global flags These flags work with all commands: | Flag | Description | | - | - | | `--api-url ` | Use a different API endpoint (env: `BOAT_API_URL`) | | `--org ` | Run this command against an organization wallet (env: `BOAT_ORG`). The scope that you set with `boat org switch` does not change. | | `--json` | Print JSON for machines instead of text for people | | `--no-update` | Skip the automatic update (env: `BOAT_NO_UPDATE=1`) | When you pipe or redirect the output, `--json` turns on automatically. Scripts get JSON without the flag, not the tables that this page shows. Some examples pipe the JSON into `jq`. Install `jq` if you do not have it. A command that takes a sandbox ID also accepts two aliases: | Alias | Sandbox | | - | - | | `current` | The last sandbox that you created or forked in this shell. `boat resume` does not change it. It needs the shell function that the installer adds. Without an ID, `boat ssh`, `boat exec` and `boat prompt` use it too. | | `self` | The sandbox that the CLI runs inside, when you use the CLI in a sandbox | In a script or a CI job, `current` does not work: each command runs in a new process without the shell function. Pass the sandbox ID. *** ## In scripts and CI In an application, use the [Python or TypeScript SDK](/sdks/overview) or the [HTTP API](/api/v1) with a `BOAT_API_KEY`. You do not install a binary, and the responses have types. Use the CLI in shell scripts and CI jobs. Sign in without the key in the process arguments. Then read JSON from stdout: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat login --key-stdin --json <<< "$BOAT_API_KEY" sandbox_id="$(boat new --json | jq -r 'select(.event == "ready") | .id')" trap 'boat delete "$sandbox_id" --yes --json' EXIT boat exec "$sandbox_id" --timeout 600 "npm test" # exits with the exit code of npm test ``` For a full GitHub Actions workflow, see [CI with boat](/ci). The [endpoint tables](/api/v1#endpoint-reference) give the API call of each command. Most commands print one JSON object. These commands print JSON Lines, one object per line: * `boat new` * `boat prompt` * `boat events`, with or without `--follow` * `boat conversations` Parse JSON Lines one line at a time. When a command fails in `--json` mode, it prints a last line and exits with a non-zero code: ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} {"event":"error","error":"...","code":"...","status":...} ``` The line has `code` and `status` when the boat API refused the request. Errors in the arguments go to stderr, and they are possibly not JSON. To use the CLI in a Docker image, do these steps: 1. Download the static binary for the architecture of the image. 2. Sign in when the container starts. ```dockerfile theme={"theme":{"light":"github-light","dark":"github-dark-default"}} FROM debian:bookworm-slim RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl openssh-client \ && rm -rf /var/lib/apt/lists/* RUN set -eu; \ case "$(uname -m)" in \ x86_64|amd64) arch=x64 ;; \ arm64|aarch64) arch=arm64 ;; \ *) echo "unsupported arch: $(uname -m)" >&2; exit 1 ;; \ esac; \ curl -fsSL "https://boat.dev/api/boat/cli/download?platform=linux-${arch}&channel=prod" -o /usr/local/bin/boat; \ chmod +x /usr/local/bin/boat ``` ```sh theme={"theme":{"light":"github-light","dark":"github-dark-default"}} #!/bin/sh # entrypoint set -eu printf '%s' "$BOAT_API_KEY" | boat login --key-stdin --json exec node server.js ``` *** ## Shell completion `boat completions ` prints a completion script for bash, zsh, fish, or PowerShell. The script completes these values: * Subcommands. * The IDs of your live sandboxes, and `current` and `self`. The script keeps the results for 15 seconds, so the next tabs are instant. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} # bash: add to ~/.bashrc eval "$(boat completions bash)" # zsh: add to ~/.zshrc, after compinit eval "$(boat completions zsh)" # fish boat completions fish > ~/.config/fish/completions/boat.fish # PowerShell: add to $PROFILE boat completions powershell | Out-String | Invoke-Expression ``` *** ## Authentication ### `boat onboard` Set up this computer. The command does these steps: 1. It signs you in through the browser. 2. It saves your token. 3. It asks only for what your account still needs: the third-party safety answer and the plan checkout. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat onboard boat onboard --google boat onboard --email you@example.com ``` It asks which sign-in method to use: GitHub, Google, a 6-digit code that it sends to your email, or AgentID. `--google`, `--email` and `--agentid` give that answer in advance. See [Quickstart](/account#sign-in-methods). You can run it again safely. If this computer is already signed in, it keeps that session and does not start a new sign-in. A method flag (`--google`, `--email`, `--agentid`) signs in again. On a new install or a second computer, it finds the account that you already have. It skips each step that this account has done: | Your account already has | What `boat onboard` does | | - | - | | An active plan | Prints your plan and usage. **No Stripe Checkout**, no second subscription. | | A plan with depleted usage | Points you at the billing dashboard to add money to the wallet or change tier, instead of starting another plan. | | Answered what your sandboxes are for | Does not ask that question again, whichever way you answered. | | A past subscription | Offers checkout without promising a 7-day trial, which Stripe grants once per customer. | boat records your answer on the environment when you give it. boat keeps both answers, not only "a platform of mine". A plan never counts as an answer, because the dashboard checkout does not ask the question. See [Reinstalling, or a second machine](/account#reinstalling-or-a-second-machine). ### `boat login [key]` Sign in with an API token that you already have. Without a key, the command starts a sign-in in the browser. GitHub is the default. Google, email and AgentID also work. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat login boat login --google boat login --email you@example.com boat login --agentid boat login --key-stdin <<< "$BOAT_API_KEY" boat login boat_abc123... ``` `--key-stdin` reads the token from standard input, not from the command line. Other users on the host can read the process arguments, so the token stays out of them. Use `--key-stdin` when you sign in without a person present. You can also give the token as an argument. You cannot use both. Without a key, the CLI prints a URL and a code, and opens the URL. In a terminal, it waits until you finish in the browser or the link expires after 15 minutes. `--email` sends a code to that address. If you omit the address, the browser page asks for it. boat refuses disposable email domains. Without a terminal (an AI agent, a script), sign-in takes two commands: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat login --json # prints the URL, the code and expiresAt, then exits boat onboard --wait --json # waits for the browser step, saves the session, prints the links ``` Run the first command again and it shows the same link and code. It never replaces a pending link, because the code that the user already has then reaches nobody. `boat login --new` starts a new link on purpose and prints a `login_replaced` event. `boat login --wait` also waits, like `boat onboard --wait`. All methods sign in to the same account only if they are already **connected** to it. A method that you never used before starts a new account, even when the email is the same. Add connections in [Dashboard > Account](https://boat.dev/dashboard?tab=account) instead. See [Quickstart](/account#sign-in-methods). To create production API keys, run `boat api-key create` or use the API Keys page of the dashboard. For key management, see [API Keys](/api-keys). For Docker and CI setup, see [In scripts and CI](#in-scripts-and-ci). ### `boat api-key` Create and manage API keys for SDKs, CI, and other projects. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat api-key create my-project --ttl 90d --preset ci boat api-key create my-project --ttl 7d --sandbox bx_123 --actions sandbox.read,exec boat api-key list # scope, expiry, last used boat api-key list --all # also platform-managed per-sandbox machine keys boat api-key usage # 30-day requests and live resource count boat api-key usage --verbose # plus sandboxes/Agents split and created list boat api-key rotate # old secret stops working, new one shown once boat api-key revoke ``` | Flag | Rule | | - | - | | `--ttl` | Default 90d. Maximum 365d, or `never` for a key that works until you revoke it. | | `--sandbox`, `--env` | You can repeat them. | | `--preset` | `read-only`, `full-sandbox`, `ci`, or `admin`. | | `--actions` | You cannot use it with `--preset`. | `create` and `rotate` show the secret one time. You cannot get it again later. `list` shows the prefix, the last four characters, the scope, the expiry, the 30-day request total, and the live resource count. `usage` still works after you revoke a key. Revoke does not delete sandboxes or Agents. | Command | Who can run it | | - | - | | `create` | A browser sign-in (`boat login` without a key), or a key made with `--preset admin` | | `rotate`, `revoke` | A browser sign-in only | | `list`, `usage` | Any key of the account | For a CI key, run `boat api-key create --preset ci`. The same actions exist in the API: [Create a scoped API key](/api/reference/account/create-scoped-api-key), [Rotate](/api/reference/account/rotate-api-key) and [Revoke](/api/reference/account/revoke-api-key). See [API keys](/api-keys). ### `boat webhook` Register lifecycle webhooks for all sandboxes of your account. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat webhook create https://example.com/hooks/boat --name prod --event ready --event error boat webhook list boat webhook rotate boat webhook remove ``` `--event` takes one of 6 events: `ready`, `error`, `archived` (the sandbox stopped), `hydrated`, `degraded` and `recovered`. The deliveries name them `sandbox.ready`, `sandbox.error` and so on. Repeat `--event` or separate the names with commas. To get all 6, omit `--event`. `--name` sets a display name. You see the signing secret only when you create or rotate the webhook. See [Webhooks](/webhooks). ### `boat telemetry` Send sandbox and account metrics, and lifecycle events, to an OTLP/HTTP endpoint. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat telemetry # show the export and its last result boat telemetry set https://otlp.datadoghq.com -H dd-api-key=$DD_API_KEY boat telemetry unset ``` `set` replaces the current export and sends a test export immediately. For more headers, repeat `-H key=value` (long form `--header`). boat encrypts the header values and never shows them. See [OpenTelemetry](/opentelemetry). ### `boat logout` Sign out and clear the local token. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat logout ``` ### `boat feedback` Send feedback to the boat team by email. Replies go to your account email. You can send 5 per minute and 30 per day. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat feedback "fork is slow on large disks" cat notes.txt | boat feedback ``` ### `boat status` Show the API health, the account that is signed in, its plan, the path of the local configuration and the path of the CLI binary. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat status boat status --check # exits 1 when this computer is not signed in ``` With `--json`, `account.signedIn` is `true` or `false`. *** ## Sandbox lifecycle ### `boat new` Create a new sandbox. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new [--ttl SECONDS] boat new --type small boat new --type xlarge boat new --no-auto-stop boat new --env KEY=VALUE --env OTHER=VALUE boat new --no-env boat new --no-snapshots boat new --no-monitoring boat new --fail-fast boat new --setup-file ./setup.sh boat new --environment users boat new --from web-stack boat new --from web-stack --count 50 boat new --count 20 boat --org acme new boat org switch acme boat new boat new --personal boat new --name "api worker" boat new --from web-stack --visibility private --host 3000 --host 8080:public --file workspace/.env=./session.env ``` | Flag | Default | Maximum | | - | - | - | | `--type` | `default` (the medium size) | `small`, `default`, `large` or `xlarge` (`xlarge` needs the \$100 plan or higher) | | `--ttl` | `3600` (1 hour): seconds until auto-stop, counted from start or resume. It is not an idle timeout: only a running Boat agent prompt pushes it back, not `boat exec` or SSH. | `2592000` (30 days) | | `--no-auto-stop` | off | no automatic stop | | `--env`, `-e` | none | 100 variables, 64KB total | | `--environment` | your default (`base`) | the name of one environment | | `--no-env` | off | none | | `--no-snapshots` | off | none | | `--no-monitoring` | off | none | | `--fail-fast` | off | none | | `--setup-file` | none | 64KB script file | | `--from` | none | one saved snapshot or share code | | `--count` | `1` | `1000` sandboxes, fresh or with `--from` | | `--personal` | off | bills you, not the active org | | `--name` | `Box `, or the snapshot name with `--from` | 120 characters | | `--visibility` | the org's default (`boat org default-visibility`) | `private` or `shared`, org sandboxes only | | `--host` | none | 50 ports, not with `--count` or `--fail-fast` | | `--file` | none | 32 text files, 256KB total | `--type` sets the machine size. A fork gets the size of its source sandbox, unless you pass `--type`. `boat resume --type` moves a sandbox to a different size. For the specifications and the hourly price of each size, see [Pricing](/pricing). > [!NOTE] > > On the [free trial](/free-trial), `--no-auto-stop`, a `--ttl` above 2 hours, `large` and `xlarge` are refused. `--env` sets environment variables on this sandbox only, on top of your dashboard secrets. When two variables have the same name, the value for this sandbox wins. See [Environments](/environments). `--environment ` sets the environment that the sandbox starts from: its repositories, secrets, and credentials. If you omit it, the sandbox uses your default. boat refuses an unknown name before it creates the sandbox, so a typo costs you nothing. `--environment` and `--env` are not related. The first selects an environment. The second sets a variable on this one sandbox. See [Environments](/environments). `--no-env` creates a sandbox that gets none of the secrets of your account. The sandbox also cannot act on your account or on other sandboxes. Use it for sandboxes that you give to your own users. SSH, SCP, desktop, snapshots, and public URLs still work. See [Environments](/environments). If you make many such sandboxes, use an environment marked safe for third parties instead. It applies the same protection to each sandbox that uses it, and the protection stays after forks and resumes. `--no-snapshots` creates a sandbox that boat never snapshots. When you stop it, boat erases it. See [Snapshots off](/data-retention/snapshots-and-monitoring-off#snapshots-off). `--no-monitoring` creates a sandbox for which boat keeps none of these: command output, process output, the process list, CPU and RAM samples. You still see the live output of a running command. See [Monitoring off](/data-retention/snapshots-and-monitoring-off#monitoring-off). `--fail-fast` creates the sandbox only if a machine of its type is ready now. It answers in about 1.5 seconds. If no machine is ready, it fails with `no_ready_machine`. boat then creates nothing, bills nothing, and counts nothing against your start limits. It works with `--from`. `boat fork` and `boat resume` also accept it. See [Fail fast](/machines/fail-fast). `--setup-file` reads a local shell script (UTF-8, up to 64KB). boat runs the script on the sandbox in the background after the sandbox is ready. The script never delays `ready`. To see the result, read `setupStatus` (`pending`, `running`, `done`, `failed`) and `setupError` in `boat info`. You can use it with `--from`. The script runs one time, as the user `user`, not as root. A resume does not run it again, and a fork does not copy it. Setup scripts of repositories are different: they run at every start. See [Setup scripts](/setup). `--personal` bills you, also when an org wallet is active. For daily use, run `boat org switch` one time. All later `boat new` commands use that wallet. To change the wallet for one create, run `boat --org new` or `boat --org personal new`. See [`boat org`](#boat-org). `--from ` starts the sandbox from a saved snapshot that you saved with `boat snapshot `, or from a saved snapshot of your org. The stack is then already installed. The sandbox does not get the environment of the source sandbox. Pass `--environment`, or the sandbox uses your default. This flag is not related to `boat env set-file --from`, which reads a local file. See [Saved snapshots](/snapshots/templates). A saved snapshot of a `--no-env` sandbox stays `--no-env`: every sandbox from it gets none of your environment secrets, even with `--environment`. `--env KEY=VALUE` still applies. To make a template that gets secrets, save it from a sandbox created without `--no-env`. `--name` sets the name that `boat list` and the dashboard show. To change it later, run `boat rename ID NAME`. `--visibility private` or `--visibility shared` sets who in the org can use the sandbox, before the sandbox gets a machine. Without it, the org's default applies. A personal sandbox is always private. To change it later, run [`boat share` or `boat unshare`](#boat-share-id-and-boat-unshare-id). `--host PORT` hosts a port on an HTTPS URL as part of the create, exactly like [`boat host`](#boat-host-id-port). The URL is private (it carries a token) unless you write `PORT:public`. Repeat the flag for more ports. boat prints each URL with the sandbox id. The ports are routed before the sandbox is ready, so a service that starts later answers as soon as it listens. `--file SANDBOX_PATH=LOCAL_FILE` writes a local text file on the sandbox. boat writes it after the disk of the sandbox is in place and before the sandbox reports `ready`, so `--setup-file` and your first command find it. A relative `SANDBOX_PATH` starts in `/home/user`. boat writes the files one time, at the first start. If a write fails, `setupStatus` is `failed` and `setupError` names the file. In the API, these flags are the `visibility`, `hostedPorts` and `files` fields of `POST /sandboxes`, and the create answers the URLs in `hostedPorts`. One request replaces the create, the unshare, one host call per port and one write per file. `--count ` with `--from` creates `n` sandboxes from the saved snapshot in one request. boat creates them together, which is faster than `n` separate `boat new` commands when you need many sandboxes at once. The command prints every sandbox id and returns. It does not wait until each sandbox is ready: watch them with `boat list`. Your start limits and your limit of active sandboxes count every sandbox of the batch. If the batch does not fit, boat creates none of it. `--count` does not work with `--fail-fast`. In the API, send `"count": n` in the body of `POST /sandboxes`. The answer lists the sandboxes in `sandboxes`. `--from bsh_...` uses a share code that another account gave you. The new sandbox is yours and bills your account. It does not get the per-sandbox variables of the owner. See [Share a snapshot with another account](/snapshots/templates#share-a-template-with-another-account). The command returns the sandbox ID, the IP, and the first state. For a long workflow without interruptions, disable auto-stop: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --no-auto-stop ``` See [Keep a sandbox running](/long-running-tasks). ### `boat list` List your sandboxes that are up or running, with their current state and ID. `boat list` without flags is the same as `boat list --filter r`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat list boat list --filter s boat list --filter sr boat list --all ``` Give `--filter` one or more state group letters: | Filter | Includes | | - | - | | `r` | Up/running sandboxes: `ready`, `cloning`, `idle`, `running` | | `s` | Stopped sandboxes: `stopped` | | `p` | Pending sandboxes: `init`, `provisioning` | | `t` | Stopping sandboxes: `stopping` | | `e` | Error sandboxes: `error` | You can combine letters. For example, `boat list --filter sr` lists stopped sandboxes and sandboxes that are up or running. To include all states, use `--all`. ### `boat rename ID NAME` Change the name of a sandbox. Only its creator can rename it. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat rename bx_f7k2q9hd "api worker" ``` ### `boat extend ID` Set the auto-stop timer of a running sandbox. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat extend bx_f7k2q9hd --hours 12 boat extend bx_f7k2q9hd --ttl 2592000 boat extend bx_f7k2q9hd --no-auto-stop ``` `--hours` and `--ttl` **set** the remaining time, counted from now. They do not add to the current timer. For example, `--hours 2` on a sandbox with 5 hours left leaves 2 hours. `--no-auto-stop` keeps the sandbox running until you stop it. The maximum is 30 days, or 2 hours on the [free trial](/free-trial). ### `boat info ID` Show the details of one sandbox: state, IP, desktop availability, and remaining TTL. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat info bx_f7k2q9hd ``` When the sandbox's kernel restarted on its machine, `boat info` shows a `rebooted:` line. Every process that ran at that time ended. `crash` means the system log ended with no shutdown, for example after a kernel panic. The API returns the same data as `lastReboot`. ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} rebooted: 2026-10-21T18:54:25.000Z (crash: journal ended without shutdown) ``` ### `boat stop ID` Stop a running sandbox. boat makes a snapshot of the disk, then stops billing. The CLI shows the state `stopping`, then `stopped`. The API reports the same states as `archiving` and `archived`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat stop bx_f7k2q9hd ``` `boat stop` never asks for confirmation. It accepts `--yes` (`-y`), so scripts can pass the same flag as for `boat delete`. > [!NOTE] > > `boat stop` returns while the sandbox is `stopping`. The snapshot takes a moment. Before you resume or fork it, poll `boat info` until the state is `stopped`. The stop prints its id (`operation.id`, for example `stop_3f9a1c2e7b4d5a60`). To read that stop later, pass the id to `--status`. The status is `pending`, `failing`, `completed` or `superseded`. `superseded` means that a resume ended the stop. You can still read old stops after a resume or a later stop. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat stop bx_f7k2q9hd --status stop_3f9a1c2e7b4d5a60 ``` **If boat refuses a stop.** A stop saves the disk first. If that save fails, boat does these things: 1. It refuses the stop and keeps the sandbox running, so your work is not lost. 2. It tries the save again automatically. 3. It sends you an email. **boat does not bill you for the time that your sandbox spends in that state.** The meter pauses automatically from the first failed attempt. See [When a stop is refused](/snapshots/stop#when-a-stop-is-refused). A refused stop stays pending until a save succeeds. Then the sandbox stops automatically. `--force` stops the sandbox now and keeps its last successful snapshot. All data written after that snapshot is lost permanently. Use it only after a stop failed. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat stop bx_f7k2q9hd --force ``` > [!WARNING] > > `--force` discards unsaved work. First, read the time of the last snapshot in `boat info`. Then you know exactly what you lose. ### `boat delete ID` Permanently delete a sandbox **and its snapshots**. boat force-stops the sandbox without a last snapshot. Then boat deletes from storage each snapshot chain that only this sandbox owns. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat delete bx_f7k2q9hd boat delete bx_f7k2q9hd --yes boat delete self --yes # from inside a sandbox ``` > [!WARNING] > > `boat delete` destroys data. You cannot resume, fork or recover a deleted sandbox. No list of deleted sandboxes exists to restore from. > > **If you want to use the data later, run `boat stop` instead.** A stopped sandbox is free and keeps its disk for 14 days. `boat resume` brings it back in the same condition. To keep it longer, save a saved snapshot with `boat snapshot `. The command asks you to confirm. To skip the question, pass `--yes`. In scripts (`--json`, or no terminal attached), `--yes` is necessary. Without it, the command refuses and does not wait. Deletion is not instant. boat must remove the machine before it can remove the data. The command does these steps: 1. It removes the sandbox from `boat list` immediately. 2. It prints the deletion operation id (`bdop_…`). 3. It follows that operation until it finishes. **What boat keeps.** boat keeps snapshot data that something else also uses. If boat deleted it, the other user of the data would break: * A sandbox that you **forked** from this one, or a **resume** of it, restores from the same physical snapshot objects. * A **saved snapshot** saved from this sandbox (`boat snapshot `) keeps its data. To remove those bytes too, run `boat snapshot rm `. boat releases the storage when the last sandbox or saved snapshot that uses a chain is gone. ### `boat deletion status OPERATION_ID` Read the status of a deletion that you started earlier, here or through the API. The status is `pending`, `processing`, `blocked` or `completed`. `blocked` is not a final state. It means that an attempt found something that it cannot finish yet. Usually, another sandbox still reads a snapshot. boat tries again automatically, with backoff. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat deletion status bdop_0123456789abcdef0123456789abcdef ``` See [Data retention and deletion](/data-retention). ### `boat resume ID` Resume a stopped sandbox from its last snapshot. Before the CLI prints its last `ready` event, it waits for two things: 1. A ready state. 2. A test command that does nothing and succeeds. This shows that the sandbox can run commands. The CLI does not wait for background hydration or setup scripts. The wait stops after 30 minutes. It fails on a final sandbox state or on an API error that cannot be retried. See [Snapshots](/snapshots). A resume always uses the newest snapshot. You cannot resume from an older snapshot. To keep a state that you can go back to, save a [saved snapshot](#boat-snapshot-id-name). ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat resume bx_f7k2q9hd boat resume --no-wait bx_f7k2q9hd && boat exec bx_f7k2q9hd "npm test" boat resume --fail-fast bx_f7k2q9hd boat resume --no-env bx_f7k2q9hd boat resume --type large bx_f7k2q9hd boat resume -e KEY=VALUE bx_f7k2q9hd boat resume --ttl 7200 bx_f7k2q9hd boat resume --no-auto-stop bx_f7k2q9hd ``` The sandbox must have a completed snapshot. This means that you stopped it correctly with `boat stop`. | Flag | What it does | | - | - | | `-e`, `--env` | Sets per-sandbox environment variables. It works the same as `boat new -e`. Repeat it for more values. A per-sandbox value replaces a dashboard variable with the same name. The set you pass **replaces** the current per-sandbox variables of the sandbox. | | `--environment ` | Moves the sandbox to a different environment when it resumes. | | `--no-env` | Removes your account secrets, and removes owner secrets that came from the snapshot. You cannot undo this. The sandbox stays no-env. | | `--type` | Resumes on a different machine size: `small`, `default`, `large` or `xlarge` (`xlarge` needs the \$100 plan or higher). | | `--ttl ` | Sets the lifetime of the resumed sandbox. | | `--no-auto-stop` | Turns auto-stop off. | | `--no-wait` | Returns when boat accepts the resume. It does not wait for `ready`. A `boat exec` sent right after waits up to 60 seconds for the sandbox by itself. This is the fastest way to run a command after a resume. | | `--fail-fast` | Resumes only if a machine is ready now. It answers in about 1.5 seconds. If no machine is ready, it fails with `no_ready_machine`, the sandbox stays stopped, and nothing counts against your start limits. | `--type`, `--environment` and `--no-env` change a stopped sandbox. On a running sandbox, boat refuses them with `sandbox_running_stop_first`. Run `boat stop`, wait for `stopped`, then resume with the change. Without `--environment`, the sandbox keeps the environment version that it had. A resume never moves a sandbox to a newer version without your command. boat refuses an unknown name before it changes anything. The new environment can withhold a secret that the sandbox has now. boat then removes that secret from the disk during the resume, and it does not come back. See [Environments](/environments). Without `--type`, the sandbox keeps its current size. boat refuses to shrink a sandbox that has more data than the smaller machine can hold. The sandbox then stays as it was. See [Sandbox sizes](/machines). Without `--ttl` and `--no-auto-stop`, the sandbox keeps its current setting. A resume never makes the lifetime shorter or longer without your command. A resume is like a server reboot. The systemd services that you enabled start again automatically. Processes that you started by hand do not come back: dev servers, background jobs, tunnels, desktop sessions. Start them again, or make them systemd services. ### `boat recover ID` > [!WARNING] > > Deprecated. boat removes this command soon. After a kernel crash, the machine restarts by itself in about 15 seconds. If a sandbox still does not answer, run `boat stop --force ID`, then `boat resume ID`. You lose what was written after the last good snapshot. Read [A sandbox does not answer](/troubleshooting#a-sandbox-does-not-answer). Power-cycle the machine of a sandbox that does not respond. boat does not touch the disk. Usually the sandbox answers again in 1-2 minutes. boat refuses a recover in these cases. Resume the sandbox instead. * The sandbox answers normally. * A recover started less than 10 minutes ago. * boat cannot power-cycle its machine. This command does the same as `POST /sandboxes/{id}/recover` and Recover in the dashboard. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat recover bx_f7k2q9hd ``` ### `boat fork ID` Copy a sandbox from its latest snapshot into a new, independent sandbox. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat fork bx_f7k2q9hd boat fork --no-env bx_f7k2q9hd boat fork --type small bx_f7k2q9hd boat fork -e TENANT_ID=acme bx_f7k2q9hd boat fork --ttl 600 bx_f7k2q9hd boat fork --no-auto-stop bx_f7k2q9hd boat fork --fail-fast bx_f7k2q9hd boat fork --no-snapshots --no-monitoring bx_f7k2q9hd ``` The command returns the new sandbox ID asynchronously (HTTP 202). The source sandbox must have a completed snapshot. A fork copies the newest snapshot of the source into a new sandbox. A fork of a running sandbox uses its last background snapshot, so files written after that snapshot can be missing. To fork an exact state, stop the source first, or save a [saved snapshot](#boat-snapshot-id-name) and run `boat new --from `. The systemd services that you enabled start automatically, as on a resume. Processes that the source sandbox started by hand are not in the fork. Start them again in the fork if necessary. boat never changes the source sandbox. | Flag | What it does | | - | - | | `--type` | Gives the fork a machine size that is different from its source. | | `--ttl `, `--no-auto-stop` | Set the lifetime of the fork. | | `--environment ` | Puts the fork on a different environment. | | `--no-env` | Makes the fork a no-env sandbox. | | `--no-snapshots` | boat never snapshots the fork. Stopping the fork erases it. Same as `boat new --no-snapshots`. | | `--no-monitoring` | boat keeps no command output, process list or CPU and RAM samples for the fork. Same as `boat new --no-monitoring`. A fork of a sandbox with monitoring off keeps it off. | | `-e`, `--env` | Sets per-sandbox environment variables on the fork. It works the same as `boat new -e`. | | `--fail-fast` | Forks only if a machine is ready now. If none is ready, it fails with `no_ready_machine` and creates nothing. See [Fail fast](/machines/fail-fast). | | `--wait` | Waits until the fork is ready, like `boat new`. With `--json`, it prints the same event lines as `boat new` (`created`, `state`, `ready`). | A fork does **not** get the lifetime of its source. The default is 1 hour. So a fork of a sandbox with auto-stop off does not make another sandbox that nothing stops. Without `--environment`, the fork gets exactly the environment version of its source. A fork never gets configuration that its source did not have. See [Environments](/environments). A fork of a no-env source is always no-env. The variables that you pass with `--env` **replace** the per-sandbox variables that the fork gets from the source sandbox. Without `--env`, the fork gets them unchanged. ### `boat events ID` Read the work of the agent on a sandbox: prompts and responses. By default, the command streams **all conversations** on the sandbox. Each event has a `conversationId`, which you see with `--json`. To keep polling for new events, add `--follow`. To watch one conversation, add `--convo`. > [!NOTE] > > These events are the conversations of the agent, not the lifecycle of the sandbox. A sandbox that never got a prompt returns an empty list, also after it started, stopped and resumed. For the lifecycle state, use `boat info`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat events bx_f7k2q9hd boat events bx_f7k2q9hd --follow boat events bx_f7k2q9hd --convo # just one conversation boat events bx_f7k2q9hd --convo current # this shell's current conversation ``` | Flag | Description | | - | - | | `-f`, `--follow` | Continue polling and printing new events until interrupted | | `--convo ` | Only stream this conversation (or `current`). Repeat for several. Omit to stream all conversations. Alias `--conversation` | ### `boat conversations [id]` List the conversations of a sandbox. The conversation with the most recent prompt comes first. Each row shows these values: * The id. * The last activity. * The number of prompts. * If a turn is running. * The last harness and model. * A preview of the last prompt. Alias: `boat convos`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat conversations boat convos bx_f7k2q9hd boat conversations bx_f7k2q9hd --json # one JSON line per conversation ``` ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} ID When Prompts Running Harness/model Last prompt 8f1c2b7a-3d4e-4f5a-9b0c-1d2e3f4a5b6c just now 1 yes pi/claude-sonnet-5 Investigate the flaky CI job [sandbox current, this shell] 2c0d9e4b-7a1f-4c3e-8b5d-6e7f8a9b0c1d 4 mins ago 2 no claude Now add tests ``` Two markers can come after the last prompt: | Marker | Conversation | | - | - | | `sandbox current` | The one that `boat prompt` without flags continues from any shell. This is the conversation of the sandbox with the most recent prompt. | | `this shell` | The one that `boat prompt` without flags continues from this shell. | Copy an id into one of these commands: * `boat prompt --resume ` * `boat steer --convo ` * `boat events --convo ` * `boat interrupt --convo ` ### `boat steer ID MESSAGE` Send a message to a turn that is **already running**, and do not stop it. The agent uses the message and continues its work. There are three options: | Command | What happens to the running turn | | - | - | | `boat prompt` | Waits for the turn to end. | | `boat steer` | Adds your message to the turn. | | `boat interrupt` | Discards the turn. | ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat steer "Skip the integration tests, the unit tests are enough" boat steer bx_f7k2q9hd "Also update the changelog when you are done" boat steer bx_f7k2q9hd --convo "Focus on the auth module first" boat steer --convo current "Stop after the first failure" ``` Without `--convo`, the command steers the conversation that this shell prompted last. This is the same conversation that `boat prompt` without flags continues. If the conversation has no running turn, boat refuses the steer with `no_running_turn`. Use `boat prompt` in that case. How each harness handles a steer: | Harness | What happens | | - | - | | Claude Code, Codex, pi, Prime Agent | The harness adds the message to the running turn natively. Nothing is interrupted. If the harness accepts the message but the turn ends before it uses the message, boat immediately continues with a new turn on the same session. So the agent always acts on a steer. | | OpenCode | OpenCode cannot take a message during a turn. boat stops that turn and immediately continues the same conversation with your instruction. The conversation keeps all of its memory. | The `native` field of the JSON output tells which path ran. The steer shows in `boat events` as a `steer` event with the final `mode`: `native`, `native-continued`, `fallback` or `late`. See [Integrated agents](/integrated-agents). | Flag | Description | | - | - | | `--convo ` | Steer this conversation (or `current`). Omit to steer the one this shell last prompted. Alias `--conversation` | ### `boat interrupt ID` Interrupt the running agent work in a sandbox. By default, the command stops **all conversations** on the sandbox. To stop only one, use `--convo`. The other conversations keep running. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat interrupt bx_f7k2q9hd boat interrupt bx_f7k2q9hd --convo # stop just one conversation boat interrupt bx_f7k2q9hd --convo current ``` | Flag | Description | | - | - | | `--convo ` | Interrupt only this conversation (or `current`). Omit to interrupt the whole sandbox. Alias `--conversation` | *** ## Access ### `boat ssh ID [command]` Open an SSH session in a sandbox, or run one command without a session. The CLI manages the key at `~/.ssh/ascii_box_ed25519` automatically. The file name is old, but it is the current key. For one command, `boat exec` is faster than `boat ssh`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ssh bx_f7k2q9hd boat ssh bx_f7k2q9hd "cd /home/user/my-repo && npm test" boat ssh bx_f7k2q9hd -- bash -lc "cd /home/user/my-repo && npm test" boat ssh bx_f7k2q9hd -- bash -s < ./setup.sh boat ssh -t bx_f7k2q9hd -- tmux attach ``` A command runs without a terminal. Pass `-t` (`--tty`) before the ID to give it one: `tmux attach`, `read -s` prompts and full-screen tools need it. ### `boat exec ID [command...]` Run a command in a sandbox through the boat API. You do not need an SSH session or a key. `boat exec` exits with the exit code of the remote command, so you can use it directly in scripts and CI. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_f7k2q9hd "npm test" boat exec bx_f7k2q9hd --cwd my-repo --timeout 120 -- npm run build boat exec bx_f7k2q9hd bash -lc 'echo "$HOME" && ls' boat exec bx_f7k2q9hd --stream --timeout 600 "npm test" ``` One argument runs as a shell command line. More than one argument runs as argv. Each argument keeps its quoting, as with `boat ssh`. | Flag | Default | Description | | - | - | - | | `--cwd ` | sandbox work directory | Working directory, relative to the sandbox work directory (`/home/user`) | | `--timeout ` | `30` | Stop the command after this many seconds and exit `124`. `0` = no limit. Above `600`, or `0`, the output streams live | | `--stream` | off | Print stdout and stderr as the command writes them, not when it ends. Same exit code. With `--json`, one JSON frame per line | | `--detach` | off | Run in the background and print the process id | | `--status ` | none | Show status and logs of a process started with `--detach` | | `--kill ` | none | Stop a process started with `--detach`, and every process it started | | `--attach ` | none | Print the output of a process started with `--detach` as it writes it, from its start, until it ends. Exits with its exit code. Reconnects every 10 minutes with no gap | A command sent while the sandbox starts (for example right after `boat resume --no-wait`) waits up to 60 seconds for the sandbox. If the sandbox is still not ready, boat returns `sandbox_starting`. Retry it. The default timeout is 30 seconds. For a long job, give a longer timeout, or `0` for no limit: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_f7k2q9hd --timeout 0 -- make -j16 test # runs until it ends boat exec bx_f7k2q9hd --timeout 7200 -- ./train.sh # stops after 2 hours, exit 124 ``` Above 600 seconds, or with `0`, the CLI starts the command in the background and prints its output live until it ends. The command keeps running through network cuts, and the CLI reconnects with no gap. It exits with the exit code of the command. Ctrl-C stops the command. A job that a shell script starts with `&` ignores SIGINT. This is the standard rule when a shell has no job control ([bash manual](https://www.gnu.org/software/bash/manual/bash.html#Signals)). `kill -INT ` then has no effect on that job. Stop it with `kill -TERM `, or run `set -m` in the script before you start the job. A server or a job that must outlive the CLI needs `--detach`. To start it now and read it later: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} pid="$(boat exec bx_f7k2q9hd --detach "npm run build" | jq -r .processId)" boat exec bx_f7k2q9hd --status "$pid" boat exec bx_f7k2q9hd --attach "$pid" # follow the output live until it ends ``` `--detach` starts the command in the background and returns a JSON object. Take `processId` from it, as in the example. When you pipe or capture the output, `--json` turns on automatically. So in a script you always get JSON here, also without the flag. The output goes to `~/.ascii/processes/.log` on the sandbox. `--status ` prints these values: * If the process still runs. * The exit code, after the process ends. * The last lines of stdout and stderr. If the agent of the sandbox restarts (stop and resume), the status changes to `lost`. The log files stay on the disk. See [Background commands](/long-running-tasks/background-commands). ### `boat run [command...]` Run one command in a new sandbox, then delete the sandbox. `boat run` creates the sandbox, copies your directory in, runs the command, prints its output live, prints the time and the cost, and deletes the sandbox. It exits with the exit code of the command. Use it as a CI step for an agent. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat run -- npm test boat run --from ci-base --type xlarge --push . -- make -j16 test boat run --push ./api --timeout 1800 -e NODE_ENV=test -- bun test ``` The last line goes to stderr: ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} exit 0 · 4m 12s · xlarge · $0.0140 · bx_f7k2q9hd deleted ``` | Flag | Default | Description | | - | - | - | | `--from ` | none | Start from a saved snapshot or a share code | | `--type ` | `default` | `small`, `default`, `large` or `xlarge` | | `--push ` | none | Copy this local directory to `/home/user/` first, and run the command there. See `boat push` | | `--cwd ` | the pushed directory, else `/home/user` | Working directory, relative to `/home/user` | | `--timeout ` | no limit | Stop the command after this many seconds and exit `124` | | `-e`, `--env KEY=VALUE` | none | A variable for the sandbox. Repeat it for more | | `--environment ` | your default | The environment the sandbox starts from | | `--keep` | off | Keep the sandbox after the command ends. It stops 15 minutes later. Run `boat extend` to keep it longer | | `--personal` | off | Bill your personal account when an organization wallet is active | | `--no-env` | off | The sandbox gets none of your account's stored secrets. Same as `boat new --no-env` | An option that `boat run` does not have is an error, and no sandbox is created. To run a command that starts with `-`, put `--` before it. `boat exec` and `boat ssh` follow the same rule. The command output passes through as is, also when you pipe it. `--json` prints one JSON frame for each output chunk, then a `summary` line with `exitCode`, `elapsedSeconds`, `dollars`, `sandboxType` and `deleted`. The sandbox has auto-stop 15 minutes ahead, and `boat run` moves it forward while the command runs. If the CLI dies, the sandbox stops by itself. Without `--keep`, the sandbox has no snapshots, so a stop erases it. Ctrl-C deletes the sandbox. ### `boat push ID DIR` Copy a local directory into a sandbox, as one archive over SSH. In a git repository, the CLI sends the files that git tracks and the new files that `.gitignore` does not exclude. So `node_modules`, build output and `.git` stay on your computer. Outside a git repository, it sends every file except `.git`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat push bx_f7k2q9hd . boat push bx_f7k2q9hd ./api --to /srv/api ``` | Flag | Default | Description | | - | - | - | | `--to ` | `/home/user/` | The directory on the sandbox. boat creates it if it does not exist | Files that exist on the sandbox are replaced. Files that you deleted on your computer stay on the sandbox. Executable bits and symbolic links stay. On Windows, the executable bit comes from git. ### `boat history ID [command-id]` List the commands that ran in a sandbox, newest first. With a command id, print the stored output of that command. This works while the sandbox is stopped. | What | boat keeps it for | | - | - | | Commands run through `boat exec` or the API | 90 days | | The output of all other processes in the sandbox | 72 hours | ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat history bx_f7k2q9hd boat history bx_f7k2q9hd --mode commands boat history bx_f7k2q9hd cmd_k3v9x2mq7tbw --stderr boat history bx_f7k2q9hd cmd_k3v9x2mq7tbw --follow ``` | Flag | Default | Description | | - | - | - | | `--limit ` | `20` | How many commands to list, at most 100 | | `--mode ` | all | Only these, comma-separated: `commands` (what you ran), `process` (every other process), or `sync`, `stream`, `detached` | | `--stderr` | off | Print stderr instead of stdout | | `-f`, `--follow` | off | Keep printing new output until the command ends | See [Command history and logs](/long-running-tasks/command-history). ### `boat ps ID` List the processes in a sandbox, busiest first: pid, CPU, memory, user, history record and command line. To read the output of a process, pass its HISTORY id to `boat history`. For a stopped sandbox, the command shows the last sample that boat kept, with its time. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ps bx_f7k2q9hd boat ps bx_f7k2q9hd --json ``` ### `boat env` Manage the environments that new sandboxes start from: repositories, secrets, and the credentials that a sandbox can use. Each change makes a new version that you cannot change. Running sandboxes stay on their start version until you run `boat env upgrade`. See [Environments](/environments). > [!WARNING] > > `--environment` and `--env` are different. `boat new --environment staging` sets the environment that the sandbox uses. `boat new --env KEY=value` sets one variable on that one sandbox, on top of what the environment gives it. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env list boat env info base boat env new staging boat env rename staging prod boat env default prod boat env rm staging ``` | Command | Description | | - | - | | `boat env list` | Your environments, with the default marker, latest version, and live sandboxes per version | | `boat env info ` | One environment in full: toggles, variables, secret files, repos, versions | | `boat env new ` | Create an environment. Starts with everything injected | | `boat env rename ` | Rename. Sandboxes stay pinned to their versions | | `boat env default ` | Make it the environment new sandboxes use when none is named | | `boat env rm ` | Soft delete. Pinned sandboxes keep running. New sandboxes cannot use it | #### `boat env set NAME` Change what the environment injects. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set base --safe-for-third-parties true boat env set base --github true --secrets false ``` | Flag | Description | | - | - | | `--safe-for-third-parties ` | Master switch. `true` withholds all of your secrets: variables, secret files, GitHub, AI credentials, and the setup scripts of repositories. It overrides every flag below | | `--github ` | Your GitHub access: token and repository clones | | `--secrets ` | Your environment variables and secret files | | `--boat-credentials ` | The in-sandbox boat CLI credentials, so the sandbox can manage its own lifecycle | | `--agents-credentials ` | Your agent provider logins (Claude, Codex, and so on) | | `--credential-profile ` | The [credential profile](/ai-credentials#credential-profiles) the sandboxes get. `default` = the sandbox owner's default profile | | `--proxy-ai-credentials ` | With `--safe-for-third-parties true`: still pass AI credentials, as proxy placeholders. Needs `boat ai proxy on` for the profile owner | #### Organization environments Add `--org ` to any `boat env` command to work on the organization's shared environments. Members read and use them. Owners and admins change them. Without `--org`, `boat env` works on your own environments. See [Environments](/environments/manage#organization-environments). ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env list --org acme boat env set agents --org acme --credential-profile team-claude boat env access agents --org acme --only a@x.com,b@y.com ``` | Command | Description | | - | - | | `boat env access [--org ]` | Show who can use the environment | | `boat env access --everyone` | Every member can use it. This is the default | | `boat env access --only ` | Only owners, admins and these members. Comma-separated emails. Replaces the list | | `boat env access --add ` / `--remove ` | Add or remove one member | Owners and admins only. See [Limit who can use an environment or profile](/organizations#limit-who-can-use-an-environment-or-profile). #### Contents ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set-var base STRIPE_KEY=sk_live_123 printf %s "$STRIPE_KEY" | boat env set-var base STRIPE_KEY # value from stdin, not on the command line boat env rm-var base STRIPE_KEY boat env set-file base backend/.env --from ./local.env cat ./local.env | boat env set-file base backend/.env boat env rm-file base backend/.env boat env add-repo base octocat/hello-world --branch develop boat env rm-repo base octocat/hello-world ``` On an environment that is safe for third parties, `set-var` and `set-file` save the value and print a `warning:` line on stderr: boat does not inject the value into sandboxes. `boat env info` then shows `no (withheld: safe for third parties)` for that toggle. To check what a sandbox really gets, run: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec 'echo $STRIPE_KEY' ``` `set-file` reads the contents from `--from `. Without `--from`, it reads from stdin. Paths are relative to the sandbox work directory (`/home/user`). #### `boat env upgrade NAME` Move the sandboxes of this environment to its latest version. * Live sandboxes get the new configuration immediately. First, boat removes from the machine each secret that the new version withholds. * Stopped sandboxes get it when they resume. * Nothing upgrades without this command. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env upgrade base ``` > [!WARNING] > > boat deletes a withheld secret from the disk of the sandbox. It does not hide it. If you pin the sandbox to the older version again, the secret does not come back. ### `boat host ID PORT` Expose a service that runs in a sandbox on a stable HTTPS URL. You do not open an SSH session. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat host bx_f7k2q9hd 3000 boat host bx_f7k2q9hd 3000 --title "Login preview" boat host bx_f7k2q9hd 3000 --public boat host bx_f7k2q9hd 5173 --localhost boat host bx_f7k2q9hd 3000 --json ``` The command opens the sandbox firewall, registers the HTTPS subdomain, and prints the URL: `https://-.on.boat.dev`. If you run it again for the same sandbox and port, you get the same URL. Start the service first, with `boat exec --detach ""`. A private URL carries `?_token=`. Anyone who has the full URL can open it. The token URL answers with a redirect and a cookie, so use `curl -L -c jar -b jar ''`. See [Public URLs](/hosting). | Flag | Default | Description | | - | - | - | | `--title ` | none | Set the display title for the hosted port. | | `--private` | on | Require the generated `_token` query parameter to access the URL. | | `--public` | off | Clear any saved access token and return a URL that does not require `_token`. | | `--localhost` | off | The service listens on `localhost`, `127.0.0.1` or `::1` only. The sandbox relays the URL to it. Leave it off for a service on `0.0.0.0`. See [Services that listen on localhost](/hosting/how-it-works#services-that-listen-on-localhost). | ### `boat scp` Copy files to or from a sandbox. Use `bx_<id>:/path` as the remote address. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} # Download a file boat scp bx_f7k2q9hd:/home/user/output.zip ./output.zip # Upload a file boat scp ./local-file.txt bx_f7k2q9hd:/home/user/ # Copy a directory recursively boat scp --recursive ./my-project bx_f7k2q9hd:/home/user/ ``` | Flag | Description | | - | - | | `--recursive` | Copy directories recursively | On macOS and Linux, a recursive copy to a new directory can send one archive over SSH. This needs `tar` on both ends. It removes one network round trip for each file. You see the new directory only after the full transfer. These copies use the installed OpenSSH `scp`: * Single files. * Merges into a directory that exists. * Trees that the archive mode does not support. ### `boat forward ID` Forward one TCP port from a sandbox to your computer. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat forward bx_f7k2q9hd --remote 8080 boat forward bx_f7k2q9hd --remote 3000 --bind 0.0.0.0 ``` | Flag | Default | Description | | - | - | - | | `--remote <port>` | required | Remote port on the sandbox | | `--local <port>` | same as remote | Local port to bind | | `--bind <addr>` | `127.0.0.1` | Local bind address | #### `--reverse`: reach your machine from the sandbox `--reverse` sends the tunnel in the other direction. A port on your computer becomes available inside the sandbox at `127.0.0.1:<remote>`. An agent in the sandbox can then call an MCP server, a local model, or a webhook receiver that stays on your laptop. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} # your app on localhost:7777 answers at 127.0.0.1:7777 inside the sandbox boat forward bx_f7k2q9hd --reverse --local 7777 # a local model on 11434 shows up inside the sandbox on 11500 boat forward bx_f7k2q9hd --reverse --local 11434 --remote 11500 ``` | Flag | Default | Description | | - | - | - | | `--local <port>` | required | Port on your computer to expose | | `--remote <port>` | same as local | Port the sandbox listens on | | `--bind <addr>` | `127.0.0.1` | Bind address **inside the sandbox**. Anything other than loopback needs `GatewayPorts` enabled on the sandbox's sshd | Both directions run in the foreground until you press Ctrl+C. The tunnel can stop because the sandbox moved. For example, `boat stop` then `boat resume` brings the sandbox back on a new IP. The CLI then gets the connection again and tries up to five times before it stops. A failure at startup, for example a port that is already in use on the other side, shows immediately. The CLI does not try again. Neither direction makes anything public. The tunnel uses the same SSH session as `boat ssh`, and the sandbox side listens on loopback only. For a public HTTPS URL for a port inside the sandbox, use [`boat host`](#boat-host-id-port). ### `boat desktop ID` Open the desktop streaming URL of the sandbox in your browser. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat desktop bx_f7k2q9hd ``` The desktop streams over Moonlight (60fps WebRTC). The JSON output has `viewerUrl`. It carries the desktop token in its query string. Treat it as a secret. ### `boat browser ID` Get a stream that shows only the browser of the running sandbox. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat browser bx_f7k2q9hd boat browser bx_f7k2q9hd --profile /data/chrome-profile ``` | Flag | Default | Description | | - | - | - | | `--profile <path>` | a managed dir on the sandbox | Absolute path on the sandbox used as the Chrome user data dir (the Chrome profile). | With `--profile`, you can keep more than one signed-in Chrome profile on one sandbox. You select one profile for each stream. boat creates the directory and gives it to the browser user. The path must be absolute and outside system directories. It must not be under `/home/user`, because the browser sandbox hides that path with an empty directory. The profile is on the sandbox filesystem, so snapshots and forks keep it. When you change the profile, Chrome restarts and the stream stays up. Sandboxes created before this feature return `chrome_profile_unsupported`. To use the flag, create the sandbox again on a current image. The stream has these properties: * 1920x1080 at 60 fps. * It shows Chrome with tabs and an address bar. * It uses a separate streaming process and identity. * It does not give access to the desktop clipboard bridge. * It does not create a separate sandbox. * It cannot fall back to the desktop. * The window-close controls are hidden. Mute, reconnect, and fullscreen stay on the viewer. Behavior: * When you close the last tab, Chrome opens a new tab and the stream stays up. * When you run the command again, the live stream stays up. * When you open the new URL in a second tab, it replaces the first tab and keeps the same Chrome session. * New sandboxes get the browser-view files when boat provisions them. Keep the URL secret. This feature limits the display and the input. It does not isolate the browser from the sandbox. Code that already runs in the sandbox can read or change the browser process and its data. This is especially true for code with root access. *** ## Snapshots ### `boat snapshots [id]` List the snapshots of all your sandboxes, or of one sandbox. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshots boat snapshots bx_f7k2q9hd boat snapshots bx_f7k2q9hd --limit 50 boat snapshots --all ``` | Flag | Description | | - | - | | `--limit <n>` | How many snapshots to read per page | | `--all` | Read every page, not only the first | Resume and fork always use the newest snapshot. Older snapshots expire after about one day, and you cannot restore them. To keep a state, save a saved snapshot. ### `boat snapshot ID NAME` Save the disk of a sandbox under a name. `boat new --from <name>` can then deploy it as many times as you want. To replace a saved snapshot, use its name again. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshot bx_f7k2q9hd web-stack boat snapshot self web-stack # from inside a sandbox boat snapshot rm web-stack # remove it and release its storage ``` A save from a running sandbox first makes a new capture, so it can take minutes. The CLI polls until the snapshot is `ready`. 10 saved snapshots are free. Each one more costs \$0.056 a day from the wallet. See [Saved snapshots](/snapshots/templates). ### `boat snapshot share|shares|unshare` Give another boat account a secret code that deploys one of your saved snapshots. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshot share web-stack # make a code; it shows once boat snapshot shares web-stack # list codes, use counts, status boat snapshot unshare web-stack shr_... # revoke one code boat new --from bsh_... # the other account deploys it ``` `share` prints the full code one time only. Save it immediately. boat removes these items from the sandbox of the other account: your logins, API keys, secret files, repository clones and SSH keys. The other account gets all other data on the disk. See [Share a snapshot with another account](/snapshots/templates#share-a-template-with-another-account). ### `boat snapshot latest|tree|pull` Look inside a snapshot or download it. This works while the sandbox is stopped. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshot latest bx_f7k2q9hd boat snapshot tree <snapshotId> # files and sizes boat snapshot pull <snapshotId> -o ./restore # download and reassemble (long form --out) boat snapshot pull <snapshotId> -o ./restore --path /home/user/project/report # extract one file or folder; repeat --path for more ``` `pull` writes `home_user/` (your `/home/user`) and `docker/` (named volumes). See [Snapshots](/snapshots). `pull` recreates symlinks that stay inside `home_user/` and `docker/`. On every platform it skips a link that points outside that tree, such as `/etc`, or one that resolves through another symlink. On Windows it also skips links unless Developer Mode is on or the shell runs as administrator. It prints how many entries it skipped. ### `boat snapshot delete SNAPSHOTID...` Permanently delete ordinary filesystem snapshots. The command accepts all snapshots, and the snapshot disappears immediately. boat erases its stored data in the background when nothing reads it. A newer snapshot that you keep can be built on it. Then its data stays until that newer snapshot is deleted too. `--all <sandboxId>` deletes all ordinary snapshots of a sandbox and keeps the sandbox. To remove a saved snapshot, use `boat snapshot rm <name>` instead. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshot delete <snapshotId> boat snapshot delete <snapshotId> <snapshotId> --yes boat snapshot delete --all bx_f7k2q9hd ``` See [Data retention and deletion](/data-retention). *** ## AI agents ### `boat prompt [id]` Send a prompt in natural language to an AI agent in the sandbox. * Without an ID, the prompt goes to the current sandbox of your shell (the last `boat new` or `boat fork` there). If you run the CLI inside a sandbox, it goes to that sandbox. * Without `--provider`, the prompt uses the default harness and model from the dashboard (Agents & Proxying). * Before the first prompt, connect a key or a subscription on the dashboard (Agents & Proxying). Without it, the prompt fails and the CLI exits with code 1. See [Keys and subscriptions](/integrated-agents/keys). ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt "Fix the failing tests in this repo" boat prompt bx_f7k2q9hd --provider claude "Fix the failing tests in this repo" boat prompt bx_f7k2q9hd --provider codex --model gpt-5.4-mini --reasoning-effort xhigh "Refactor auth module" boat prompt bx_f7k2q9hd --provider codex --model gpt-6.1-sol --fast "Refactor auth module" boat prompt --attach ./error.png --attach ./trace.log "Why does this crash?" ``` | Flag | Required | Values | | - | - | - | | `--provider` | no | One of the 7 harnesses: `claude`, `codex`, `pi`, `opencode`, `prime`, `kimi`, `mistral`. Default: the default harness on the dashboard (Agents & Proxying) | | `--model` | no | Provider-specific model name. Default: the model selected for that harness on the dashboard (Agents & Proxying) | | `--reasoning-effort` | no | Provider/model-specific thinking level such as `none`, `low`, `medium`, `high`, `xhigh`, or `max`. The accepted levels differ for each model. Some models have none | | `--fast` | no | No value. Run this prompt in fast mode: same model, faster output, billed by the provider at its higher fast rate. Only fast-capable models accept it. Default: the choice saved on the dashboard (Agents & Proxying) for that model | | `--new` | no | Start a new conversation instead of continuing this shell's current one | | `--resume <id>` | no | Continue a specific conversation by id (or `current` for this shell's) | | `--attach <path>` | no | Attach a file (image, PDF, any file). Repeat for multiple. Alias `--image`. Saved on the sandbox under `~/attachments`. Images are also sent to vision-capable models | | To get the current list of providers, models, and reasoning efforts from the boat API, run `boat prompt --help`. It lists the models that support fast mode under "Fast mode (--fast):". | #### Conversations (running agents in parallel) A sandbox runs **many conversations at the same time**. Each conversation has its own history. So one sandbox can run more than one independent agent task in parallel, for example different features, different users, or a demo. The tasks do not wait in a queue. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt --new "Start on the billing refactor" # conversation A boat prompt --new "Investigate the flaky test" # conversation B, runs alongside A boat prompt --resume <A> "Now add tests" # continue a specific conversation boat prompt "quick follow-up" # continues THIS shell's current conversation boat conversations # list them all, with ids to resume ``` * **`--new`** starts a new conversation and makes it the current conversation of this shell. Each prompt prints its conversation id directly under `queued:` (`conversation: <id>`, with `(new)` when `--new` created it). In `--json`, the id is in `conversationId`. * **`--resume <id>`** continues a specific conversation. `--resume current` continues the current conversation of this shell. * **No flag** continues the current conversation of this shell. The "current conversation" belongs to your shell, the same as the `current` sandbox id. Two shells (or two people) can prompt the same sandbox. Each one keeps its own conversation, and they do not interfere. * **[`boat conversations`](#boat-conversations-id)** lists all conversations on the sandbox with the id, the number of prompts, the running state and the last prompt. You can then resume a conversation from another shell or another day by its id. * Conversations run in parallel up to a limit for each sandbox. The limit increases with the memory of the sandbox. Above the limit, new prompts wait in a queue and start when turns finish. * You can continue a conversation with a different `--provider`. The history stays after the change. For how harnesses, conversations, the agent lifecycle, and parallel runs work together, with diagrams, see [Integrated agents](/integrated-agents). ### `boat ai` Manage AI credentials: credential profiles, API keys, custom APIs, the AI credentials proxy, usage, and blocking. `--org <org>` selects an organization for `proxy`, `usage` and `profile new`. See [AI credentials](/ai-credentials). ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ai accounts chatgpt-subscription # out of credits on this account? boat ai switch chatgpt-subscription 2 # every sandbox on the profile uses account 2 now boat ai proxy on boat ai profiles boat ai profile new work --copy-from default boat ai profile default work echo "$ANTHROPIC_API_KEY" | boat ai profile set-key work anthropic-api-key echo "$STRIPE_KEY" | boat ai profile set-api work STRIPE_KEY --base-url https://api.stripe.com/v1 boat ai usage bx_23456789 --days 7 boat ai block bx_23456789 ``` | Command | Description | | - | - | | `boat ai accounts <credential> [--profile <p>]` | The accounts of one credential, numbered, the one in use marked | | `boat ai switch <credential> <account> [--profile <p>]` | Switch the credential to another account: its number, email or last key characters. Every sandbox on the profile uses it at once, running ones included | | `boat ai add-account <credential> [value] [--profile <p>]` | Add another API key, ready to switch to. Reads stdin when the value is omitted or `-`. For another sign-in, use "Add another account" on the dashboard | | `boat ai forget-account <credential> <account> [--profile <p>]` | Delete an account. Forgetting the one in use switches to another account, or removes the credential if it was the last | | `boat ai proxy [on\|off]` | Show the proxy state and price, or turn it on or off. Running sandboxes switch at their next start | | `boat ai profiles [--org-only]` | The profiles you can use, yours and your organizations' | | `boat ai profile new <name> [--copy-from <profile>]` | Create a profile. With `--org`, the organization owns it | | `boat ai profile default <profile>` | Make the profile its owner's default. Sandboxes get it at their next start | | `boat ai profile rename <profile> <new-name>` | Rename a profile | | `boat ai profile access <profile> [--everyone\|--only <emails>\|--add <email>\|--remove <email>]` | Organization profiles: show or set which members can use it. Owner only. See [Limit who can use an environment or profile](/organizations#limit-who-can-use-an-environment-or-profile) | | `boat ai profile rm <profile>` | Delete a profile. Not the default, and not one an environment names | | `boat ai profile set-key <profile> <credential> [value]` | Set an API key, for example `anthropic-api-key`. Reads stdin when the value is omitted or `-` | | `boat ai profile rm-key <profile> <credential>` | Remove an API key or a sign-in, for example `claude-subscription` | | `boat ai profile set-api <profile> <NAME> --base-url <url> [--value <v>]` | Set a custom API. The sandbox gets `NAME` and `NAME_BASE_URL`. Reads stdin without `--value` | | `boat ai profile rm-api <profile> <NAME>` | Remove a custom API | | `boat ai usage [id] [--days N]` | Proxied usage: per sandbox for the account in scope, or per day and model for one sandbox. Default 30 days | | `boat ai block <id>` | Refuse the sandbox's AI placeholders, running or stopped. No effect on a sandbox with real keys | | `boat ai unblock <id>` | Accept them again | *** ## Account ### `boat limits` Show the start limit closest to full, the plan and the wallet in one line. When a limit is full, it shows what happened and the next command. A create, a fork, and a resume each count as one start. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat limits boat limits --all # every limit and every way past a full limit (--details is the same) boat limits --json ``` The `--all` output shows these values: * Remaining starts for each minute, hour and day. * The plan money left to run sandboxes, in dollars. * The wallet balance, in dollars. * The sandbox types that you can create now, and why each other type is blocked. ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} types: small, default large: not during the free trial; the first payment unlocks it xlarge: needs the $100/month plan or higher ``` `--json` prints the same payload as the API, with `starts.minute.remaining`, `wallet.balanceDollars`, `planIncluded.vmHoursRemaining`, `startLimitsWithWallet` and `machineTypes`. ### `boat usage ID` Show the machine time that one sandbox used and its cost, for its full life or for a time window. This works on running and stopped sandboxes. The value for a running sandbox increases until the sandbox stops. `running` in the JSON tells if the sandbox still runs. It is false after a stop, and also while a refused stop keeps the meter paused. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat usage bx_f7k2q9hd boat usage bx_f7k2q9hd --since 2026-09-01 --until 2026-10-01 boat usage bx_f7k2q9hd --json ``` | Flag | Default | Description | | - | - | - | | `--since <time>` | sandbox creation | Count from this time, ISO 8601 or Unix seconds | | `--until <time>` | now | Count up to this time, ISO 8601 or Unix seconds | The text output shows the billable machine time (with the multiplier of the sandbox type), the cost at list price, and the window. `--json` prints the API payload: `seconds`, `dollars`, `secondsPerDollar`, `sandboxType`, `billingMultiplier`, `since`, `until` and `running`. See [Per-sandbox usage](/billing#per-sandbox-usage). ### `boat dashboard` Open your web dashboard in the browser, already signed in. The link has a code that you can use one time. The code expires in 15 minutes and cannot call the API. It is never your sandbox token. So the link is safe in a terminal, a log, or a message. If you signed in with a service API key, the link opens the dashboard signed out. To create, rotate, or revoke API keys, you must sign in through the browser. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat dashboard ``` ### `boat org` Show, switch, create, transfer, or delete the **organization wallet** that new sandboxes bill to. An organization has one shared plan and one shared wallet. * `boat org switch` sets the active wallet of the account (`PATCH /orgs/active`). An account API key without `--org` bills the same wallet. The dashboard bills the organization selected in its sidebar. * `--org` (or `BOAT_ORG`) uses a different wallet for one command. * Name an organization by its id or its name, as `boat org list` shows them. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat org # show the active wallet (same as boat org status) boat org list # organizations you belong to, ids and names boat org switch acme # bill new sandboxes to acme, from the CLI, the dashboard and the API boat org switch personal # back to your own account boat --org acme new # bill one create to acme without switching boat --org personal new # bill one create to your account while an org is sticky boat org create "Acme" boat --org acme org transfer alice boat --org acme org delete --yes boat --org acme org migrate # move your personal plan and sandboxes into acme boat org members # members and pending invites of the org in scope boat org invite dana@example.com # owner only ``` For what members can do with the sandboxes of the organization, see [Organizations](/organizations). `boat org transfer`, `boat org delete` and `boat org migrate` act on the scope of the command. This is `--org` or `BOAT_ORG` if set. If not, it is the wallet from `boat org switch`. If you delete an org with `--org`, a different wallet from `boat org switch` stays active. `boat org migrate` is for an owner who paid personally before the organization existed. It does these things: * From that moment, each sandbox billed to your personal account bills the organization. * Your personal plan ends the same day. boat refunds the unused part of the month to your card. * The money in your personal wallet stays on your personal account. The organization must already have a plan. `boat --org acme billing plan 20 --move-personal` starts a plan and does the move in one step. ### `boat share ID` and `boat unshare ID` Make one of your organization sandboxes shared (every member can use it) or private (only you can use it). Members always see it and can stop it. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat share bx_f7k2q9hd # every member can use it boat unshare bx_f7k2q9hd # only you can use it, at once ``` * A sandbox that holds none of your personal logins changes at once, both ways. * A sandbox that holds your logins (GitHub token, model keys, secrets): `boat share` removes them at its next start, so members never act as you. If the sandbox runs, members can use it after you stop and resume it. Its running programs hold your logins in memory. The removal cannot be undone; `boat unshare` still makes the sandbox private again. * `boat unshare` removes members' SSH keys from the running sandbox. `boat list` shows `shared` or `private` next to your organization sandboxes. `boat info` shows it on the `org:` line. This is not `boat snapshot share`, which gives a saved snapshot to another account. The API calls are [Share sandbox with the organization](/api/reference/sandboxes/share-sandbox) and [Make an organization sandbox private](/api/reference/sandboxes/unshare-sandbox). ### `boat org default-visibility` Show or set whether new sandboxes of the organization start shared or private. Owners and admins set it. The default is `shared`. Existing sandboxes keep their setting. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat org default-visibility # shows the current value boat org default-visibility private # new sandboxes start private ``` ### `boat billing` Manage the plan of the wallet in scope. This is your personal account, or the organization from `boat org switch` or `--org`. A step that needs a card opens Stripe Checkout in your browser. The command waits until the payment is complete. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat billing # plan, renewal date, the fullest start limit, wallet, extra starts boat billing --all # also limits, prices, auto top-up and cards (--details is the same) boat billing plan # the tiers, with the current one marked boat billing plan 100 # switch to the $100/mo tier (prorated) or start it boat billing status # same as boat billing boat billing extra-starts on # pay per extra start on the next invoice when the wallet is empty (shows a summary, t shows the full terms; --yes accepts them) boat billing extra-starts off # extra starts use the wallet only boat billing portal # Stripe portal: card, invoices, VAT details, cancel boat billing cancel # cancel at the end of the paid month; offers to keep your disks 90 days boat billing cancel --keep-disks --yes # the same, without prompts boat --org acme billing plan 20 --move-personal # first org plan + bring your personal plan and sandboxes ``` The plan of an organization is per seat. `boat --org acme billing plan 100` bills \$100 × seats. The seats are the members. There are more seats if the owner bought extra seats on the dashboard. See [Organizations](/organizations/seats-and-limits#seats). Credit packs, prepaid balance and auto-refill are gone. `boat wallet` replaces them. ### `boat wallet` Show and fill the dollar wallet in scope. The wallet pays overage only: VM time past the plan, extra saved snapshots, extra starts and the AI proxy. It never pays the plan. See [Plan, wallet and running out](/billing#wallet). ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat wallet # balance, auto top-up, cards boat wallet pay 50 # add $50 once, in Stripe Checkout ($15 to $100,000) boat wallet auto-top-up 500 # add $500 each time the wallet runs low ($15 to $100,000) boat wallet auto-top-up off boat wallet card # add a card, in Stripe boat --org acme wallet pay 500 # the organization's wallet (owner only) ``` * A payment of \$200 or more gets a bonus of 2% to 25%. `boat wallet pay` shows it before you pay. * Auto top-up charges the card when the wallet drops below 10% of the amount, and never below \$5. It needs a saved card and a paid plan. ### `boat data-retention` Show or enable zero data retention (ZDR). With zero data retention, boat deletes each sandbox permanently when it stops. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat data-retention status boat data-retention enable boat data-retention enable --yes ``` To enable it, you need a browser sign-in session (`boat login` without a key). An API key does not work. See [Data retention and deletion](/data-retention). ### `boat self-update` Find and install the latest CLI release on your current channel. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat self-update ``` The local configuration is at `~/.config/ascii/boat/config.json`. `boat status` prints its path, the API URL in use, the account and the plan. # Compliance and uptime Source: https://docs.boat.dev/compliance SOC 2 status, platform uptime and the live status page, where data is stored, GDPR erasure, and how to report a security issue. | Topic | Answer | | - | - | | SOC 2 | In progress | | Sandbox uptime | 99.95%, measured over the history of all sandboxes | | Platform status | Live on [status.ascii.dev](https://status.ascii.dev) | | Where data is stored | Machines in Germany, Finland and France. Snapshot copies can be stored outside the EU. | | Erase your data (GDPR) | [Close your account](/data-retention/close-account) | | Report a security issue | [Support](/support) | ## Uptime Sandboxes have an uptime of 99.95%. boat measures this over the history of all sandboxes. * For the platform (the API, the dashboard, starts and stops), see the live status and its history at [status.ascii.dev](https://status.ascii.dev). * A sandbox that stops answering has its own recovery steps. Read [Troubleshooting](/troubleshooting#a-sandbox-does-not-answer). * For a production workload, write to [support](/support) before you launch. Tell us your expected starts per minute and sandboxes at once. ## Data location * Sandboxes run on machines in Germany, Finland and France. * Snapshot copies can be stored outside the EU. How long boat keeps each kind of data is on [Data retention](/data-retention#how-long-boat-keeps-data). ## Erase data | Need | Page | | - | - | | Erase one sandbox or snapshot | [Delete](/data-retention/delete) | | Keep nothing after a stop | [Zero data retention](/data-retention/zero-data-retention) | | Erase your whole account (GDPR right to erasure) | [Close your account](/data-retention/close-account) | ## Report a security issue Write to [support](/support). Put "security" in the subject. Do not post details in public channels such as Discord. For how boat isolates sandboxes and protects credentials, read [Security and isolation](/security). # Concepts Source: https://docs.boat.dev/concepts Every boat word defined once: sandbox, snapshot, saved snapshot, stop, resume, fork, delete, environment. The sandbox states, and the matching words at E2B, Daytona and Modal. boat gives you sandboxes. A sandbox is a full Linux virtual machine with its own disk. You stop it to stop paying. You can resume it with the same disk for at least 14 days. ## Lifecycle ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark-default"}} %%{init: {"theme": "base", "fontFamily": "IBM Plex Mono", "themeVariables": {"fontFamily": "IBM Plex Mono", "fontSize": "14px", "primaryColor": "#F1F3F9", "primaryBorderColor": "#263FA9", "primaryTextColor": "#060606", "secondaryColor": "#E0E3F2", "tertiaryColor": "#FEFEFE", "lineColor": "#060606", "textColor": "#060606", "mainBkg": "#F1F3F9", "nodeBorder": "#263FA9", "clusterBkg": "#FEFEFE", "clusterBorder": "#C4C4C4", "edgeLabelBackground": "#FEFEFE", "actorBkg": "#F1F3F9", "actorBorder": "#263FA9", "actorTextColor": "#060606", "actorLineColor": "#9E9E9E", "signalColor": "#060606", "signalTextColor": "#060606", "labelBoxBkgColor": "#F1F3F9", "labelBoxBorderColor": "#263FA9", "noteBkgColor": "#E0E3F2", "noteBorderColor": "#E0E3F2", "noteTextColor": "#060606", "sectionBkgColor": "#F1F3F9", "altSectionBkgColor": "#FEFEFE", "taskBkgColor": "#263FA9", "taskBorderColor": "#263FA9", "taskTextColor": "#FEFEFE", "gridColor": "#E0E0E0"}, "flowchart": {"padding": 16, "nodeSpacing": 48, "rankSpacing": 48, "curve": "linear"}, "sequence": {"boxMargin": 16, "actorMargin": 48, "noteMargin": 16, "messageMargin": 32, "mirrorActors": false}, "state": {"padding": 16}, "gantt": {"barHeight": 24, "barGap": 8, "fontSize": 14, "sectionFontSize": 14}}}%% stateDiagram-v2 [*] --> Starting: boat new / boat fork Starting --> Running: ready Running --> Stopping: boat stop / auto-stop Stopping --> Stopped: disk saved Stopping --> Running: boat resume (same machine) Stopped --> Starting: boat resume Stopped --> Starting: boat fork (new sandbox) Running --> Error: machine lost Error --> Starting: boat resume Running --> Deleted: boat delete Stopped --> Deleted: boat delete Error --> Deleted: boat delete Deleted --> [*] Starting: Starting (API provisioning, provisioned, cloning) Running: Running (API ready, idle, running) Stopping: Stopping (API archiving) Stopped: Stopped (API archived) Error: Error (API error) Deleted: Deleted (gone from lists) ``` | State | API state names | CLI and dashboard show | Billed | Disk | | - | - | - | - | - | | Starting | `provisioning`, `provisioned`, `cloning` | `provisioning`, `starting`, `cloning` | From `provisioned` | Restoring | | Running | `ready`, `idle`, `running` | same | Yes | On the machine, saved each minute | | Stopping | `archiving` | `stopping` | No | Last save in progress | | Stopped | `archived` | `stopped` | No | Saved for at least 14 days, then eligible for deletion | | Error | `error` | `error` | No | Held for 3 days | | Deleted | none | none | No | Erased | The API calls a stopped sandbox `archived`. It is the same state. Nothing is moved or deleted. `idle` and `running` differ only for the [integrated agent](/integrated-agents): `running` means a prompt runs now. Commands work in both. What works at `ready`, and what comes a few seconds later, is in [Readiness and resume speed](/readiness). ## Words | Word | Meaning | | - | - | | **Sandbox** | One Linux virtual machine that you create, with its own disk, IP address and id (`bx_...`). | | **Machine** | The hardware under a sandbox. A resume or a fork puts the sandbox on a new machine. | | **Size** | The CPU, memory and disk of a sandbox: `small`, `default` (the medium size), `large`, `xlarge`. Read [Machines](/machines). | | **Snapshot** | A saved copy of the disk. boat takes one every minute and one at each stop. Only the newest one is used. Read [Snapshots](/snapshots). | | **Saved snapshot** | A snapshot that you save under a name. It has no scheduled expiry; unpaid extras can be deleted. Start new sandboxes from it with `boat new --from <name>`. Read [Saved snapshots](/snapshots/templates). | | **Template** | Not a separate object. "Use a saved snapshot as a template" means: start many sandboxes from one saved snapshot. | | **Stop** | Save the disk, then remove the machine. A resume within 10 minutes usually gets the same machine back, with memory and running programs. After that, they are gone. There is no pause. A stopped sandbox costs nothing, and boat keeps its disk for at least 14 days. Read [Stop a sandbox](/snapshots/stop). | | **Auto-stop** | A timer that stops the sandbox. The default is 1 hour after the create or the last resume. Read [Auto-stop](/long-running-tasks/auto-stop). | | **Always on** | A sandbox with auto-stop turned off. It runs until you stop it. | | **Resume** | Start a stopped sandbox again, from its newest snapshot. Same id. Within 10 minutes of the stop, usually the same machine. After that, a new machine and a new IP address. | | **Fork** | Make a new sandbox that copies the newest snapshot of another sandbox. The source does not change. | | **Restore** | Get older files back. Resume and fork cannot use an older snapshot. Read [Restore an older snapshot](/snapshots/resume-and-fork#restore-an-older-snapshot-roll-back). | | **Recover** | Restart the machine of a sandbox that does not answer. The disk is not touched. Read [Troubleshooting](/troubleshooting#a-sandbox-does-not-answer). | | **Delete** | Erase a sandbox and its snapshots for good. You cannot get it back. Read [Delete a sandbox](/data-retention/delete). | | **Ready** | The sandbox runs commands now. Read [Readiness](/readiness). | | **Hydrated** | All file content has arrived after a resume or fork. Files are readable before that. | | **Environment** | Settings that a sandbox starts with: variables, secret files, repositories and logins. Read [Environments](/environments). | | **Setup script** | Commands that run when a sandbox starts. Read [Setup scripts](/setup). | | **Public URL** | An HTTPS address for one port of a sandbox. Read [Public URLs](/hosting). | | **Share code** | A secret code (`bsh_...`) that lets another account start a sandbox from your saved snapshot. | | **Organization** | A team account. Members share sandboxes, a plan, a wallet and seats. Read [Organizations](/organizations). | | **Active wallet** | The account that pays for a new sandbox: you, or an organization. Read [Active wallet](/organizations/active-wallet). | | **Wallet balance** | Dollars on an account or organization. It pays overage, never the plan. Read [Wallet](/billing#wallet). | | **Seat** | One paid member place in an organization. Each seat adds the plan price and the included time. It adds the full limits on the \$2000 plan, 20% of them below. | ## Words at other providers Other providers use some of the same words for other things. This table gives the closest boat word. | boat | E2B | Daytona | Modal | | - | - | - | - | | Sandbox | Sandbox | Sandbox | Sandbox | | Stop (disk kept, memory kept only for a resume within 10 minutes) | Pause in filesystem mode. A default pause always keeps memory, a boat stop keeps it only for 10 minutes | Stop | No match. Save a filesystem snapshot, then terminate | | Resume | Resume (connect) | Start | Create a sandbox from the saved image | | Delete | Kill | Delete | Terminate | | Saved snapshot | Template | Snapshot | Filesystem snapshot (an image) | | Fork | No direct match. Create from a template or snapshot | No direct match | Create from a filesystem snapshot | | Auto-stop | Timeout | Auto-stop interval | Timeout | | Stopped state | Paused | Stopped. boat has no separate archive step: a stopped sandbox is already in storage | No match | Two differences cause most surprises: * A boat **snapshot** is automatic and per sandbox. A Daytona snapshot is closer to a boat **saved snapshot**. * A boat **stop** keeps memory only for a resume within 10 minutes, and only usually. After that, programs that you started by hand do not come back. Enabled systemd services and Docker containers start again. Read [What a snapshot saves](/snapshots/whats-saved). # Data retention and deletion Source: https://docs.boat.dev/data-retention How long boat keeps each kind of data, stop versus delete, zero data retention, and the records that stay after a deletion. This page is part of [Security and isolation](/security). ## How long boat keeps data | Data | boat keeps it | | - | - | | Newest snapshot of a running sandbox | While it runs | | Newest snapshot of a stopped sandbox | At least 14 days after the stop. Then it becomes eligible for automated retention cleanup. Once deleted, resume and fork fail with `409 snapshot_data_expired` ([details](/snapshots/stop#keep-a-stopped-sandbox-longer-than-14-days)) | | Older snapshots of a sandbox | A short time, usually less than a day. Resume and fork never use them | | Saved snapshot | No scheduled expiry. You can remove it. Saved snapshots above your plan's included count can be deleted 7 days after your wallet is empty ([details](/snapshots/templates#when-your-wallet-is-empty)) | | Deleted sandbox or snapshot | Gone from lists at once. boat erases the stored data in the background ([details](/data-retention/delete)) | | Command history: `boat exec` and API commands, with output | 90 days | | Output of every other process | 72 hours | | Closed account | 30 days, then boat purges it ([details](/data-retention/close-account)) | | With zero data retention | boat deletes a sandbox's data when it stops ([details](/data-retention/zero-data-retention)) | | With snapshots off | Nothing. A stop erases the sandbox ([details](/data-retention/snapshots-and-monitoring-off#snapshots-off)) | An empty wallet stops your sandboxes after the included time is used. It does not delete them. Read [Why did my sandbox stop?](/troubleshooting#why-did-my-sandbox-stop). The retention cleanup runs automatically when enabled. It currently reports eligible stopped sandboxes without deleting them in production. The 14-day rule does not yet trigger deletion there. Other deletion requests, such as `boat delete`, still run. ## Stop is not delete A stop keeps the disk. A delete erases it. | Action | Can you resume the sandbox? | What happens to data? | | - | - | - | | **[Stop](/snapshots/stop)** | Yes, for at least 14 days | The newest snapshot becomes eligible for automated cleanup after day 14. The job is currently report-only in production. Once deleted, resume and fork fail with `409 snapshot_data_expired`. To keep it longer, save a saved snapshot before day 14: `boat snapshot <id> <name>`. | | **[Delete](/data-retention/delete)** | No | boat erases the sandbox content, its unshared snapshots and its machine data. You cannot undo it. | | **[Zero data retention (ZDR)](/data-retention/zero-data-retention)** | No, after a stop | boat deletes the data of every sandbox when it stops. | | **[Snapshots off](/data-retention/snapshots-and-monitoring-off#snapshots-off)** | No | boat never saves the sandbox. A stop erases it. | | **[Monitoring off](/data-retention/snapshots-and-monitoring-off#monitoring-off)** | Yes | boat keeps no command or process output, no process list and no CPU/RAM samples. | The API reports a stopped sandbox as `archived`. This is the same stop. It is not a deletion. ## Command history The [command history](/long-running-tasks/command-history) of a sandbox is account data. * A delete erases the history with the rest of the sandbox. * With ZDR, a stop queues the history for deletion with the rest of the sandbox. * With ZDR, boat does not save the output that a process wrote after the last 30-second read. ## All surfaces Every task on these pages works on all four surfaces. | | CLI | API | SDKs | Dashboard | | - | - | - | - | - | | Delete a sandbox | `boat delete <id>` | `DELETE /sandboxes/{sandboxId}` | `deleteSandbox` | [Sandboxes](https://boat.dev/dashboard?tab=sandboxes) `⋯` → **Delete permanently…** | | Delete a snapshot | `boat snapshot delete <id>` | `DELETE /snapshots/{snapshotId}` | `deleteSnapshot` | [Snapshots](https://boat.dev/dashboard?tab=snapshots) | | Delete all snapshots of a sandbox | `boat snapshot delete --all <id>` | `DELETE /sandboxes/{sandboxId}/snapshots` | `deleteSandboxSnapshots` | [Snapshots](https://boat.dev/dashboard?tab=snapshots) → Select all | | Delete a saved snapshot | `boat snapshot rm <name>` | `DELETE /saved-snapshots/{name}` | `deleteSavedSnapshot` | [Snapshots](https://boat.dev/dashboard?tab=snapshots) | | Poll an operation | `boat deletion status <id>` | `GET /deletion-operations/{id}` | `getDeletionOperation` | shown inline while deleting | | Read ZDR | `boat data-retention status` | `GET /account/data-retention` | `getDataRetention` | [Account](https://boat.dev/dashboard?tab=account) | | Enable ZDR | `boat data-retention enable` | `PATCH /account/data-retention` | `updateDataRetention` | [Account](https://boat.dev/dashboard?tab=account) | > [!WARNING] > > You cannot cancel a deletion operation. If you disable ZDR, only future stops change. Operations that boat already accepted continue. ## Records kept after content deletion boat keeps only the records that it needs for security, abuse prevention, compliance and billing. These records are: * The history of which machine ran each sandbox, and when. * Network attribution, such as assigned IP and MAC records. * Security audit events. * Billing and usage records. These records show who controlled the infrastructure and when. They do not keep your sandbox files, prompts, messages, secrets or generated artifacts. For a privacy request, use [Support](/support). ## Learn more > [card] [Delete a sandbox or snapshot](/data-retention/delete) > > Delete a sandbox or snapshots, follow the operation, and how saved snapshots are deleted. > [card] [Zero data retention](/data-retention/zero-data-retention) > > Read and enable ZDR. What changes when it is on. > [card] [Snapshots off and monitoring off](/data-retention/snapshots-and-monitoring-off) > > Keep no snapshots, or keep no monitoring data, for one sandbox or the whole account. > [card] [Close your account and GDPR erasure](/data-retention/close-account) > > Close your account, reopen it in 30 days, or erase it for good. ## Related * [Privacy Policy](https://boat.dev/privacy) * [Snapshots](/snapshots) * [CLI reference](/cli-reference) * [API overview](/api/v1) * [Delete sandbox API](/api/reference/sandboxes/permanently-delete-sandbox-data) * [Update data retention API](/api/reference/account/update-account-data-retention-policy) # Close your account and GDPR erasure Source: https://docs.boat.dev/data-retention/close-account Close your account, reopen it within 30 days, or erase it for good for a GDPR request (right to erasure). Closing removes the whole account, not one sandbox. To delete one sandbox, read [Delete a sandbox or snapshot](/data-retention/delete). You can close the account only on the [Account](https://boat.dev/dashboard?tab=account) tab. It needs a dashboard sign-in session. boat refuses the request from an API key and from the CLI. ## What closing does Closing does all of these at once: * It cancels your subscription **immediately**, not at the end of the period. You lose the remaining included time and the money in your wallet. If you close just after a renewal, you lose that renewal. * It stops every running sandbox. Each stop saves the disk first. * It revokes every API key and every other session. The session that you closed from stays active, so you can still read your invoices. * It sends you a confirmation email with the date when boat purges your data. ## The 30-day window | Time after closing | State of the account | | - | - | | Up to **30 days** | Closed but you can get it back. **Reopen** on the same tab brings it back, except the subscription. | | After 30 days | boat purges the sandbox data permanently. If you reopen, you get a working but empty account. | ## Permanent erasure (GDPR) > [!WARNING] > > The same screen also offers permanent erasure, for GDPR requests. It does not wait 30 days. It erases the data and your identity when the sandboxes finish stopping. You **cannot cancel or reopen** it. Use ordinary closing, unless you need erasure. boat keeps a small set of records after erasure, for security, abuse prevention and billing. Read [Records kept after content deletion](/data-retention#records-kept-after-content-deletion). For any other privacy request, use [Support](/support). # Delete a sandbox or snapshot Source: https://docs.boat.dev/data-retention/delete Delete a sandbox, its snapshots or a saved snapshot for good, follow the deletion until the data is erased, and what a delete keeps. A delete is permanent. You cannot resume, fork or get back a deleted sandbox. There is no list of deleted sandboxes. > [!WARNING] > > **If you want to use the data later, stop the sandbox. Do not delete it.** A stopped sandbox costs nothing and keeps its disk for at least 14 days. Save a saved snapshot before day 14 to keep it longer. Read [Stop a sandbox](/snapshots/stop). ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat stop bx_f7k2q9hd # keeps the data; `boat resume` brings it back boat delete bx_f7k2q9hd # erases the sandbox AND its snapshots, for good ``` ## Delete a sandbox A delete of a running sandbox stops it at once. It takes no last snapshot. Billing for the sandbox ends at the delete. Every sandbox or snapshot delete needs the header `X-Ascii-Confirm-Delete`. Its value must be exactly the target id. If it is not, boat refuses the request with `409` and deletes nothing. The header keeps its old name. The CLI and the dashboard set it for you. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat delete bx_f7k2q9hd # asks first, then follows the operation to completion boat delete bx_f7k2q9hd --yes # no prompt, for scripts ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X DELETE "$BOAT_API_BASE/sandboxes/$BOAT_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "X-Ascii-Confirm-Delete: $BOAT_ID" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const accepted = await sandbox.deleteSandbox({ sandboxId: "bx_f7k2q9hd", xAsciiConfirmDelete: "bx_f7k2q9hd", }); console.log(accepted.operation.id, accepted.operation.status); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} accepted = sandbox.delete_sandbox( x_ascii_confirm_delete="bx_f7k2q9hd", sandbox_id="bx_f7k2q9hd", ) print(accepted.operation.id, accepted.operation.status) ``` `$BOAT_API_BASE` is `https://boat.dev/api/v1`. In the dashboard, open [Sandboxes](https://boat.dev/dashboard?tab=sandboxes). Open the `⋯` menu on the row of the sandbox and choose **Delete permanently…**. ## How a delete works 1. You send a delete request. 2. boat returns `202 Accepted` with an operation. 3. The sandbox or snapshot disappears from lists, resumes and forks at once. 4. boat erases the stored data in the background, when nothing reads it any more. 5. You poll the operation until its status is `completed`. boat never refuses a delete because the data is still in use. The `stage` of the operation tells you where the deletion is. | `stage` | Meaning | | - | - | | `removing` | boat erases the stored data now. | | `waiting_for_uploads` | boat erases the data at `expectedBy`, when the last upload link for it expires. This is at most six hours after the last upload. | | `retrying` | A short fault occurred. boat tries again by itself. | | `completed` | boat erased every snapshot of it. A newer snapshot, a fork or a saved snapshot made from it keeps the data it reads. That data goes when you delete those too. | > [!WARNING] > > You cannot cancel a deletion operation. ## Poll the operation A delete returns an operation id (`bdop_…`). Poll it until `status` is `completed`. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat deletion status bdop_0123456789abcdef0123456789abcdef ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/deletion-operations/$OPERATION_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const current = await sandbox.getDeletionOperation({ operationId: accepted.operation.id }); console.log(current.operation.status); // pending | processing | blocked | completed ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} current = sandbox.get_deletion_operation(accepted.operation.id) print(current.operation.status) ``` `boat delete` already polls for you. It prints the operation when it finishes. Use `boat deletion status` to check later on an operation that you started elsewhere. ## Delete one snapshot | Request | What it deletes | Confirmation header | | - | - | - | | `DELETE /snapshots/{snapshotId}` | One automatic snapshot | The snapshot id | | `DELETE /sandboxes/{sandboxId}/snapshots` | Every automatic snapshot of one sandbox. The sandbox stays. A stopped sandbox with no snapshot has nothing to resume from. | The sandbox id | | `DELETE /saved-snapshots/{name}` | One saved snapshot, by name | None | ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshot delete <snapshotId> # one automatic snapshot boat snapshot delete --all bx_f7k2q9hd # every automatic snapshot of a sandbox boat snapshot delete --all bx_f7k2q9hd --yes # same, no prompt, for scripts boat snapshot rm web-stack # a saved snapshot, by name ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X DELETE "$BOAT_API_BASE/snapshots/$SNAPSHOT_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "X-Ascii-Confirm-Delete: $SNAPSHOT_ID" curl -sS -X DELETE "$BOAT_API_BASE/sandboxes/$BOAT_ID/snapshots" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "X-Ascii-Confirm-Delete: $BOAT_ID" curl -sS -X DELETE "$BOAT_API_BASE/saved-snapshots/web-stack" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.deleteSnapshot({ snapshotId: "<snapshotId>", xAsciiConfirmDelete: "<snapshotId>", }); await sandbox.deleteSandboxSnapshots({ sandboxId: "bx_f7k2q9hd", xAsciiConfirmDelete: "bx_f7k2q9hd", }); await sandbox.deleteSavedSnapshot({ name: "web-stack" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.delete_snapshot( snapshot_id="<snapshotId>", x_ascii_confirm_delete="<snapshotId>", ) sandbox.delete_sandbox_snapshots( sandbox_id="bx_f7k2q9hd", x_ascii_confirm_delete="bx_f7k2q9hd", ) sandbox.delete_saved_snapshot("web-stack") ``` You can also delete snapshots on the [Snapshots](https://boat.dev/dashboard?tab=snapshots) tab of the dashboard. Deletion and retention responses use `Cache-Control: no-store`. ## What a delete keeps Sandboxes can share snapshot data. A fork, a resume and a deploy from a saved snapshot read the same data as their source. So a delete erases only the data that nothing else uses. boat keeps: * The data that a fork of this sandbox still needs. * Your **saved snapshots** from this sandbox. They exist to outlive it. To remove one, run `boat snapshot rm <name>`. boat frees the storage when no sandbox and no saved snapshot uses it. When you remove a saved snapshot, it becomes unavailable at once. boat erases its data **six hours** later at the earliest. Upload links for snapshots stay valid for six hours. This delay stops an upload that already started from making the data again after the delete. If you enable [zero data retention](/data-retention/zero-data-retention), boat removes your saved snapshots and queues their data for deletion. You cannot save a saved snapshot while ZDR is on. # Snapshots off and monitoring off Source: https://docs.boat.dev/data-retention/snapshots-and-monitoring-off Keep no snapshots of a sandbox, or keep no monitoring data, for one sandbox or for the whole account. | Setting | What boat does not keep | Can you resume the sandbox? | | - | - | - | | [Snapshots off](#snapshots-off) | Any copy of the sandbox outside its machine | No. A stop erases it. | | [Monitoring off](#monitoring-off) | Command and process output, the process list, CPU/RAM samples | Yes | ## Snapshots off boat never captures a sandbox with snapshots off. * Nothing of the sandbox is stored outside its machine. * No background work runs on it. * A stop erases it. * You cannot resume it, fork it or save it as a saved snapshot. * If its machine fails, there is no backup. * If you create it from a saved snapshot or another sandbox, its snapshot list shows the snapshots of that source with `origin: "template"`. They are copies of the data of the source. boat did not capture them from this sandbox. ### Turn snapshots off for the whole account Do one of these: * On the [Account](https://boat.dev/dashboard?tab=account) tab, under **Data & privacy**, turn on **Snapshots off**. * Send `PATCH /account/data-retention` with `{"snapshotsOff": true}`. This needs a browser sign-in session. An API key gets `403 session_required`. Every sandbox that you create or fork after this has snapshots off, from any surface. Existing sandboxes keep their setting. The setting covers the sandboxes that you create, also in an organization. It does not cover sandboxes of other members. ### Turn snapshots off for one sandbox ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --no-snapshots ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"snapshots":false}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.create({ snapshots: false }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.create_sandbox_request import CreateSandboxRequest sandbox.create(create_sandbox_request=CreateSandboxRequest(snapshots=False)) ``` ## Monitoring off boat keeps no monitoring data for a sandbox with monitoring off. | Not kept | Still works | | - | - | | [Command history](/long-running-tasks/command-history) and the output of every process | Live output of a running command (attach, read from an offset) | | The process list | Abuse checks on the machine | | CPU, RAM, disk and IO samples, and their graphs and [OpenTelemetry](/opentelemetry) metrics | Lifecycle events and webhooks | * The sandbox runs no process tracer. * Disk-full alerts need CPU/RAM samples. They are not available for this sandbox. * The cause shown for a lost sandbox needs CPU/RAM samples. It is not available for this sandbox. * Its history, processes and metrics calls return `409 monitoring_off`. ### Turn monitoring off for the whole account Do one of these: * On the [Account](https://boat.dev/dashboard?tab=account) tab, under **Data & privacy**, turn on **Monitoring off**. * Send `PATCH /account/data-retention` with `{"monitoringOff": true}`. This needs a browser sign-in session. An API key gets `403 session_required`. Every sandbox that you create or fork after this has monitoring off. Existing sandboxes keep their setting. The setting covers the sandboxes that you create, also in an organization. While this setting is on, boat refuses a request with `monitoring: true`. The error is `409 monitoring_off_for_account`. A fork of a sandbox with monitoring off also has monitoring off. To change this, send `monitoring: true` in the fork request. ### Turn monitoring off for one sandbox ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --no-monitoring ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"monitoring":false}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.create({ monitoring: false }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.create_sandbox_request import CreateSandboxRequest sandbox.create(create_sandbox_request=CreateSandboxRequest(monitoring=False)) ``` The sandbox shows `"monitoring": false`. # Zero data retention Source: https://docs.boat.dev/data-retention/zero-data-retention Read and enable zero data retention (ZDR): boat deletes the data of each sandbox when it stops. How it works in an organization. With zero data retention (ZDR), boat deletes the data of each sandbox when it stops. You cannot resume or fork a sandbox after it stops. ZDR is a setting of your own account. In an organization, each member turns it on for the sandboxes that they create. Read [Organizations](#organizations). ## Read the setting You can read the setting from anywhere. An API key works. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat data-retention status ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/account/data-retention" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const policy = await sandbox.getDataRetention(); console.log(policy.enabled); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} policy = sandbox.get_data_retention() print(policy.enabled) ``` `$BOAT_API_BASE` is `https://boat.dev/api/v1`. `GET /me` also returns the setting, in the `zeroDataRetention` fields. ## Enable zero data retention > [!WARNING] > > To **change** the setting, you need a browser sign-in session. An API key does not work. Run `boat login` without a key first, or use the dashboard. An SDK client that uses `BOAT_API_KEY` gets `403 session_required`. This is on purpose. Enabling ZDR deletes the data of every stopped sandbox, so a leaked API key must never reach it. 1. Sign in with a browser session. Run `boat login` without a key, or open the dashboard. 2. Send the exact phrase `delete archived sandbox data` as the confirmation. "Archived" is the API name of a stopped sandbox. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat data-retention enable # prompts for the confirmation phrase boat data-retention enable --yes # skip the prompt ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PATCH "$BOAT_API_BASE/account/data-retention" \ -H "Authorization: Bearer $BOAT_SESSION_TOKEN" \ -H "Content-Type: application/json" \ -d '{"enabled":true,"confirmation":"delete archived sandbox data"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} // Requires a browser session token, not an API key. await sandbox.updateDataRetention({ enabled: true, confirmation: "delete archived sandbox data", }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.data_retention_update_request import DataRetentionUpdateRequest # Requires a browser session token, not an API key. sandbox.update_data_retention(DataRetentionUpdateRequest( enabled=True, confirmation="delete archived sandbox data", )) ``` In the dashboard, the toggle is under **Data & privacy** on the [Account](https://boat.dev/dashboard?tab=account) tab. ## What happens when ZDR is on * boat queues the data of your stopped sandboxes for deletion. * Each sandbox deletes its data when it stops. This includes auto-stop and a stop for an empty wallet. * boat removes your saved snapshots and queues their data for deletion. You cannot save a new saved snapshot. * Accepted deletions continue in the background until boat checks that they are complete. > [!WARNING] > > You cannot cancel a deletion operation. If you disable ZDR, only future stops change. Operations that boat already accepted continue. ZDR still snapshots a sandbox while it runs. boat uses these snapshots to rebuild a sandbox after a machine fails. To keep nothing at all, turn [snapshots off](/data-retention/snapshots-and-monitoring-off#snapshots-off). ## Organizations | Question | Answer | | - | - | | Who turns ZDR on? | Each person, for their own account. An organization has no ZDR setting of its own | | Which sandboxes does it cover? | Every sandbox that you create, also the ones that an organization pays for | | Does it cover sandboxes of other members? | No. Each member turns it on for their own sandboxes | | Does it need a role? | No. Any member can turn it on for their own account | To cover a whole team, ask each member to turn ZDR on. Check each account with `boat data-retention status`. The same rule applies to [snapshots off and monitoring off](/data-retention/snapshots-and-monitoring-off). # Desktop streaming Source: https://docs.boat.dev/desktop-streaming Open the Linux desktop of a sandbox in your browser, watch an agent use it, embed it in your app, or record it. Each sandbox has a Linux desktop that you open in your browser. Use it for these tasks: * Look at a running app. * Use Chrome. * Debug Electron apps. * Control GUI tools that are hard to use over SSH. The agents of the sandbox drive the same screen with the built-in [`computer` tools](/integrated-agents/computer-use). You can watch a prompt do GUI work live. ## Open the desktop Run this command on your computer. It opens a desktop URL that is already signed in. Integrations get the same URL through the SDK or the API (`BOAT_API_BASE=https://boat.dev/api/v1`). Open the URL within 10 minutes. Read [Embed the desktop and secure its URL](/desktop-streaming/urls-and-security). ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat desktop bx_f7k2q9hd ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/desktop?theme=light" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const desktop = await sandbox.desktop({ sandboxId: "bx_f7k2q9hd", theme: "light" }); console.log(desktop.desktopUrl); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} desktop = sandbox.desktop("bx_f7k2q9hd", theme="light") print(desktop.desktop_url) ``` You can also open the desktop from the [Sandboxes](https://boat.dev/dashboard?tab=sandboxes) tab of the dashboard while the sandbox runs. > [!NOTE] > > The desktop works only while the sandbox runs. Resume a stopped sandbox first. If the sandbox is still starting, the API returns `desktop_not_ready`. Retry a few seconds later. ## Ways to view the sandbox | View | What you see | Command | | - | - | - | | Desktop (default) | The full desktop over Moonlight (WebRTC), 1920x1080 at 60 fps | `boat desktop <id>` | | Browser | Only Chrome, 1920x1080 at 60 fps | `boat browser <id>` | ## Learn more > [card] [Browser-only view](/desktop-streaming/browser-only) > > Show only Chrome. Use more than one Chrome profile. > [card] [Drive and record the desktop](/desktop-streaming/drive-and-record) > > Let an agent use the screen. Record the screen to an MP4. > [card] [Desktop background](/desktop-streaming/background) > > Put your own PNG on the desktop. > [card] [Embed the desktop and secure its URL](/desktop-streaming/urls-and-security) > > What a desktop URL looks like, how long it works, how to embed it, and how to keep it safe. ## Related * [Computer use for the sandbox's agents](/integrated-agents/computer-use) * [SSH](/ssh-access) * [Public URLs](/hosting) * [Machines](/machines) # Desktop background Source: https://docs.boat.dev/desktop-streaming/background Put your own PNG image on the sandbox desktop. ## Set your own background 1. Put a PNG file at `~/.config/boat/wallpaper.png` on the sandbox. 2. The desktop shows it at once. The image stays after a stop, a resume and a fork. To go back to the default background, delete the file. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat scp ./wallpaper.png bx_f7k2q9hd:/home/user/.config/boat/wallpaper.png ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"curl -fsSL -o ~/.config/boat/wallpaper.png https://example.com/wallpaper.png"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "curl -fsSL -o ~/.config/boat/wallpaper.png https://example.com/wallpaper.png", }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.command_request import CommandRequest sandbox.command("bx_f7k2q9hd", CommandRequest( command="curl -fsSL -o ~/.config/boat/wallpaper.png https://example.com/wallpaper.png", )) ``` ## Image limits | Limit | Value | | - | - | | Format | PNG | | File size | 16 MiB or less | | Width or height | 8192 pixels or less | | Total pixels | 16,777,216 or less (for example 4096x4096) | The image fills the screen and keeps its aspect ratio. If the file is not a valid PNG, the desktop keeps the default background. # Browser-only view Source: https://docs.boat.dev/desktop-streaming/browser-only Stream only Chrome from a sandbox, without the desktop, and choose which Chrome profile to open. Use the browser-only view when a person must see and control Chrome, but not the sandbox desktop. ## Open the browser view * In the dashboard, open the sandbox menu and select **Browser**. * In the CLI, run one of these commands: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat browser bx_f7k2q9hd boat browser bx_f7k2q9hd --profile /data/chrome-profile ``` * In the API, call `POST /sandboxes/{id}/browser`. The response has `browserUrl`. * The URL has the same 10-minute rule as a desktop URL. Read [Embed the desktop and secure its URL](/desktop-streaming/urls-and-security#how-long-a-desktop-url-works). ## Use a Chrome profile Add `--profile <absolute path on the sandbox>` to stream a specific Chrome user data directory. One sandbox can then hold several signed-in profiles. You choose which one to open. | Rule | Detail | | - | - | | Creation | boat creates the directory for you. | | Location | Outside system directories and outside `/home/user`. | | Snapshots | The directory goes with the snapshots and forks of the sandbox. | | Old sandboxes | Sandboxes created before this feature return `chrome_profile_unsupported`. | ## How the browser view works The browser view is a separate browser surface on the same running sandbox. It does not create another sandbox. It never falls back to the desktop. | Topic | Behavior | | - | - | | Stream quality | 1920x1080 at 60 fps, the same as the default desktop. | | Chrome | Chrome keeps its tabs and its address bar. | | Close controls | boat hides the window-close controls on purpose. | | Minimize | Chrome's minimize cannot leave the stream on a blank desktop. | | Last tab | When you close the last tab, Chrome opens a new tab. The stream stays up. | | Run `boat browser` again | The live stream stays up. The command prints a new URL. | | Second viewer tab | Two browser viewer tabs cannot share the stream. The new tab takes the stream from the first tab. | | Desktop at the same time | The desktop and the browser view can run together. | | Viewer controls | Mute, reconnect and fullscreen, the same as the desktop stream. | A browser URL cannot attach to the desktop stream. The browser view has no clipboard routes. > [!WARNING] > > The browser-only view limits the stream to Chrome. It does not show controls to close Chrome. It is not a security boundary against code that already runs inside the sandbox. A boat user who can run any code, or who has root, can read or change the browser process and its data. Keep the returned URL secret. # Drive and record the desktop Source: https://docs.boat.dev/desktop-streaming/drive-and-record Let the agents of a sandbox use its desktop, mix shell commands with prompts, and record the screen to an MP4. ## Drive the desktop with a prompt The coding agents of the sandbox drive the same screen that you stream. Each harness on a sandbox has built-in `computer` tools. These tools take screenshots, click, type, scroll and start apps. You only send a prompt: ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt bx_f7k2q9hd "Open example.com in Chrome and tell me the page title" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/prompt" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"prompt":"Open example.com in Chrome and tell me the page title"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.prompt({ sandboxId: "bx_f7k2q9hd", prompt: "Open example.com in Chrome and tell me the page title", }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.prompt_request import PromptRequest sandbox.prompt("bx_f7k2q9hd", PromptRequest( prompt="Open example.com in Chrome and tell me the page title", )) ``` A prompt needs a connected AI key or subscription first. Without it, the API returns `409 provider_not_configured`. Read [Keys and subscriptions](/integrated-agents/keys). Open a stream in one window. Watch the agent work in it. * You install nothing. * You register nothing. * Each harness already has the tools. For the full tool list, the tool names per harness and the health check, read [Computer use](/integrated-agents/computer-use). ## Mix shell commands and prompts Shell commands also work on the same screen. You can use them together with prompts. For example, open a page yourself, then give the sandbox a visual task: ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_f7k2q9hd 'DISPLAY=:0 google-chrome-stable "https://example.com" & sleep 2; wmctrl -a Chrome' boat prompt bx_f7k2q9hd "Complete the checkout flow in the open browser window" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"DISPLAY=:0 google-chrome-stable \"https://example.com\" & sleep 2; wmctrl -a Chrome"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: 'DISPLAY=:0 google-chrome-stable "https://example.com" & sleep 2; wmctrl -a Chrome', }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.command("bx_f7k2q9hd", CommandRequest( command='DISPLAY=:0 google-chrome-stable "https://example.com" & sleep 2; wmctrl -a Chrome', )) ``` > [!WARNING] > > A sandbox has one screen. Each conversation on the sandbox drives that same screen. If two agents click at the same time, they interfere with each other. Give each parallel GUI task its own sandbox, or run the tasks one after the other. ## Record the screen `ascii-record-desktop` records the live desktop to an MP4 from inside the sandbox. Use it to make a demo or to keep evidence of a GUI run. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_f7k2q9hd "ascii-record-desktop start /home/user/demo.mp4" # ... drive the desktop ... boat exec bx_f7k2q9hd "ascii-record-desktop stop" boat scp bx_f7k2q9hd:/home/user/demo.mp4 ./demo.mp4 ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"ascii-record-desktop start /home/user/demo.mp4"}' # ... drive the desktop ... curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"ascii-record-desktop stop"}' curl -L -o demo.mp4 "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/artifacts?path=demo.mp4" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "ascii-record-desktop start /home/user/demo.mp4", }); // ... drive the desktop ... await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "ascii-record-desktop stop" }); const video = await sandbox.artifact({ sandboxId: "bx_f7k2q9hd", path: "demo.mp4" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.command_request import CommandRequest sandbox.command("bx_f7k2q9hd", CommandRequest( command="ascii-record-desktop start /home/user/demo.mp4", )) # ... drive the desktop ... sandbox.command("bx_f7k2q9hd", CommandRequest(command="ascii-record-desktop stop")) video = sandbox.artifact("bx_f7k2q9hd", "demo.mp4") ``` * Stop the recording before you download the file. Until then, the MP4 is not complete. * Run `ascii-record-desktop status` to see if a recording runs. * The tool keeps its old name, `ascii-record-desktop`. To share a recording without a download, serve its folder from the sandbox. Then expose the folder with a URL that needs a token: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_f7k2q9hd --detach "cd ~ && python3 -m http.server 8099 --bind 0.0.0.0" boat host bx_f7k2q9hd 8099 ``` # Embed the desktop and secure its URL Source: https://docs.boat.dev/desktop-streaming/urls-and-security What a desktop URL contains, how long it works, how to embed the stream in your app in an iframe, and how boat protects the desktop. This page covers desktop URLs. For every URL that carries a token, read [Security and isolation](/security#urls-that-carry-a-token). ## Embed the stream in your app **1. Ask for a URL on your server** On each page load, your server calls the desktop endpoint with your API key. Do not put the API key in the browser. ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/desktop?theme=light" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` `BOAT_API_BASE` is `https://boat.dev/api/v1`. The response has `desktopUrl`. **2. Hide the viewer overlay (optional)** Add `overlay=0` to the query string, before the `#`. The side panel and the stats text then never show. The token stays in the fragment. ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} https://<sandbox-desktop-host>/stream.html?hostId=<host>&appId=<app>&theme=light&overlay=0#token=<token> ``` **3. Put the URL in an iframe** ```html theme={"theme":{"light":"github-light","dark":"github-dark-default"}} <iframe src="DESKTOP_URL" allow="autoplay; fullscreen; clipboard-read; clipboard-write" style="width:100%;aspect-ratio:16/9;border:0"></iframe> ``` ## How long a desktop URL works | Case | What happens | | - | - | | You open the URL within 10 minutes | The stream starts. | | You open the URL after 10 minutes | The viewer cannot sign in. Ask for a new URL. | | A stream is already open | It keeps playing after the 10 minutes. | | The page reloads, or the viewer reconnects after 10 minutes | It needs a new URL. Ask for one on each page load. | | The sandbox stops | The stream ends. After a resume, ask for a new URL. | ## What happens when you open the desktop 1. The CLI or the dashboard asks boat for a new signed-in desktop URL for your sandbox. 2. If the desktop stream is not ready, boat prepares it. 3. boat opens the browser viewer. The URL opens a browser page. It looks like this: ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} https://<sandbox-desktop-host>/stream.html?hostId=<host>&appId=<app>&theme=light#token=<token> ``` boat generates the host, the IDs and the token for the running sandbox. `boat desktop` also prints a `viewerUrl`. It carries the same token, so treat it the same way. ## How the Moonlight viewer handles the token * The viewer removes the fragment from the URL at once. * The viewer sends the token in authenticated request headers and in the first WebSocket frame. * The viewer never puts the token in an HTTP or WebSocket request URL. ## Security model | Topic | Rule | | - | - | | How boat makes a URL | Only through the authenticated boat API. The API key needs the `desktop` action. | | URL lifetime | Open it within 10 minutes. See the table above. | | List and info responses | They do not cache or return a desktop URL. Call the desktop endpoint each time you open a stream. | | Clipboard | Reads and writes work only with the credentials of the active desktop Moonlight stream. | | Browser-only view | It has no clipboard routes. | Anyone who has the full URL can attach to that desktop session. Treat the URL as sensitive: * Do not paste the full URL into shared chats or logs. * To give another person lasting access to a sandbox, use an [organization](/organizations). Do not share a desktop URL. ## After a stop, resume or fork * When you stop a sandbox, the desktop is not available. Resume the sandbox to use it again. * Desktop programs do not survive a resume or a fork. Open Chrome again and restart your app or dev server. * The `computer` tools come back by themselves. boat restarts the desktop daemon behind them with the sandbox. # Environments Source: https://docs.boat.dev/environments Set what every new sandbox starts with: GitHub repositories, environment variables, secret files, repository setup scripts and credentials. An **environment** is the set of settings that a new sandbox gets when it starts. It holds five things: | Item | What the sandbox gets | Page | | - | - | - | | Repositories | GitHub repositories cloned into `/home/user` | [Repositories](/environments/repositories) | | Secrets | Environment variables and secret files | [Secrets, env vars and .env files](/environments/secrets) | | Setup scripts | One script per repository, run at each start | [Setup scripts](/setup) | | Credentials | Your GitHub token, a boat API key, agent logins | [Access and credentials](/environments/access) | | AI credential profile | The AI keys that the sandbox's agents use | [Access and credentials](/environments/access#ai-credentials) | Every account starts with one environment named `base`. You can add more, for example `staging` and `prod`. Each one is a full environment. Name the environment when you create, resume or fork a sandbox. Read [Manage environments](/environments/manage). Manage environments in [Dashboard > Environment](https://boat.dev/dashboard?tab=environment) or with the `boat env` commands. An organization environment is open to every member by default. An owner or admin can limit it to a list of members with `boat env access`. Read [Limit who can use an environment or profile](/organizations#limit-who-can-use-an-environment-or-profile). > [!TIP] > > Not sure if you need an environment, a setup script or a saved snapshot? Read [Environment, setup script or saved snapshot?](/environments/choose). ## Safe for third parties One switch sets the security of an environment. | Switch | Use it for | What the sandbox gets | | - | - | - | | On | Sandboxes that other people use, for example your end users | Nothing of yours: no variables, no secret files, no GitHub, no credentials, no repository setup scripts | | Off | Sandboxes that only you use | What the four section toggles allow | ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set base --safe-for-third-parties true ``` > [!WARNING] > > `boat onboard` sets this switch when you answer that other people use your sandboxes. Then no variable and no secret file reaches a sandbox. Run `boat env info base` to see the switch. For all the details, read [Access and credentials](/environments/access). ## What happens when you save a change * boat makes a new version of the environment. * New sandboxes get the new version. * Running sandboxes stay on their version until you upgrade them. Read [Versions and upgrades](/environments/versions). ## Learn more > [card] [Environment, setup script or saved snapshot?](/environments/choose) > > Pick the right tool for what a new sandbox needs. > [card] [Access and credentials](/environments/access) > > The safe for third parties switch, the four section toggles, and how to protect an existing sandbox. > [card] [Secrets, env vars and .env files](/environments/secrets) > > Environment variables, secret files, and values for one sandbox only. > [card] [Private registries](/environments/private-registries) > > Log in to private npm, pip and Docker registries in every sandbox. > [card] [Repositories](/environments/repositories) > > Clone GitHub repositories into each sandbox, and find where they land. > [card] [Versions and upgrades](/environments/versions) > > Which version a sandbox uses, and how to move it to the latest one. > [card] [Manage environments](/environments/manage) > > Have more than one environment: create, rename, delete, pick one for a sandbox, share with your organization. ## Related * [Setup scripts](/setup) * [Saved snapshots](/snapshots/templates) * [CLI reference](/cli-reference) # Access and credentials Source: https://docs.boat.dev/environments/access Choose what of yours a sandbox receives: GitHub access, secrets, setup scripts, boat credentials and agent logins. This page covers the credentials a sandbox gets. For the full security picture, read [Security and isolation](/security). ## Safe for third parties One switch sets the security of an environment. > [card] On > > Use it for sandboxes that other people use, for example your own end users. **boat passes nothing of yours.** The sandbox gets no environment variables, no secret files, no GitHub access, no boat credentials, no agent logins and no repository setup scripts. This is true whatever the section toggles say. The sandbox cannot act on your account or your other sandboxes. > [card] Off > > Use it for sandboxes that only you use. The four section toggles below apply. You choose exactly what goes in. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set base --safe-for-third-parties true ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PUT "$BOAT_API_BASE/environments/$ENV_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"safeForThirdParties":true}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.updateEnvironment({ environmentId: envId, safeForThirdParties: true, }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.update_sandbox_environment_request import UpdateSandboxEnvironmentRequest sandbox.update_environment(env_id, UpdateSandboxEnvironmentRequest(safe_for_third_parties=True)) ``` `$BOAT_API_BASE` is `https://boat.dev/api/v1`. Get `$ENV_ID` from `GET /environments` or `boat env list`. > [!WARNING] > > When the switch is on, the toggle fields still show `true` in `boat env list` and the API. The `effective` field shows what sandboxes really get. A secret that you add to such an environment reaches no sandbox. The API answer then carries a `warning`. Check what a sandbox received: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env info base # safeForThirdParties: yes or no boat exec <id> 'echo "[$STRIPE_KEY]"' # [] means the variable did not arrive ``` ### The `--no-env` flag The `--no-env` flag (`noEnv` in the API) gives the same protection to one sandbox. boat keeps this flag forever. * `boat new --no-env` works exactly like a start in an environment that is safe for third parties. * Use the environment when more than a few sandboxes need this protection. * The environment setting applies to every sandbox that uses it. * The environment setting stays through forks and resumes. Your code does not have to pass a flag. ### What a normal sandbox receives This table shows what a sandbox gets from your account when boat withholds nothing. | Type | What boat passes in | | - | - | | Environment variables | Your environment's variables, your GitHub token, and your model credentials if you configured agents (`OPENAI_API_KEY`, `ANTHROPIC_API_KEY`, `CLAUDE_CODE_OAUTH_TOKEN`, `CHATGPT_ACCOUNT_ID`) | | Credential files | Your secret files, the GitHub CLI login (`~/.config/gh/hosts.yml`), git credentials in cloned repositories, Claude and Codex logins (`~/.claude/.credentials.json`, `~/.codex/auth.json`), and the in-sandbox boat CLI token (`~/.config/ascii/boat/config.json`) | | Scripts | The setup scripts of your repositories | Every sandbox, protected or not, also gets two neutral variables: `BOAT_ID` and `ASCII_TOKEN`. `ASCII_TOKEN` can act only on this one sandbox. A protected sandbox receives nothing else, except the values that you pass with `env`. ### What a protected home contains A protected sandbox does not start with an empty home. boat puts these defaults in every home. They are not your data, and they hold no account credentials. | Location | Content | | - | - | | `~/.claude`, `~/.claude.json` | Claude Code skills, MCP configuration and default settings | | `~/.codex`, `~/.config/opencode` | Codex and OpenCode skills and configuration | | Default Chrome profile | Default preferences | | Remote desktop key | A key for this sandbox only | The credential files in the table above do not exist in a new protected sandbox. ### Protect an existing sandbox A snapshot of a normal sandbox can contain your secrets. To protect a sandbox made from such a snapshot, resume or fork it with `--no-env`: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat resume <id> --no-env boat fork <id> --no-env ``` Before the sandbox becomes reachable, boat removes every owner secret that the snapshot can contain: * The managed `~/.bashrc` blocks. * `~/.config/gh/hosts.yml`. boat also runs a `gh` logout. * `~/.git-credentials`. * The `~/.ssh/id_*` private keys. * The Codex and Claude credential files. * The in-sandbox boat CLI token. * Every secret file that you configured. boat keeps `authorized_keys` and `known_hosts`, so you can still reach the sandbox. boat does not touch credentials that it did not write. These stay: * `aws` and `gcloud` credentials. * `.netrc` and `.npmrc`. * Docker logins added inside the sandbox. While the removal runs, SSH and desktop return a `sandbox_securing` error. Retry the request. This change goes one way only. The sandbox stays protected after it. > [!WARNING] > > boat removes the Claude and Codex credential files even when the sandbox's own user signed in with a personal account inside the sandbox. boat cannot tell whose files they are. If they belong to the sandbox's user, back them up first and restore them after. ## The four section toggles When *Safe for third parties* is off, four separate toggles decide what a sandbox receives. Each toggle is a section in the dashboard. Open a section to edit what is inside it. | Section | CLI flag | What the sandbox gets | When you turn it off | | - | - | - | - | | GitHub repositories | `--github` | Your repositories cloned in, the GitHub token, and the repository setup scripts | `gh` and `git push` stop working. No setup script runs. | | Secrets | `--secrets` | Your environment variables and secret files | Sandboxes drop them at their next start. boat keeps what you typed. | | boat credentials | `--boat-credentials` | A boat API key, so the sandbox can snapshot, stop and resume itself | The sandbox cannot manage its own lifecycle | | Agents credentials | `--agents-credentials` | The provider keys (Claude, Codex, and others) from the Agents & Proxying tab | Agents in the sandbox have no login | ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set base --github true --secrets true --boat-credentials false --agents-credentials true ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PUT "$BOAT_API_BASE/environments/$ENV_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"passGithub":true,"passSecrets":true,"passSandboxCredentials":false,"passAgentsCredentials":true}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.updateEnvironment({ environmentId: envId, passGithub: true, passSecrets: true, passSandboxCredentials: false, passAgentsCredentials: true, }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.update_environment(env_id, UpdateSandboxEnvironmentRequest( pass_github=True, pass_secrets=True, pass_sandbox_credentials=False, pass_agents_credentials=True, )) ``` ## AI credentials Two fields decide which AI credentials the environment's sandboxes get. | Field | CLI flag | What it does | | - | - | - | | `credentialProfileId` | `--credential-profile <name\|id\|default>` | The [credential profile](/ai-credentials#credential-profiles) the sandboxes get. `null` (`default` in the CLI) means the sandbox owner's default profile | | `proxyAiCredentials` | `--proxy-ai-credentials <true\|false>` | Only with *Safe for third parties* on. The sandboxes still get AI credentials, as [proxy placeholders](/ai-credentials#the-ai-credentials-proxy). Needs the proxy on for the profile owner, else `400 ai_proxy_off` | ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set base --credential-profile work boat env set customers --safe-for-third-parties true --proxy-ai-credentials true ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PUT "$BOAT_API_BASE/environments/$ENV_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"credentialProfileId":"work"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.updateEnvironment({ environmentId: envId, credentialProfileId: "work" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.update_environment(env_id, UpdateSandboxEnvironmentRequest(credential_profile_id="work")) ``` # Environment, setup script or saved snapshot? Source: https://docs.boat.dev/environments/choose Pick the right tool for what a new sandbox needs: settings and secrets, commands at each start, or a disk with your tools already installed. Each tool does one job. Most setups use two or three of them together. | You want | Use | It holds | When it applies | | - | - | - | - | | The same secrets, repositories and credentials in every sandbox | [Environment](/environments) | Settings only, no disk | At each start | | Packages, tools or data already installed | [Saved snapshot](/snapshots/templates) | A full copy of a sandbox disk | When you create a sandbox with `--from` | | Commands that must run at each start, for example `git pull` or `npm install` | [Repository setup script](/setup#repository-setup-scripts) | A script, attached to a repository in an environment | At each start: create, resume and fork | | Commands for one sandbox only | [`--setup-file`](/setup#per-sandbox-setup-file) | A script, given at create | Once, at create | Rules: * Put slow installs in a saved snapshot. A setup script repeats them at every start. * Put secrets in an environment, never in a saved snapshot. A saved snapshot keeps every file on its disk. * boat has no custom image and no Dockerfile build. A saved snapshot does that job: install your tools in a sandbox, then save it. ## Example 1: a web app with a database URL You want each sandbox to have your repository, its dependencies and a `DATABASE_URL`. 1. Add the repository and the variable to an environment: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env add-repo base acme/web-app boat env set-var base DATABASE_URL=postgres://db.example.com/app ``` 2. Add the repository setup script `npm install` in [Dashboard > Environment](https://boat.dev/dashboard?tab=environment). 3. Create sandboxes with `boat new`. Each one clones the repository, gets the variable and runs `npm install`. ## Example 2: heavy tools installed once You need Python ML packages, a large dataset and Playwright browsers. They take 10 minutes to install. 1. Create one sandbox and install everything in it: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --type large boat ssh <id> -- bash -s < ./install-tools.sh ``` 2. Save the disk as a saved snapshot: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshot <id> ml-stack ``` 3. Create each new sandbox from it. The tools are already there: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --from ml-stack ``` The environment still adds your secrets at each start. Read [Saved snapshots](/snapshots/templates). ## Example 3: one task file per sandbox Each sandbox works on a different customer ticket. The setup differs per sandbox. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --from ml-stack --setup-file ./ticket-4211.sh boat info <id> # setupStatus: pending, running, done or failed ``` The `--setup-file` script runs once, as the user `user`. A fork does not run it again. Read [Per-sandbox setup file](/setup#per-sandbox-setup-file). # Manage environments Source: https://docs.boat.dev/environments/manage Create, rename, upgrade and delete environments, pick the environment for a sandbox, and share environments with your organization. You can have many environments, for example `base`, `staging` and `prod`. Each one is a full environment with its own repositories, secrets and credentials. Exactly one of them is the default. A sandbox uses the default when you do not name an environment. ## Manage environments ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env list boat env info staging boat env new staging boat env rename staging prod boat env default prod boat env rm staging boat env upgrade prod ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/environments" -H "Authorization: Bearer $BOAT_API_KEY" curl -sS -X POST "$BOAT_API_BASE/environments" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"staging"}' curl -sS -X PUT "$BOAT_API_BASE/environments/$ENV_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"name":"prod","isDefault":true,"safeForThirdParties":true}' curl -sS -X POST "$BOAT_API_BASE/environments/$ENV_ID/upgrade" \ -H "Authorization: Bearer $BOAT_API_KEY" curl -sS -X DELETE "$BOAT_API_BASE/environments/$ENV_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { environments } = await sandbox.environments(); const staging = await sandbox.createEnvironment({ name: "staging" }); await sandbox.updateEnvironment({ environmentId: envId, name: "prod", isDefault: true, safeForThirdParties: true, }); await sandbox.upgradeEnvironment({ environmentId: envId }); await sandbox.deleteEnvironment({ environmentId: envId }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.create_sandbox_environment_request import CreateSandboxEnvironmentRequest from boat_sdk.models.update_sandbox_environment_request import UpdateSandboxEnvironmentRequest envs = sandbox.environments() staging = sandbox.create_environment(CreateSandboxEnvironmentRequest(name="staging")) sandbox.update_environment(env_id, UpdateSandboxEnvironmentRequest( name="prod", is_default=True, safe_for_third_parties=True, )) sandbox.upgrade_environment(env_id) sandbox.delete_environment(env_id) ``` * A delete is a soft delete. Sandboxes pinned to its versions keep running. New sandboxes cannot use it. * `upgradeEnvironment` accepts an optional list of sandbox ids. Use it to upgrade only those sandboxes. Without the list, boat moves every sandbox of yours that is on an older version. Read [Versions and upgrades](/environments/versions). ## Pick the environment for a sandbox Pass the environment name when you create, resume or fork a sandbox. Without a name, boat uses your default. * boat rejects an unknown name before it creates or changes anything. A typo costs you nothing. * boat never creates an environment by itself. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --environment staging boat resume bx_f7k2q9hd --environment staging boat fork bx_f7k2q9hd --environment staging ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"ttlSeconds":3600,"environment":"staging"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.create({ ttlSeconds: 3600, environment: "staging" }); await sandbox.resume({ sandboxId, environment: "staging" }); await sandbox.fork({ sandboxId, environment: "staging" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.create_sandbox_request import CreateSandboxRequest from boat_sdk.models.resume_request import ResumeRequest from boat_sdk.models.fork_request import ForkRequest sandbox.create(create_sandbox_request=CreateSandboxRequest(ttl_seconds=3600, environment="staging")) sandbox.resume(sandbox_id, resume_request=ResumeRequest(environment="staging")) sandbox.fork(sandbox_id, fork_request=ForkRequest(environment="staging")) ``` > [!WARNING] > > `--environment` and `--env` are different flags. > > * `--environment staging` picks the environment that the sandbox uses. > * `--env KEY=value` sets one variable on that one sandbox. It adds to what the environment gives. ## Organization environments An organization has its own shared environments. Add `?org=<org id or name>` to any environment route, or `--org <org>` to any `boat env` command. Only this query parameter selects them: the `X-Boat-Org` header and the active wallet do not, so a call without `org` works on your own environments. An organization API key always works on its organization's environments. | Role | Can do | | - | - | | Member | List the organization environments and use them for sandboxes, except the ones [limited to other members](/organizations#limit-who-can-use-an-environment-or-profile) | | Owner or admin | Also create, change and delete them, and choose who can use them with `boat env access` | A sandbox billed to the organization can name an organization environment. When you have an environment of the same name, yours wins. Name an [organization credential profile](/ai-credentials#organization-profiles) on an organization environment to give the team's sandboxes the team's AI credentials. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env list --org acme boat env new agents --org acme boat env set agents --org acme --credential-profile team-claude boat --org acme new --environment agents ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/environments?org=acme" -H "Authorization: Bearer $BOAT_API_KEY" curl -sS -X PUT "$BOAT_API_BASE/environments/$ENV_ID?org=acme" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"credentialProfileId":"team-claude"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { environments } = await sandbox.environments({ org: "acme" }); await sandbox.updateEnvironment({ environmentId: envId, org: "acme", credentialProfileId: "team-claude" }); await sandbox.create({ org: "acme", environment: "agents" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} envs = sandbox.environments(org="acme") sandbox.update_environment(env_id, UpdateSandboxEnvironmentRequest(credential_profile_id="team-claude"), org="acme") sandbox.create(create_sandbox_request=CreateSandboxRequest(org="acme", environment="agents")) ``` # Private registries Source: https://docs.boat.dev/environments/private-registries Log in to private npm, pip, uv and Docker registries in every sandbox with environment variables and secret files. Put the registry token in the environment. Every new sandbox then installs from your private registry with no extra step. | Registry | What to set | Path inside the sandbox | | - | - | - | | npm, pnpm | Variable `NPM_TOKEN` and secret file `.npmrc` | `/home/user/.npmrc` | | pip | Secret file `.config/pip/pip.conf`, or variable `PIP_INDEX_URL` | `/home/user/.config/pip/pip.conf` | | uv | Variable `UV_DEFAULT_INDEX`, or `UV_INDEX_<NAME>_USERNAME` and `UV_INDEX_<NAME>_PASSWORD` | Environment only | | Docker | Secret file `.docker/config.json`, or `docker login` in a setup script | `/home/user/.docker/config.json` | Secret file paths are relative to `/home/user`. Read [Secrets, env vars and .env files](/environments/secrets). > [!WARNING] > > An environment that is [safe for third parties](/environments/access#safe-for-third-parties) gets none of these values. Check with `boat exec <id> 'echo "[$NPM_TOKEN]"'`. ## npm and pnpm npm replaces `${NPM_TOKEN}` in `.npmrc` with the variable. So the file itself holds no secret. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set-var base NPM_TOKEN=npm_xxxxxxxx printf '@acme:registry=https://npm.pkg.github.com\n//npm.pkg.github.com/:_authToken=${NPM_TOKEN}\n' \ | boat env set-file base .npmrc ``` Check it in a new sandbox: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec <id> 'npm whoami --registry https://npm.pkg.github.com' ``` ## pip Use one variable: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set-var base PIP_INDEX_URL=https://user:token@pypi.example.com/simple ``` Or use a config file: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} printf '[global]\nindex-url = https://user:token@pypi.example.com/simple\n' \ | boat env set-file base .config/pip/pip.conf ``` ## uv ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set-var base UV_DEFAULT_INDEX=https://pypi.example.com/simple boat env set-var base UV_INDEX_ACME_USERNAME=user boat env set-var base UV_INDEX_ACME_PASSWORD=token ``` `ACME` is the uppercase name of the index in your `pyproject.toml`. ## Docker The user `user` runs `docker` without `sudo`. Docker reads logins from `/home/user/.docker/config.json`. Option 1: send the config file of a machine that is already logged in. The file must hold the login itself, not a `credsStore` entry. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set-file base .docker/config.json --from ./docker-config.json ``` Option 2: log in at each start. Keep the token in a variable, and add this [repository setup script](/setup#repository-setup-scripts): ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} echo "$GHCR_TOKEN" | docker login ghcr.io --username acme-bot --password-stdin ``` > [!NOTE] > > A [saved snapshot](/snapshots/templates) keeps `/home/user/.docker/config.json` like every other file. Do not save a saved snapshot from a sandbox that holds a login that others must not use. ## Related * [Secrets, env vars and .env files](/environments/secrets) * [Setup scripts](/setup) * [Access and credentials](/environments/access) # Repositories Source: https://docs.boat.dev/environments/repositories Clone private or public GitHub repositories into every new sandbox, and find where they land. Add a repository to an environment. Each new sandbox then clones it into `/home/user/<repository name>`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env add-repo base octocat/hello-world --branch develop ``` > [!NOTE] > > Repositories need a GitHub connection on your account. If you signed in with Google or an email code, do these steps: > > 1. Open [Dashboard > Environment](https://boat.dev/dashboard?tab=environment). > 2. Under GitHub repositories, click **Connect GitHub**. > > This adds GitHub to the account that you already have. You keep the same way to sign in. Nothing else in boat needs this connection. You can also skip it and use `gh` with your own token inside the sandbox. > [!WARNING] > > A sandbox clones no repository and runs no setup script when one of these is true: > > * Its environment is [safe for third parties](/environments/access#safe-for-third-parties). > * You created it with `--no-env`. > * The **GitHub repositories** toggle of the environment is off. > > Check with `boat exec <id> 'ls /home/user'`. ## Add or remove a repository Each repository has a base branch and an optional [setup script](/setup#repository-setup-scripts). * boat clones the base branch as it is. The default is `main`. * boat never creates a branch for you, also not for forks. * A repository stays on the base branch until you, or something inside the sandbox, changes it. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env add-repo base octocat/hello-world --branch develop boat env rm-repo base octocat/hello-world ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} # $BOAT_API_BASE is https://boat.dev/api/v1 ENV_ID=$(curl -sS "$BOAT_API_BASE/environments" -H "Authorization: Bearer $BOAT_API_KEY" \ | jq -r '.environments[] | select(.name == "base") | .id') REPO_ID=$(curl -sS "$BOAT_API_BASE/repos?sync=true&q=hello-world" \ -H "Authorization: Bearer $BOAT_API_KEY" \ | jq -r '.installations[0].repositories[0].databaseId') curl -sS -X POST "$BOAT_API_BASE/environments/$ENV_ID/repos" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"repositoryId\":\"$REPO_ID\",\"baseBranch\":\"develop\"}" curl -sS -X DELETE "$BOAT_API_BASE/environments/$ENV_ID/repos/$REPO_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { environments } = await sandbox.environments(); const envId = environments.find((e) => e.name === "base")!.id; const repos = await sandbox.repos({ sync: true, q: "hello-world" }); const repo = repos.installations.flatMap((i) => i.repositories)[0]; await sandbox.addEnvironmentRepo({ environmentId: envId, repositoryId: repo.databaseId, baseBranch: "develop" }); await sandbox.deleteEnvironmentRepo({ environmentId: envId, repositoryId: repo.databaseId }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.add_environment_repo_request import AddEnvironmentRepoRequest env_id = next(e.id for e in sandbox.environments().environments if e.name == "base") repos = sandbox.repos(sync=True, q="hello-world") repo = repos.installations[0].repositories[0] sandbox.add_environment_repo(env_id, AddEnvironmentRepoRequest(repository_id=repo.database_id, base_branch="develop")) sandbox.delete_environment_repo(env_id, repo.database_id) ``` > [!NOTE] > > The older `POST /repos` call (`selectRepo` in the SDKs) changes only the default environment. Use the per-environment calls above instead. ## Where repositories land The SSH user is `user` and the work directory is `/home/user`. Each folder has the name of the repository, not the `owner/name` pair. | GitHub repository | Path in the sandbox | | - | - | | `acme/web-app` | `/home/user/web-app` | | `octocat/hello-world` | `/home/user/hello-world` | | Number of repositories | Project directory for agent tools | | - | - | | One | The repository folder | | Several | `/home/user` is the parent workspace. Each repository is a folder next to the others. | # Secrets, env vars and .env files Source: https://docs.boat.dev/environments/secrets Give sandboxes environment variables and secret files such as .env, for all sandboxes or for one sandbox only. boat injects two types of secret when a sandbox starts. | Type | Inside the sandbox | | - | - | | Environment variables | Process env vars and shell exports, in `boat exec`, `boat ssh` and every shell | | Secret files | Files under `/home/user`, at the relative path that you give | ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set-var base STRIPE_KEY=sk_live_123 boat new boat exec <id> 'echo "[$STRIPE_KEY]"' # prints [sk_live_123] ``` > [!WARNING] > > A sandbox gets **no** variables and **no** secret files when one of these is true: > > * Its environment is [safe for third parties](/environments/access#safe-for-third-parties). `boat onboard` can turn this on. > * You created it with `--no-env`. > * The **Secrets** toggle of the environment is off. > * It started before you saved the secret. Run `boat env upgrade base`, or read [Versions and upgrades](/environments/versions). > > Run `boat env info base` to see the switch and the toggles. Use secrets for app credentials, API keys, `.env` files, deployment tokens and [private registry logins](/environments/private-registries). Do not put secrets in these places: * Prompts. * URLs. * CLI arguments that can go into logs. * Docker build args. * Committed files. ## Set variables and secret files Each call changes one item and makes a new environment version. The other items stay. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set-var base STRIPE_KEY=sk_live_123 boat env rm-var base STRIPE_KEY boat env set-file base backend/.env --from ./local.env cat ./local.env | boat env set-file base backend/.env boat env rm-file base backend/.env ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} # $BOAT_API_BASE is https://boat.dev/api/v1 ENV_ID=$(curl -sS "$BOAT_API_BASE/environments" -H "Authorization: Bearer $BOAT_API_KEY" \ | jq -r '.environments[] | select(.name == "base") | .id') curl -sS -X PUT "$BOAT_API_BASE/environments/$ENV_ID/vars/STRIPE_KEY" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"value":"sk_live_123"}' curl -sS -X PUT "$BOAT_API_BASE/environments/$ENV_ID/secret-files" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"path":"backend/.env","contents":"DATABASE_URL=postgres://...\n"}' curl -sS -X DELETE "$BOAT_API_BASE/environments/$ENV_ID/vars/STRIPE_KEY" \ -H "Authorization: Bearer $BOAT_API_KEY" curl -sS -X DELETE "$BOAT_API_BASE/environments/$ENV_ID/secret-files?path=backend%2F.env" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { environments } = await sandbox.environments(); const envId = environments.find((e) => e.name === "base")!.id; await sandbox.setEnvironmentVar({ environmentId: envId, key: "STRIPE_KEY", value: "sk_live_123" }); await sandbox.setEnvironmentSecretFile({ environmentId: envId, path: "backend/.env", contents: "DATABASE_URL=postgres://...\n", }); await sandbox.deleteEnvironmentVar({ environmentId: envId, key: "STRIPE_KEY" }); await sandbox.deleteEnvironmentSecretFile({ environmentId: envId, path: "backend/.env" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.set_environment_var_request import SetEnvironmentVarRequest from boat_sdk.models.set_environment_secret_file_request import SetEnvironmentSecretFileRequest env_id = next(e.id for e in sandbox.environments().environments if e.name == "base") sandbox.set_environment_var(env_id, "STRIPE_KEY", SetEnvironmentVarRequest(value="sk_live_123")) sandbox.set_environment_secret_file(env_id, SetEnvironmentSecretFileRequest( path="backend/.env", contents="DATABASE_URL=postgres://...\n", )) sandbox.delete_environment_var(env_id, "STRIPE_KEY") sandbox.delete_environment_secret_file(environment_id=env_id, path="backend/.env") ``` > [!NOTE] > > The older `POST /secrets` call (`updateSecrets` in the SDKs) changes only the default environment. It **replaces** all variables and secret files. Use the per-environment calls above instead. ## .env files A secret file is the way to put a `.env` file in each sandbox. The path is relative to `/home/user`. There is no repository picker. To put a file inside a clone, start the path with the repository folder name. This path: ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} web-app/backend/.env ``` writes to: ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} /home/user/web-app/backend/.env ``` boat skips absolute paths and paths that go outside `/home/user`. ## Variables for one sandbox The variables of an environment apply to every sandbox that uses it. To give one sandbox its own values, pass `env` when you create it. boat merges the per-sandbox values over the environment's values. If the two have the same key, the per-sandbox value wins. Per-sandbox values also reach a sandbox made with `--no-env`. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --env DATABASE_URL=postgres://... --env FEATURE_FLAG=1 ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"ttlSeconds":3600,"env":{"DATABASE_URL":"postgres://...","FEATURE_FLAG":"1"}}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.create({ ttlSeconds: 3600, env: { DATABASE_URL: "postgres://...", FEATURE_FLAG: "1" }, }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.create_sandbox_request import CreateSandboxRequest sandbox.create(create_sandbox_request=CreateSandboxRequest( ttl_seconds=3600, env={"DATABASE_URL": "postgres://...", "FEATURE_FLAG": "1"}, )) ``` | Rule | Limit | | - | - | | Key format | `[A-Za-z_][A-Za-z0-9_]*` | | Key length | 128 characters maximum | | Variables per sandbox | 100 maximum | | Total size per sandbox | 64KB maximum | | Reserved boat-internal names (`ASCII_TOKEN`, `BOAT_ID`, and similar) | Rejected | A fork gets the per-sandbox variables of its source sandbox. If the fork passes its own `env`, it does not get them. # Versions and upgrades Source: https://docs.boat.dev/environments/versions Each saved change makes a new environment version. A sandbox moves to it only when you upgrade. Each time you save a change to an environment, boat makes a new version. ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} you save a change ──▶ a new version is created │ ├──▶ every sandbox that starts from now on gets it │ └──▶ Sandboxes already running: nothing happens │ └──▶ they move only when you upgrade ``` ## Which version a sandbox uses * A sandbox takes the latest version **at the moment it starts**. * The sandbox keeps that exact version for the rest of its life. * A save never changes a running sandbox. * There is no automatic upgrade, no background rollout and no scheduled window. * A sandbox moves only when you click **Upgrade** in the dashboard or run `boat env upgrade`. ## Find the version of a sandbox 1. Run `boat info <id>`. It shows the version as `environment` and `environmentVersion`. 2. Run `boat env list`. It shows the latest version of each environment. 3. Compare the two numbers. A sandbox below the latest still runs the older configuration. This is the usual answer to "I added that secret. Why does my sandbox not have it?" If the versions match, check the [safe for third parties](/environments/access#safe-for-third-parties) switch. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat info bx_f7k2q9hd # env: prod (v2) boat env list # prod latest v3 -> this sandbox is one upgrade behind ``` ## Upgrade An upgrade applies the new configuration. It also removes every secret that the new version withholds. | Sandbox state | When the upgrade applies | | - | - | | Live | Immediately. boat cleans and updates it. | | Stopped | When it resumes | > [!WARNING] > > You cannot undo an upgrade on the disk of that sandbox. boat deletes a withheld secret from the machine. It does not hide it. If you pin the sandbox to the older version again, a secret file that the newer version dropped does not come back. The Versions panel lists every version and the number of sandboxes on each. Use it to find sandboxes that still run an old configuration. To upgrade only some sandboxes, give `upgradeEnvironment` an optional list of sandbox ids (`agentIds`). Without the list, boat moves every sandbox of yours that is on an older version. For the commands, read [Manage environments](/environments/manage). # Evals and RL environments Source: https://docs.boat.dev/evals Run many eval or RL episodes on boat: one saved snapshot per environment, one fresh sandbox per episode, parallel fan-out within start limits, teardown, cost. Harbor and Terminal-Bench status. An episode is one sandbox. Prepare the environment once, save it as a saved snapshot, and start each episode from it. Delete the sandbox when the episode ends. The next episode starts from the same clean state. ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark-default"}} %%{init: {"theme": "base", "fontFamily": "IBM Plex Mono", "themeVariables": {"fontFamily": "IBM Plex Mono", "fontSize": "14px", "primaryColor": "#F1F3F9", "primaryBorderColor": "#263FA9", "primaryTextColor": "#060606", "secondaryColor": "#E0E3F2", "tertiaryColor": "#FEFEFE", "lineColor": "#060606", "textColor": "#060606", "mainBkg": "#F1F3F9", "nodeBorder": "#263FA9", "clusterBkg": "#FEFEFE", "clusterBorder": "#C4C4C4", "edgeLabelBackground": "#FEFEFE", "actorBkg": "#F1F3F9", "actorBorder": "#263FA9", "actorTextColor": "#060606", "actorLineColor": "#9E9E9E", "signalColor": "#060606", "signalTextColor": "#060606", "labelBoxBkgColor": "#F1F3F9", "labelBoxBorderColor": "#263FA9", "noteBkgColor": "#E0E3F2", "noteBorderColor": "#E0E3F2", "noteTextColor": "#060606", "sectionBkgColor": "#F1F3F9", "altSectionBkgColor": "#FEFEFE", "taskBkgColor": "#263FA9", "taskBorderColor": "#263FA9", "taskTextColor": "#FEFEFE", "gridColor": "#E0E0E0"}, "flowchart": {"padding": 16, "nodeSpacing": 48, "rankSpacing": 48, "curve": "linear"}, "sequence": {"boxMargin": 16, "actorMargin": 48, "noteMargin": 16, "messageMargin": 32, "mirrorActors": false}, "state": {"padding": 16}, "gantt": {"barHeight": 24, "barGap": 8, "fontSize": 14, "sectionFontSize": 14}}}%% flowchart LR P[Prepare one sandbox] --> S[Save saved snapshot] S --> E1[Episode 1: boat new --from] S --> E2[Episode 2: boat new --from] S --> E3[Episode N: boat new --from] E1 --> D[Score, then delete] E2 --> D E3 --> D ``` ## 1. Prepare the environment Install the task's dependencies and fixtures in one sandbox. Then save it under a name: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} id=$(boat new --json | jq -r 'select(.event == "ready") | .id') boat exec "$id" --timeout 600 -- bash -lc 'git clone https://github.com/acme/eval-tasks && pip install -r eval-tasks/requirements.txt' boat snapshot "$id" task-env-v1 boat delete "$id" --yes ``` * Use one saved snapshot per environment version: `task-env-v1`, `task-env-v2`. A saved snapshot does not change after you save it. * Docker images: a saved snapshot keeps only the images that a container uses. Run `docker create --name keep-<x> <image>` for each image. See [What a snapshot saves](/snapshots/whats-saved#docker). * 10 saved snapshots are free. Each one more costs \$0.056 a day from the wallet. See [Saved snapshots](/snapshots/templates). ## 2. Run episodes in parallel This Python script starts one sandbox per episode from the saved snapshot, runs the episode, reads the score and deletes the sandbox. It paces the starts to the minute limit of the \$20 plan. ```python title="run_episodes.py" theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import os import time import uuid from concurrent.futures import ThreadPoolExecutor from boat_sdk import ApiClient, Configuration, exec_command, wait_until_ready from boat_sdk.api.boat_api import BoatApi from boat_sdk.exceptions import ApiException from boat_sdk.models import CreateSandboxRequest STARTS_PER_MINUTE = 12 # $20 plan. See https://docs.boat.dev/limits STARTS_PER_HOUR = 60 # $20 plan. The hour limit is the tighter one for long runs. TEMPLATE = "task-env-v1" config = Configuration(host="https://boat.dev/api/v1", access_token=os.environ["BOAT_API_KEY"]) def start(boat: BoatApi) -> str: request = CreateSandboxRequest(var_from=TEMPLATE, type="small", ttl_seconds=3600) key = str(uuid.uuid4()) # the same key on a retry never makes a second sandbox for attempt in range(6): try: return boat.create(idempotency_key=key, create_sandbox_request=request).sandbox.id except ApiException as exc: if exc.status not in (429, 503): raise time.sleep(min(60, 2 ** attempt * 5)) raise RuntimeError("could not start a sandbox") def episode(boat: BoatApi, n: int) -> tuple[int, int, str]: sandbox_id = start(boat) try: wait_until_ready(boat, sandbox_id) result = exec_command(boat, sandbox_id, f"python3 eval-tasks/run.py --episode {n}", timeout_seconds=600) out = result.actual_instance return n, out.exit_code, out.stdout finally: boat.delete_sandbox(sandbox_id=sandbox_id, x_ascii_confirm_delete=sandbox_id) with ApiClient(config) as client: boat = BoatApi(client) with ThreadPoolExecutor(max_workers=50) as pool: futures = [] for n in range(100): futures.append(pool.submit(episode, boat, n)) # pace the starts under both the minute and the hour limit time.sleep(max(60 / STARTS_PER_MINUTE, 3600 / STARTS_PER_HOUR)) for future in futures: n, code, stdout = future.result() print(n, code, stdout.strip()[-200:]) ``` * `exec_command` waits at most 600 seconds. For a longer episode, start it with `detached=True` and poll `command_status`. See [Python SDK](/sdks/python#run-a-long-job-or-a-server-in-the-background). * `ttl_seconds=3600` stops a sandbox after one hour if your script crashes before the delete. * In asyncio code, wrap each call in `asyncio.to_thread`. The SDK is synchronous. ### Fork instead of a saved snapshot `boat fork <id>` (or `fork` in the API) also copies a sandbox. Use it to branch one episode mid-way, for example to try several actions from the same state. * A fork copies the newest snapshot of its source. If the source keeps running, later forks get later states. * A fork of a running sandbox uses its last background snapshot. Files written after it can be missing. Stop the source first for an exact copy. For a fixed start state, use a saved snapshot. See [Resume and fork](/snapshots/resume-and-fork). ## Limits | Plan | Starts per minute / hour / day | Sandboxes at once | | - | - | - | | \$20 | 12 / 60 / 200 | 100 | | \$100 | 30 / 210 / 840 | 300 | | \$500 | 65 / 420 / 1,680 | 1,000 | | \$2000 | 90 / 600 / 2,400 | 2,000 | | [Free trial](/free-trial) | 5 / 25 / 75 | 2 | * On the \$20 plan, the hour limit (60) sets the pace: 100 episodes take about 100 minutes to start. On the \$100 plan (210 per hour), they take about 29 minutes. The day limit caps a long run. * A start above the limit fails with `429 rate_limited`, names the `window`, and does not count. The API sends a `Retry-After` header. * An organization on the \$2000 plan multiplies these numbers by its seats. Below it, each extra seat adds 20%. * `--fail-fast` (`fail_fast=True`) answers in about 1.5 seconds when no machine is free, instead of waiting. All limits and how to raise them: [Limits](/limits). ## Cost boat bills each second that a sandbox runs. A deleted sandbox costs nothing. | Run | Size | Cost | | - | - | - | | 100 episodes of 10 minutes | `small` (\$0.018 an hour) | about \$0.30 | | 100 episodes of 10 minutes | `default` (\$0.036 an hour) | about \$0.60 | | 1,000 episodes of 30 minutes | `default` | about \$18 | Model calls are extra when an agent runs in the sandbox. See [Pricing](/pricing) and [AI credentials](/ai-credentials). ## Agents in the episode To run Claude Code, Codex or another harness in each sandbox, send a prompt to the sandbox and wait for it. See [Integrated agents](/integrated-agents) and [Python SDK](/sdks/python#prompt-an-integrated-agent). To keep your model keys out of the sandboxes, use the [AI credentials proxy](/ai-credentials). For episodes that other people or untrusted code control, create the sandboxes with `no_env=True`. They then get none of your secrets. ## AgentEnv [AgentEnv](https://www.agentenvframework.com/) runs its environments and agents on boat with its built-in `boat` sandbox provider. See [AgentEnv](/integrations/agentenv). ## Harbor and Terminal-Bench * [Harbor](https://docs.harborframework.com) runs on boat through the [Harbor adapter](/integrations/harbor) (`harbor run -e harbor_box_environment:BoxEnvironment`). * **Terminal-Bench 2.0 does not run through that adapter today.** Each of its tasks names a prebuilt Docker image, and the adapter refuses tasks with a Docker image. * To run a Terminal-Bench style task on boat now, install its dependencies in a saved snapshot (step 1) and run the task's test script with `boat exec`. ## Clean up List what is still running, and delete what your run left: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat list --json | jq -r '.sandboxes[] | "\(.id) \(.name)"' boat delete bx_... --yes ``` # FAQ Source: https://docs.boat.dev/faq Short answers to the questions customers ask most: trial and billing, limits, sizes, stop and resume, snapshots, secrets, public URLs, SSH, agents, the API, teams, errors and security. ## Getting started > [accordion] Do I need a GitHub account? > > No. You can sign in with GitHub, Google, or a 6-digit code that we email to you. You need GitHub only to clone your repositories into a sandbox. You can connect it later. Read [Sign-in methods](/account#sign-in-methods). > [accordion] I signed in with Google and my sandboxes are gone, or the CLI asks me to pay again. > > You are on a second account. Each sign-in method makes its own account, unless you connected it to your account first. A matching email does not link them. > > 1. Sign in again with the method that you used first. > 2. Add the other method from [Dashboard > Account](https://boat.dev/dashboard?tab=account). > > Only support can merge two accounts that already exist. [Contact us](/support) with both sign-ins. > [accordion] How do I change the email address boat writes to? > > boat writes to the connection that is marked primary. Connect the address that you want, then make it primary from [Dashboard > Account](https://boat.dev/dashboard?tab=account). You cannot remove your primary connection or your last connection. > [accordion] Can I use my own Dockerfile or image? > > No. boat has no custom image and no Dockerfile build. Install your tools in a sandbox, save it as a saved snapshot, then start each sandbox with `boat new --from <name>`. You can also run your image with Docker inside the sandbox. Read [Saved snapshots](/snapshots/templates). > [accordion] Does the setup script run as root? Does it run again on resume? > > A setup file (`--setup-file`) runs one time, as `user`. Use `sudo` for root. Repository setup scripts run at every start, also at resume and fork. Read [Setup scripts](/setup). ## Pricing, trial and billing > [accordion] Is there a free tier? Do I need a credit card? > > There is no free tier. Your first plan starts with a free 7-day trial, and checkout asks for a card. Until your first payment you get 25 hours of compute, 2 sandboxes at once, auto-stop of 2 hours or less, and no `large` size. Organizations get no trial. Read [Free trial](/free-trial). > [accordion] I paid, but I still have the trial limits. > > The trial limits stay until the first payment. Click **Upgrade now** on [Dashboard > Billing](https://boat.dev/dashboard?tab=billing) to pay now. If an organization pays for you, run `boat org switch <org>`. Read [End the trial early](/free-trial#end-the-trial-early). > [accordion] "This identity is not eligible for another free trial." > > One person gets one trial. A second account, for example from a second sign-in method, gets no new trial. Sign in with the method that you used first. Read [Who gets a trial](/free-trial#who-gets-a-trial). > [accordion] I cancelled my trial. Can I still be charged? > > No. **Cancel trial** on the Billing tab ends the trial now with no charge. If you see a charge after a cancel, [contact us](/support) for a refund. Read [Cancel the trial](/free-trial#cancel-the-trial). > [accordion] How do I cancel, change my card or get an invoice? > > Run `boat billing portal` for the card and invoices. Cancel the plan with **Cancel plan** on [Dashboard > Billing](https://boat.dev/dashboard?tab=billing). Read [Card, invoices and plan changes](/billing/plan-changes). > [accordion] I forgot to cancel and was charged. Can I get a refund? > > boat does not refund unused time in general. Email support with the invoice number. Read [Refunds](/billing/plan-changes#refunds). > [accordion] Why did a plan change move my billing date? > > A plan change starts a new billing month that day. Stripe credits the unused part of the old plan and charges the new price minus that credit. Read [Upgrade or downgrade](/billing/plan-changes#upgrade-or-downgrade). > [accordion] Is there a fee per start? > > Not inside your included starts. Above them, a start costs \$0.03 to \$0.07. Read [Extra starts](/limits#extra-starts). > [accordion] Am I billed when a sandbox is stopped? > > No machine time. Two charges continue while sandboxes are stopped: > > * Saved snapshots above your plan's included count: \$0.056 a day each, from the wallet. > * The [AI credentials proxy](/ai-credentials#pricing), while it is on: \$1 a day, from the wallet. > > A stopped sandbox keeps its disk for free for at least 14 days. After that, automated retention cleanup can delete it once enabled. The job currently reports candidates without deleting them in production. Save a saved snapshot before day 14 to keep the disk longer. Read [Keep a stopped sandbox longer than 14 days](/snapshots/stop#keep-a-stopped-sandbox-longer-than-14-days). > [accordion] What do snapshots, IP addresses and network traffic cost? > > Nothing extra. Automatic snapshots, a public IPv6 address, outbound IPv4 and egress are included. Only saved snapshots above your plan's included count cost money. Read [Included at no cost](/pricing#included-at-no-cost). > [accordion] Is boat cheaper than providers that bill only active CPU? > > boat bills a flat price per size per hour. For a typical sandbox, boat costs less. A sandbox that is almost always idle can cost less elsewhere, so stop idle sandboxes. Read [Pricing](/pricing). > [accordion] Does unused time or money expire? > > Included plan time resets every billing period. Money in the wallet never expires. > [accordion] Where did credit packs and auto-refill go? > > One dollar wallet replaces them. Add any amount with **Pay** or `boat wallet pay 50`, or turn on auto top-up. Payments of \$200 or more get a bonus. Old balances moved to the wallet in dollars. Read [Wallet](/billing#wallet). > [accordion] Can I add money for an organization? > > Yes, if you are the owner. Run `boat --org <org> wallet pay 50`, or click **Pay** on the organization's Billing tab. Money in a personal wallet stays personal. Read [Plan, wallet and running out](/billing). > [accordion] How much has one sandbox cost me? Can I bill my own customers? > > The dashboard shows it in the **Cost** column of the Sandboxes page and in **Cost by sandbox this month** on the Billing page. From code, run `boat usage <id>`, call `GET /sandboxes/{sandboxId}/usage`, or list every sandbox with `GET /sandboxes?include=cost`. You get the machine time and list-price cost, while the sandbox runs or after it stops. Read [Per-sandbox usage](/billing#per-sandbox-usage). > [accordion] Can I set a spend cap? > > A personal account has no dollar cap. Leave auto top-up off, and your spend stops at your plan and your wallet. An organization owner can cap each member. Read [Control your spend](/billing#control-your-spend). > [accordion] My card failed. What happens to my sandboxes? > > Update the card with `boat billing portal`, then pay the open invoice. For an organization, select it and use **Manage billing** on the Billing tab. Read [Running out](/billing#running-out). ## Limits > [accordion] What counts as a start, and what are the limits? > > Create, fork and resume each count as one start. A resume that takes back the kept machine of the sandbox does not count. Your plan sets starts per minute, per hour and per day. > > | Plan | Starts per minute / hour / day | Sandboxes at once | > | - | - | - | > | \$20 | 12 / 60 / 200 | 100 | > | \$100 | 30 / 210 / 840 | 300 | > | \$500 | 65 / 420 / 1,680 | 1,000 | > | \$2000 | 90 / 600 / 2,400 | 2,000 | > | [Free trial](/free-trial) | 5 / 25 / 75 | 2 | > > Read [Limits and errors](/limits). > [accordion] When does the daily start limit reset? > > Nothing resets at midnight. The windows roll: a start stops counting 24 hours after it happened. Run `boat limits` to see what is left. Read [Limits and errors](/limits). > [accordion] Are limits per API key, per account or per organization? > > Per wallet: your personal account, or the organization that pays. API keys have no limits of their own. An organization shares one pool, sized by its plan and seats. Read [Shared limits](/organizations/seats-and-limits#shared-limits). > [accordion] How do I get more starts or more sandboxes at once? > > Move to a bigger plan. Below the \$2000 plan, one more organization seat adds only 20% of the plan limits. On the \$2000 plan, each seat adds the full limits. For short peaks, keep money in the wallet: starts above a limit cost \$0.03 to \$0.07 each, up to 6 times the hour and day limits and 3 times the minute limit. boat raises limits only on custom plans above \$2000 a month. [Contact us](/support) for a custom plan. Read [Raise a limit](/limits#raise-a-limit). > [accordion] Do API calls such as exec and file writes have a rate limit? > > Yes: 10,000 requests in 60 seconds from one IP address, on all endpoints. An open stream counts once. The `RateLimit` header on every answer shows what is left. Above it, boat answers `429` with `retryAfter` in the body. Read [Limits and errors](/limits). > [accordion] How long can one command run? > > A command that waits for its result has a default timeout of 30 s. In the CLI, `boat exec <id> --timeout 0 -- <command>` waits with no limit and prints the output live. Through the API the maximum is 600 s: for longer work, run it detached. Read [Background commands](/long-running-tasks/background-commands). ## Sizes and machines > [accordion] Do sandboxes have GPUs? > > No. No size has a GPU. For GPU work, use a GPU provider and keep boat for the agent and the code. Read [Sandbox sizes](/machines). > [accordion] Which size is medium? > > `default` is the medium size: 4 vCPU, 8 GB of RAM, \$0.036 an hour. The sizes are `small`, `default`, `large` and `xlarge`. Read [Pricing](/pricing). > [accordion] How do I get xlarge? Is there a bigger or custom size? > > Subscribe to the \$100 plan or higher, then pass `--type xlarge`. You do not have to ask us. There is no size above `xlarge` and no custom size. Read [Sandbox sizes](/machines). > [accordion] Can I resize a sandbox? > > Yes. Stop the sandbox, then resume it with `--type`. A larger size always works. A smaller size fails if the sandbox holds more data than the smaller disk takes. Read [Change size](/machines/change-size). > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} > boat stop bx_f7k2q9hd > until [ "$(boat info bx_f7k2q9hd --json | jq -r .sandbox.state)" = "stopped" ]; do sleep 2; done > boat resume bx_f7k2q9hd --type large > ``` > [accordion] Why do benchmark results differ between sandboxes? > > Sandboxes run on physical hosts dedicated to boat. They share vCPUs with other sandboxes on the same host, so a busy host can make a run slower. The fleet uses more than one CPU model. Read [Where your sandbox runs](/machines/virtualization#where-your-sandbox-runs). > [accordion] Can I run KVM, Firecracker or the Android emulator? > > Yes. Every sandbox has `/dev/kvm`. Read [Virtualization](/machines/virtualization). > [accordion] Which OS and kernel? Can I get a newer kernel? > > Every sandbox runs Ubuntu 24.04 LTS on Linux 6.8. boat has one image for all customers, so you cannot get another kernel. For another kernel, run your own virtual machine inside a sandbox with KVM. Read [Base image and pre-installed tools](/machines/tools). > [accordion] Which apt mirror is fastest? apt-get is slow with the Azure mirror. > > Use `fr.archive.ubuntu.com`. Read [Fast apt-get](/ci#fast-apt-get-use-the-french-ubuntu-mirror) in the CI guide. > [accordion] Is boat good for sustained heavy compute? > > Sandboxes have shared vCPUs. They are best for agent work that comes in bursts. `boat new --type large` gives two times the CPU and memory of `default`. For multi-hour loads at 100% CPU, dedicated compute is a better fit. ## Stop, resume and snapshots > [accordion] Can I pause a sandbox? How long is a stopped sandbox kept? > > There is no pause. A stop removes the machine and keeps the disk. The API reports a stopped sandbox as `archived`. > > boat keeps the disk for at least 14 days after the stop. After that, automated retention cleanup can delete it once enabled. The job currently reports candidates without deleting them in production. Once deleted, resume fails with `409 snapshot_data_expired`. Save a saved snapshot before day 14 to keep the disk longer. This works on a stopped sandbox, with no resume. Read [Keep a stopped sandbox longer than 14 days](/snapshots/stop#keep-a-stopped-sandbox-longer-than-14-days). > [accordion] Why did my sandbox stop? > > | Cause | Read | > | - | - | > | Its auto-stop time ran out (1 hour by default) | [Auto-stop](/long-running-tasks/auto-stop) | > | Your wallet was empty for 24 hours after the included time ran out | [Running out](/billing#running-out) | > | The free trial used its 25 hours, or it was cancelled | [Free trial](/free-trial) | > | Snapshots failed for 3 days, so boat forced a stop | [When a stop is refused](/snapshots/stop#when-a-stop-is-refused) | > | An organization owner capped your usage | [Per-member caps](/organizations/seats-and-limits#per-member-caps) | > > Your disk stays in every case. Resume the sandbox. Read [Troubleshooting](/troubleshooting#why-did-my-sandbox-stop). > [accordion] Auto-stop restarts at each resume. How do I keep a long job alive? > > Auto-stop counts from create or the last resume, not from activity. A running prompt moves it later. Run `boat extend <id> --hours 12` to set it to 12 hours from now, or `--no-auto-stop`. Read [Auto-stop](/long-running-tasks/auto-stop). > [accordion] How do I get rid of a sandbox? > > Use `boat stop` in almost all cases. It is free, and you can resume within 14 days. To erase a sandbox and its snapshots for good, run `boat delete <id>`. Read [Delete a sandbox or snapshot](/data-retention/delete). > [accordion] Why is my stop refused, or why does a sandbox keep running after a stop? > > A stop takes a last snapshot first. If that snapshot fails, boat refuses the stop and keeps the sandbox running, so you do not lose work. You do not pay for that time. `boat stop --force` stops from the last good snapshot and loses later writes. Read [When a stop is refused](/snapshots/stop#when-a-stop-is-refused). > [accordion] How do I know that a stop is done? > > `boat stop` returns at `stopping`. Poll until the state is `stopped`. Read [Wait for the stop in a script](/snapshots/stop#wait-for-the-stop-in-a-script). > [accordion] Can I save app state just before a stop? > > Yes. Put a command in `~/.boat/pre-stop`. boat runs it before the last snapshot of every stop and auto-stop. A saved snapshot save does not run it. Read [Save app state before a stop](/snapshots/stop#save-app-state-before-a-stop). > [accordion] How fast are resume and fork? When can I run commands? > > A few seconds, whatever the sandbox holds. Files stream in the background, and a read waits for its own file. Wait for state `ready` or `idle` before you run commands. Services and Docker start a few seconds after `ready`. Read [Readiness and resume speed](/readiness). > [accordion] My app takes long to answer after a resume. Can its files load first? > > Yes. boat records which files open first and fetches them first next time. Resume, start your app, wait for `hydrated: true`, then save or stop. Leave rebuild output out with `.boatignore`. Read [Make the first start faster](/readiness#make-the-first-start-faster). > [accordion] Do processes and Docker containers survive stop and resume? Is there a memory snapshot? > > A resume within 10 minutes of the stop usually gets the same machine back, with memory and every program still running. Do not count on it. After 10 minutes, a resume starts a new machine from the snapshot. A snapshot saves the disk, not memory. Programs that you started by hand do not come back. Enabled systemd services and Docker containers start again by themselves. Every tagged Docker image comes back. The Docker build cache does not come back. Read [A restore is like a reboot](/snapshots/whats-saved#a-restore-is-like-a-reboot). > [accordion] What does a snapshot save? Why did \~/.cache or a folder disappear? > > A snapshot saves every home folder under `/home`, folders that you create at `/`, and your changes in `/etc`, `/usr`, `/opt`, `/root`, `/srv` and `/var`. It does not save `/tmp` or `~/.cache`. It keeps two folders of `~/.cache`: Playwright browsers (`ms-playwright`) and the Deno cache (`deno`). Read [What a snapshot saves](/snapshots/whats-saved). > [accordion] Why did my hostname change after a resume? > > A snapshot does not save the hostname, the IP address or the SSH host keys. To keep a hostname, set it from an enabled systemd service. Read [Keep a hostname](/snapshots/whats-saved#keep-a-hostname). > [accordion] Saved snapshot, fork or automatic snapshot: which one do I use as a template? > > Use a saved snapshot: `boat snapshot <id> <name>`, then `boat new --from <name>`. New sandboxes never change it, and it stays after you delete the source. A fork copies the newest automatic snapshot of one sandbox. Read [Saved snapshots](/snapshots/templates). > [accordion] Is there a limit on saved snapshots? Why are they charged every day? > > There is no maximum. Your plan includes 10 for every \$20 of plan per seat, and never fewer than 10. Each one more costs \$0.056 a day, taken each day from the wallet. Saved snapshots have no scheduled expiry. Unpaid extras can be deleted after 7 days. Read [Saved snapshot pricing](/snapshots/templates#saved-snapshot-pricing). > [accordion] When does a saved snapshot save capture the disk? > > The call returns at once with status `saving`, and the capture runs after that. A write right after the call can land in the save. Wait until `getSavedSnapshot` shows `ready` before you write again. Read [Save a saved snapshot](/snapshots/templates#save-a-saved-snapshot). > [accordion] Can I start from a fixed version of a saved snapshot? > > A name always deploys its newest save. To keep a version, save it under a new name, for example `web-stack-v3`, and never save that name again. Read [Update a saved snapshot](/snapshots/templates#update-a-saved-snapshot). > [accordion] Can another account use my saved snapshot? > > Yes. Run `boat snapshot share <name>` and give the `bsh_...` code. The other account runs `boat new --from bsh_...`. boat removes your logins, keys, secret files and repository clones first. Read [Share a saved snapshot](/snapshots/templates#share-a-saved-snapshot-with-another-account). > [accordion] Can I go back to an older snapshot? > > Resume and fork always use the newest snapshot. To keep a state that you can go back to, save a saved snapshot. Read [Restore an older snapshot](/snapshots/resume-and-fork#restore-an-older-snapshot-roll-back). > [accordion] How do I download a snapshot or a saved snapshot? > > Run `boat snapshot pull <snapshotId> -o ./restore`. The sandbox can be stopped. For a saved snapshot, use its `snapshotId`. Read [Download a snapshot](/snapshots/download-and-delete). > [accordion] Can I turn snapshots off? > > Yes. Run `boat new --no-snapshots`, or send `"snapshots": false`. A stop then erases the sandbox, and you cannot resume it. Read [Snapshots and monitoring off](/data-retention/snapshots-and-monitoring-off). ## Environments and secrets > [accordion] What goes in an environment, and what goes in a saved snapshot? > > A saved snapshot holds the disk: packages and builds. An environment holds the settings: variables, secret files, repositories and logins. What you put in a Dockerfile goes in a saved snapshot. What you put in a `.env` file goes in an environment. Read [Saved snapshots and environments](/snapshots/templates#saved-snapshots-and-environments). > [accordion] Can I set secrets per repository, or for my whole company? > > Secrets belong to an environment, not to a repository. Make one environment per project. An organization environment is shared by all members. Read [Environments](/environments). > [accordion] How do I give one sandbox or one fork its own secret? > > Pass per-sandbox variables: `boat fork <id> -e KEY=VALUE`, or `env` in the API body. They replace the variables that the fork gets from its source. Read [Variables for one sandbox](/environments/secrets#variables-for-one-sandbox). > [accordion] Can I pass variables to one command only? > > No. The command API has no `env` field. Put `export KEY=value;` in front of the command, or set per-sandbox variables at create. Read [Variables for one sandbox](/environments/secrets#variables-for-one-sandbox). > [accordion] Does a deploy from my saved snapshot get my logins? > > A deploy gets its environment from `--environment`, not from the source sandbox. It does get the per-sandbox variables of the source. Do not put a secret in `--env` on a sandbox that you save as a saved snapshot. Read [Saved snapshots and environments](/snapshots/templates#saved-snapshots-and-environments). > [accordion] Can I keep real API keys out of the sandbox? > > Yes. Turn on the AI credentials proxy. The sandbox gets placeholder keys, and boat adds the real key to each request. Read [AI credentials](/ai-credentials#the-ai-credentials-proxy). ## Networking and public URLs > [accordion] Is EU latency a problem from the US or Latin America? > > Round trips take about 100 to 200 ms. Agent work runs for minutes, so you do not notice this in practice. For production traffic from end users, publish builds to a CDN or a regional host. Read [Sandbox per user](/platform-guide). > [accordion] Does a sandbox have a public IPv4 address? > > Every sandbox has a public IPv6 address and outbound IPv4. Some sandboxes have no IPv4 address of their own. SSH and [public URLs](/hosting) work over IPv4 anyway. The IP address changes at each resume, so use a public URL. > [accordion] How do I make a URL without a token? > > Run `boat host <id> 3000 --public`, or send `"public": true` to `POST /sandboxes/{id}/host`. Anyone with the URL can open it. Read [Expose a port](/hosting/host-cli). > [accordion] My protected URL works in a tab but is blank in my iframe. > > In an iframe on another site, browsers can block the access cookie of a protected URL. Host the port with `--public` to embed it, or put your own server in front. Read [Show a protected URL in an iframe](/hosting#show-a-protected-url-in-an-iframe). > [accordion] My app on localhost gives 502 on its public URL. > > Host the port with `--localhost` (`"localhost": true` in the API). Or start the app on `0.0.0.0`. Read [Services that listen on localhost](/hosting/how-it-works#services-that-listen-on-localhost). > [accordion] Does the URL stay after a stop? Can I use my own domain? > > After a resume, the URL and token stay the same. Start your app again. boat does not support custom domains. Put your own proxy or CDN in front of the public URL. Read [Public URLs](/hosting). > [accordion] I use a firewall. What must stay open? > > Keep inbound TCP 8911 and the WireGuard tunnel open. boat runs commands and snapshots through them. Port 22 is SSH. A rule that blocks them marks the sandbox `degraded`. Read [What boat needs](/hosting/firewall#what-boat-needs). > [accordion] Can I block outbound internet? > > boat has no API setting for network rules. Add firewall rules in the sandbox, and run untrusted code as a separate Linux user. Snapshots do not keep firewall rules. Read [Block outbound internet](/hosting/firewall#block-outbound-internet-for-untrusted-code). ## SSH and editors > [accordion] Why does the SSH host key change after every resume? > > Each resume and fork runs on a new machine with a new host key. `boat ssh` and `boat scp` get the new key from the API for you. Other clients must read it again after each resume. Read [SSH](/ssh-access). > [accordion] How do I connect VS Code or Cursor? > > Use the SSH remote of your editor. Read [Editors](/ssh-access/editors). > [accordion] How do I move large files? > > Use a signed upload or download URL, or `boat scp`. Read [Large files](/ssh-access#large-files). ## Desktop and browser > [accordion] Can I change the desktop background or hide the stats overlay? > > Yes. Put a PNG at `~/.config/boat/wallpaper.png`. It stays after stop, resume and fork. To hide the stats, add `overlay=0` to the stream URL, before the `#`. Read [Background](/desktop-streaming/background) and [Embed the stream](/desktop-streaming/urls-and-security#embed-the-stream-in-your-app). > [accordion] Can I embed the desktop in my app? > > Yes. Read [Embed the stream in your app](/desktop-streaming/urls-and-security#embed-the-stream-in-your-app). ## Agents in sandboxes > [accordion] Which coding agents are built in? > > Seven: `codex`, `claude-code`, `pi`, `opencode`, `prime-agent`, `kimi` and `mistral`. You can install and run any other CLI agent yourself. Read [Harnesses and models](/integrated-agents/harnesses-and-models). > [accordion] A prompt fails with 409 provider_not_configured. > > Connect an AI key or subscription first. Read [Keys and subscriptions](/integrated-agents/keys). > [accordion] Codex or Claude says there is no credential, but I connected one. > > The environment has **Safe for third parties** on, so boat holds back all AI credentials. Turn it off for your own sandboxes. For end users, keep it on and use the AI credentials proxy. Read [Keys and subscriptions](/integrated-agents/keys). > [accordion] The agent in my sandbox gets 403 api_key_action_forbidden when it creates sandboxes. > > The key that boat puts in a sandbox works on that sandbox only. Give the agent a `ci` key as a secret: `boat api-key create fleet --preset ci --ttl 7d`. Read [In-sandbox API key](/api-keys/scopes#in-sandbox-api-key). > [accordion] Can I remove the built-in agents or pin their versions? > > Yes. Delete the agents that you do not want: the deletion stays after resume and fork. To pin a version, install your own copy. Your copy is used. Read [Deleted files stay deleted](/snapshots/whats-saved#deleted-files-stay-deleted). > [accordion] Can I use several Claude or ChatGPT accounts? > > Yes. Credential profiles hold several sign-ins and keys per provider. You can switch between them. Read [Credential profiles](/ai-credentials#credential-profiles). > [accordion] One sandbox per user, per project, or per session? > > [Sandbox per user](/platform-guide) compares the three patterns and their costs. > [accordion] Can I reuse one sandbox for many of my end users? > > Give each user their own sandbox. boat does not clean a sandbox between your users, and containers inside one sandbox are not isolated by boat. Start each sandbox from a saved snapshot instead. Read [One sandbox per end user](/security#one-sandbox-per-end-user). > [accordion] How long should I leave a user's sandbox running before stopping it? > > boat has no idle timer. Run your own countdown, and call `boat stop` a few seconds to about two minutes after the agent finishes. Resume takes seconds, but each resume counts as a start. Read [Sandbox per user](/platform-guide). > [accordion] How do I handle launch spikes? > > 1. Prepare one sandbox and save it as a [saved snapshot](/snapshots/templates). > 2. Start each user's sandbox from it with `boat new --from <name>`. > 3. Make sure that your start limits cover the peak. > > A sandbox from a saved snapshot gets the full disk in seconds, so you never pay for the same install again. ## API, SDK and CLI > [accordion] Which API key preset can create sandboxes? > > `ci` creates, uses and deletes sandboxes. `full-sandbox` uses existing sandboxes only. `admin` can do everything. An older `ci` key lacks resume: create a new one. Read [Presets](/api-keys/scopes#presets). > [accordion] Are API keys tied to my account or to an organization? > > A key acts as you. An organization key, made with that organization selected in the dashboard, always bills that organization and sees nothing else. An account key bills your active wallet, or the organization named with `X-Boat-Org: <org>`. Read [API keys](/api-keys). > [accordion] How long do keys last? How do I test a key? > > Keys last 90 days by default and 365 days at most. A key created with `--ttl never` (or "Never" in the dashboard) works until you revoke it. Test a key with `GET /me`. Read [API keys](/api-keys). > [accordion] A create timed out. How do I avoid a second sandbox? > > Send an `Idempotency-Key` header on every create and fork. A retry with the same key returns the same sandbox and spends no start. Read [Retry rules](/limits#retry-rules). > [accordion] My delete call does nothing. > > Every delete needs the header `X-Ascii-Confirm-Delete` with the exact target id. Without it, boat answers `409` and deletes nothing. In the TypeScript SDK, pass `xAsciiConfirmDelete`. Read [Delete a sandbox or snapshot](/data-retention/delete). > [accordion] My command never returns because it starts a background process. > > The call waits while a process keeps the output open. Run the command detached: `boat exec <id> --detach "<command>"`, or `"detached": true`. Read [Background commands](/long-running-tasks/background-commands). > [accordion] How do I follow, read or kill a detached command? > > Read only new output with offsets, attach with `boat exec <id> --attach <pid>`, and stop it with `boat exec <id> --kill <pid>`. Read [Background commands](/long-running-tasks/background-commands). > [accordion] A command returns sandbox_restoring or 502 right after a resume. > > `sandbox_restoring` means that the command did not run. Retry after 1 to 3 seconds. A 502 without that code can mean that the command ran, so check its effect first. Read [API overview](/api/v1). > [accordion] Can parallel agents each clean up only their own sandbox? > > Pass the sandbox id to every command. Without an id, the CLI uses the current sandbox of that shell. Set an auto-stop on each sandbox so that lost ones stop by themselves. Read [CLI reference](/cli-reference). > [accordion] Can I get events or metrics instead of polling? > > Yes. Webhooks send 6 events: ready, error, archived (stopped), hydrated, degraded and recovered. OpenTelemetry export sends metrics and events to your collector. Read [Webhooks](/webhooks) and [OpenTelemetry](/opentelemetry). ## Teams > [accordion] How do I move my personal plan into an organization? > > Do not cancel the personal plan by hand: its sandboxes stop with it. The owner runs `boat --org <org> org migrate`. Read [Move a personal plan](/organizations/move-personal-plan). > [accordion] The dashboard uses my team, but the API gives trial limits or subscription_required. > > The API billed your personal account. Run `boat org switch <org>` one time, or send `X-Boat-Org: <org>` on each call. `GET /limits` shows the wallet that a create bills. Read [Active wallet](/organizations/active-wallet). > [accordion] A teammate cannot see my sandbox. > > Members see the sandboxes that the organization pays for. Personal sandboxes stay hidden. Read [A teammate cannot see or use my sandbox](/organizations/active-wallet#a-teammate-cannot-see-or-use-my-sandbox). > [accordion] Does each seat need a real person? Do email aliases add seats? > > No person is needed. Set the seat count on the Billing tab. A seat counts accounts, not emails, so aliases accepted by the same account add no seat. On the \$2000 plan each seat adds the full plan limits; below it, 20%. Read [Seats](/organizations/seats-and-limits#seats). > [accordion] An invite fails with "could not add the paid seat". > > Accepting an invite with no empty seat charges the organization card for one seat. The card failed, so the invite stays unused. Fix the card with **Manage billing** on the organization's Billing tab. Read [Seats](/organizations/seats-and-limits#seats). > [accordion] How do I move a plan from an organization back to personal? > > There is no one-step move. Run `boat org switch personal`, then `boat billing plan 20`. Read [Move a plan between personal and organization](/billing/plan-changes#move-a-plan-between-personal-and-organization). ## Reliability and errors > [accordion] My sandbox does not answer, or it is in error. > > After a kernel crash, the sandbox restarts by itself in about 15 seconds. If it still does not answer, run `boat stop --force <id>`, then `boat resume <id>`. You lose what was written after the last snapshot. If you cannot lose that work, [contact us](/support) within 3 days. Read [Troubleshooting](/troubleshooting#a-sandbox-does-not-answer). > [accordion] A command was killed with exit code 137. > > The command ran out of memory. Linux killed it, and the sandbox kept running. The result shows `oomKilled: true`. Use less memory or a bigger size. Read [Exit code 137](/troubleshooting#a-command-was-killed-exit-code-137-out-of-memory). > [accordion] I got an out-of-disk email. What do I do? > > boat emails you at 85% and at 95% disk use. At 95%, snapshots fail. Free space with `docker system prune` and `sudo apt-get clean`, or resume with a bigger size. Read [Out-of-disk emails](/troubleshooting#out-of-disk-emails). > [accordion] My sandbox shows degraded. > > boat cannot reach the sandbox through the paths that it needs, often because of a firewall rule. boat does not stop it. Remove the rule, and boat sends `sandbox.recovered`. Read [What happens to a blocked sandbox](/hosting/firewall#what-happens-to-a-blocked-sandbox). > [accordion] The first outbound connection right after ready fails. > > boat has no separate network signal. Retry a failed first connection. Read [Readiness and resume speed](/readiness). > [accordion] Where do I see incidents? > > Platform status is on [status.ascii.dev](https://status.ascii.dev). Send sandbox ids to [support](/support) when a sandbox misbehaves. Read [Compliance and uptime](/compliance). ## Security, data and compliance > [accordion] Which region do sandboxes run in? Where is my data stored? > > Sandboxes run in the EU: Germany, Finland and France. You cannot pick a region. Snapshot copies can be stored outside the EU. Read [Data location](/compliance#data-location). > [accordion] Do you have compliance certifications or an SLA? > > SOC 2 is in progress. Sandboxes have a measured uptime of 99.95%. Platform status is on [status.ascii.dev](https://status.ascii.dev). Read [Compliance and uptime](/compliance). > [accordion] Can one sandbox see another? Are containers inside a sandbox isolated? > > Each sandbox is its own virtual machine. Sandboxes share no disk and no processes. The isolation boundary is the sandbox, not a container inside it. Read [Isolation between sandboxes](/security#isolation-between-sandboxes). > [accordion] Which boat credentials are inside my sandbox? > > `ASCII_TOKEN` hosts ports of its own sandbox only. The in-sandbox API key works on its own sandbox only. **Safe for third parties** removes the key and all your secrets. Read [boat credentials inside a sandbox](/security#boat-credentials-inside-a-sandbox). > [accordion] Do snapshots contain my secrets? > > A snapshot saves the disk as it is. Secrets that you write into files, including container settings, are in it. Keep keys out with the AI credentials proxy, or turn snapshots off for throwaway sandboxes. Read [Snapshots and monitoring off](/data-retention/snapshots-and-monitoring-off). > [accordion] My delete stays blocked. Must I send it again? > > No. `waiting_for_uploads` erases at `expectedBy`. `retrying` tries again by itself. A delete never waits for a fork or a saved snapshot: it completes, and they keep the data they read. Poll with `boat deletion status <id>`. Read [How a delete works](/data-retention/delete#how-a-delete-works). > [accordion] How do I report a security issue? > > Write to support with "security" in the subject. Read [Report a security issue](/compliance#report-a-security-issue). # Free trial Source: https://docs.boat.dev/free-trial The 7-day free trial: a card is required, 25 hours of compute, 2 sandboxes at once, 2-hour auto-stop, no large sizes. How it ends, how to cancel it, and how to lift the limits. Your first plan starts with a free 7-day trial. Checkout asks for a card. **There is no free tier without a card.** | Rule | Trial | After the first payment | | - | - | - | | Length | 7 days, then Stripe charges the plan | - | | Card | Required at checkout | - | | Compute | 25 hours in total, all sandboxes together | The plan's [included time](/pricing#plans) | | Sandboxes at once | 2 | The plan's limit, 100 or more | | Starts (create, fork, resume) | 5 per minute, 25 per hour, 75 per day | 12 / 60 / 200 or more | | Auto-stop | Required, 2 hours maximum | Up to 30 days, or off | | Sizes | `small` and `default` | All sizes. `xlarge` needs the \$100 plan or higher. | | Saved snapshots | You cannot save new ones. The ones you have stay free. | 10 for every \$20 of plan per seat, never fewer than 10 | * Stop, resume and fork do not reset the 25 hours. * The 25 hours count VM time. The [AI credentials proxy](/ai-credentials#pricing) is not VM time: the wallet pays it, \$1 for each day it is on. * During the trial, the wallet pays only the AI credentials proxy. You can add money only while the proxy is on, when your sandboxes used it in the last 7 days, or when the wallet is in debt. * `GET /limits` shows the allowance in `trialComputeCapSeconds` and the time used in `creditUsedSeconds`. * A resume gives the sandbox a new auto-stop window of 2 hours or less. * The trial limits stay until the first plan payment. A wallet top-up does not end the trial and does not lift its limits. * A change to another plan during the trial ends the trial. Stripe charges the new plan at once. * `boat limits` shows the trial limits and the hours that you have left. ## Who gets a trial * A person gets one trial. An account that subscribed before restarts the plan with no trial. * Organizations get no trial. An organization plan is paid from the first day. * During the trial, you can own one organization. End the trial to own up to 5. * boat can refuse a trial to an identity that looks like a repeat sign-up. The error is `trial_blocked`. If this is wrong, [contact support](/support). ## End the trial early Pay now to lift every trial limit at once: 1. Open [Dashboard > Billing](https://boat.dev/dashboard?tab=billing). 2. Click **Upgrade now**. Stripe charges the plan price at once. The 7-day period then ends, and the first month starts that day. Are you a member of an organization that pays? Then switch to it with `boat org switch <org>`. Its sandboxes do not use your trial limits. ## Cancel the trial | How | What happens | Charge | | - | - | - | | **Cancel trial** on [Dashboard > Billing](https://boat.dev/dashboard?tab=billing) | The trial ends now. boat stops your running sandboxes. Their disks stay. | None | | Cancel in the Stripe portal (`boat billing portal`) | The trial runs until its end date, then ends. | None | After a cancel, **Upgrade now** no longer works. To keep using boat, subscribe again from the Billing tab. You get no second trial. ## Errors you can get during the trial | Status | Code | Cause | Fix | | - | - | - | - | | `400` | `trial_auto_stop_required` | No auto-stop, or an auto-stop above 2 hours | Set `--ttl 7200` or less, or end the trial. | | `403` | `trial_machine_class_not_allowed` | You asked for `large` | Use `default`, or end the trial. | | `403` | `trial_saved_snapshots_not_allowed` | You saved a snapshot | End the trial. | | `400` | `trial_one_organization` | You created a second organization | End the trial. | | `429` | `limit_reached` | 2 sandboxes already run | Stop one, or end the trial. | | `429` | `rate_limited` | 5 starts in the last minute, 25 in the last hour, or 75 in the last day | Wait, or end the trial. | | `429` | `trial_compute_limit_reached` | You used the 25 hours | End the trial. | For every limit and error after the trial, read [Limits and errors](/limits). # Public URLs Source: https://docs.boat.dev/hosting Expose a port of a sandbox on a stable public HTTPS URL, protect it with a token, rename its subdomain, or open a raw TCP or UDP port. Run a service in your sandbox. boat gives it a stable public HTTPS URL. ## Quick path The API examples use `BOAT_API_BASE=https://boat.dev/api/v1`. **1. Start your app in the background** Start the app as a detached process on an explicit port. A normal command stops after 30 seconds, and a dev server never ends. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_f7k2q9hd --cwd my-repo --detach "npm run dev -- --host 0.0.0.0 --port 3000" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"npm run dev -- --host 0.0.0.0 --port 3000","cwd":"my-repo","detached":true}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "npm run dev -- --host 0.0.0.0 --port 3000", cwd: "my-repo", detached: true, }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.command_request import CommandRequest sandbox.command("bx_f7k2q9hd", CommandRequest( command="npm run dev -- --host 0.0.0.0 --port 3000", cwd="my-repo", detached=True, )) ``` > [!NOTE] > > An app on `0.0.0.0` needs no flag. An app on `localhost`, `127.0.0.1` or `::1` needs `--localhost` in the next step (`"localhost": true` in the API). See [Services that listen on localhost](/hosting/how-it-works#services-that-listen-on-localhost). **2. Host the port** ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat host bx_f7k2q9hd 3000 --title "App preview" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/host" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"port":3000,"title":"App preview"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const hosted = await sandbox.hostPort({ sandboxId: "bx_f7k2q9hd", port: 3000, title: "App preview" }); console.log(hosted.url); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.host_port_request import HostPortRequest hosted = sandbox.host_port("bx_f7k2q9hd", HostPortRequest(port=3000, title="App preview")) print(hosted.url) ``` Inside the sandbox, `host 3000` does the same thing. **3. Open the URL** The call returns the URL. A new URL is protected by default and includes a `_token` query parameter: ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} https://<sandbox-subdomain>-3000.on.boat.dev?_token=<access-token> ``` Open it in a browser. To get a URL without a token, add `--public` (`"public": true` in the API). ## Who can open a protected URL * Anyone who has the full URL with `_token` can open it. * boat does not ask for a boat sign-in. boat does not check the organization. * Treat the full URL like a password. The `_token` URL answers with a redirect that sets a cookie. A browser follows it. For `curl`, keep the cookie: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -L -c cookies.txt -b cookies.txt "https://<sandbox-subdomain>-3000.on.boat.dev?_token=<access-token>" ``` An API client can send the token as a cookie header instead: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -H "Cookie: _port_auth=<access-token>" "https://<sandbox-subdomain>-3000.on.boat.dev/api/health" ``` ### Show a protected URL in an iframe In an iframe on another site, the `_port_auth` cookie is a third-party cookie. Browsers can block it, and the frame then stays blank. The same URL works in its own tab. * To embed a preview, host the port with `--public`. * Or put your own server in front of the URL. Your server sends `Cookie: _port_auth=<access-token>` to boat. ### Replace a leaked token boat has no rotate command. Do these two calls one after the other: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat host bx_f7k2q9hd 3000 --public # removes the old token boat host bx_f7k2q9hd 3000 # makes a new token and prints the new URL ``` * The old `_token` URL stops working. * Between the two calls, the URL is open without a token. Stop the app first if this is a problem. * `host hide` does not change the token. A later `host` brings back the same token. ## Facts | Fact | Value | | - | - | | URL format | `https://<sandbox-subdomain>-<port>.on.boat.dev` | | Ports per sandbox | Up to 50 | | Default access | Protected, with `_token` | | Address your app listens on | `0.0.0.0`, or `localhost` with `--localhost` | | Host from your computer | `boat host <sandbox-id> <port>`, or `POST /sandboxes/{id}/host` | | Host from inside the sandbox | `host <port>` | | After a stop and resume | The URL stays the same. Start your app again. | | Ports that boat uses | 22, 6080, 8090, 8911, 47984 to 48010. Do not run your app on them. | | Custom domain | Not supported. See [Custom domain](#custom-domain). | | Raw TCP or UDP | Through the sandbox IP address. See [Raw TCP or UDP ports](#raw-tcp-or-udp-ports). | ## Choose the subdomain Every sandbox has one subdomain. All its public URLs use it. To change it, update the sandbox: ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PATCH "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"subdomain":"acme-staging"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.update({ sandboxId: "bx_f7k2q9hd", subdomain: "acme-staging" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.update_sandbox_request import UpdateSandboxRequest sandbox.update("bx_f7k2q9hd", UpdateSandboxRequest(subdomain="acme-staging")) ``` * The CLI has no flag for this. * Use 3 to 40 lowercase letters, digits and single hyphens. * The name cannot end with `-desktop` or with `-<number>`. * `409 subdomain_taken` means another sandbox uses the name. * The sandbox must be running or fully stopped. Else the API returns `sandbox_busy`. * Each hosted port moves to the new name, for example `acme-staging-3000.on.boat.dev`. * The old URLs stop working. The `_token` values stay the same. ## Custom domain boat does not support custom domains. * A CNAME record to an `on.boat.dev` name does not work. boat routes and issues TLS certificates only for `on.boat.dev` names. * An A record to the sandbox IP address breaks at the next resume, because the IP address changes. To show the app on your own domain, run your own reverse proxy or CDN in front of the public URL. The proxy must send the `on.boat.dev` host name to boat. ## Raw TCP or UDP ports The public URL carries HTTPS and WebSockets only. For another protocol, open the port in the sandbox firewall and connect to the sandbox IP address. **1. Open the port** ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ssh bx_f7k2q9hd "sudo ufw allow 27015/udp" ``` Use `27015/tcp` for TCP. **2. Get the address** ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat info bx_f7k2q9hd ``` Connect to `ip` on your port. * The IP address changes at each resume. Get it again after a resume. * Snapshots do not keep firewall rules. Open the port again after each resume and fork. * `boat host <id> <port> --public` also opens that TCP port on the IP address. boat opens it again after a resume. * Some sandboxes have no public IPv4 address. Then `boat info` shows `sshEndpoint`, and `ip` is an IPv6 address. Only clients with IPv6 can reach a raw port there. ## Learn more > [card] [Expose a port: host commands](/hosting/host-cli) > > `boat host`, `host`, `host list`, `host url` and `host hide`, with all options. > [card] [How public URLs work](/hosting/how-it-works) > > How boat routes a request to your sandbox. > [card] [Firewall rules](/hosting/firewall) > > Add firewall rules and block outbound traffic without breaking boat. > [card] [Forward a port to your computer](/ssh-access#forward-a-port) > > Reach a sandbox port on your own `localhost`, with no public URL. ## Related * [SSH](/ssh-access) * [Security for platforms](/security) * [Long-running tasks](/long-running-tasks) * [Desktop streaming](/desktop-streaming) # Firewall rules and outbound traffic Source: https://docs.boat.dev/hosting/firewall Add firewall rules in a sandbox, open raw ports, and block outbound internet access without breaking boat. boat has no API setting for network rules. You have root in the sandbox, so you add rules with `ufw` or `iptables`. For the full security picture, read [Security and isolation](/security). > [!WARNING] > > Snapshots do not keep firewall rules. Apply your rules again after each resume and fork. For example, run them from your setup script or from a systemd service. ## What boat needs boat reaches the sandbox in two ways. A rule that blocks either one marks the sandbox degraded. | What | Protocol | Runs as | | - | - | - | | boat agent (commands, snapshots, health) | Inbound TCP port 8911 | `user` | | Tunnel for public URLs and the agent | WireGuard, outgoing UDP to the address in `sudo wg show wg0 endpoints` | kernel, but carries packets from `user` processes | Linux tags a tunnel packet with the process that sent the data inside it. So a rule on the `user` account also blocks the tunnel. Do not block all outbound traffic for `user`. ## Block outbound internet for untrusted code Run the untrusted code as a separate Linux account. Block that account only. boat keeps working. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sudo useradd -m runner for t in iptables ip6tables; do sudo $t -I OUTPUT 1 -m owner --uid-owner runner -j REJECT sudo $t -I OUTPUT 1 -m owner --uid-owner runner -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT sudo $t -I OUTPUT 1 -m owner --uid-owner runner -o lo -j ACCEPT done sudo -u runner curl -m 5 https://example.com # fails: "Couldn't connect to server" ``` * The `runner` account can still reach services in the sandbox on `localhost`. * Insert the rules at the top (`-I OUTPUT 1`). Rules added at the end come after boat's own `ufw` rules, which accept new connections. * Do not give `runner` sudo. With root, it can delete the rules. ## Block outgoing UDP for `user` To block outgoing UDP for `user` and keep boat working, allow the tunnel endpoint first. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} WG=$(sudo wg show wg0 endpoints | awk '{print $2}' | cut -d: -f1) sudo iptables -I OUTPUT 1 -m owner --uid-owner user -p udp ! -d 127.0.0.0/8 -j REJECT sudo iptables -I OUTPUT 1 -p udp -d "$WG" -j ACCEPT ``` ## Open an inbound port The firewall refuses inbound connections by default. `host <port>` opens what a public URL needs. For a raw port, read [Raw TCP or UDP ports](/hosting#raw-tcp-or-udp-ports). ## What happens to a blocked sandbox boat never stops a sandbox for this, or marks it `error`, if it answers on any route. Instead: * The sandbox shows `"health": "degraded"` with a reason. * boat sends a [`sandbox.degraded`](/webhooks#events) webhook. Remove the rule. The sandbox becomes healthy again, and boat sends `sandbox.recovered`. # Expose a port: host commands Source: https://docs.boat.dev/hosting/host-cli Expose, list, print and hide public URLs with `boat host`, the in-sandbox `host` command and the host API. Two commands expose a service from a sandbox on a public HTTPS URL. | Command | Runs on | | - | - | | `boat host` | Your local computer | | `host` | Inside the sandbox | > [!NOTE] > > A service on `0.0.0.0` needs no flag. For a service that listens only on `localhost`, `127.0.0.1` or `::1`, pass `--localhost`. See [Services that listen on localhost](/hosting/how-it-works#services-that-listen-on-localhost). ## `boat host <sandbox-id> <port>` Expose a running service without an interactive SSH session: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat host bx_f7k2q9hd 3000 boat host bx_f7k2q9hd 3000 --title "Login preview" boat host bx_f7k2q9hd 3000 --private boat host bx_f7k2q9hd 3000 --public boat host bx_f7k2q9hd 5173 --localhost ``` The command does these steps: 1. It opens the firewall for that port. 2. It registers an HTTPS subdomain. 3. It prints the URL. If you run it again for the same sandbox and port, you get the same URL. The sandbox must run. Start the app first, as a detached process: `boat exec <id> --detach "<command>"`. | Option | Description | | - | - | | `--title <title>` | Set the display title for the hosted port. | | `--private` | Require the generated `_token` query parameter to access the URL. | | `--public` | Clear any saved access token and return a URL that does not require `_token`. | | `--localhost` | The service listens on localhost only. The sandbox relays the URL to it. | Use `--json` to print a machine-readable object with `sandboxId`, `port`, `url`, `access`, `isProtected` and `localhost`. It is a single API call. This makes it the fastest way to host a port from a script: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/host" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"port":3000,"title":"Login preview"}' ``` For an ungated URL, pass `{"public":true}`. For a service that listens on localhost only, pass `{"localhost":true}`. ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.hostPort({ sandboxId: "bx_f7k2q9hd", port: 5173, localhost: true }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.host_port_request import HostPortRequest sandbox.host_port("bx_f7k2q9hd", HostPortRequest(port=5173, localhost=True)) ``` `BOAT_API_BASE` is `https://boat.dev/api/v1`. The response has `url`, `access`, `isProtected` and `localhost`. ## In-sandbox `host <port>` Expose a running service on a stable HTTPS URL: ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} host 3000 host 3000 --title "Login preview" host 3000 --private host 3000 --public host 5173 --localhost ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"host 3000 --title \"Login preview\""}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "host 3000" }); await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: 'host 3000 --title "Login preview"' }); await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "host 3000 --private" }); await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "host 3000 --public" }); await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "host 5173 --localhost" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.command("bx_f7k2q9hd", CommandRequest(command="host 3000")) sandbox.command("bx_f7k2q9hd", CommandRequest(command='host 3000 --title "Login preview"')) sandbox.command("bx_f7k2q9hd", CommandRequest(command="host 3000 --private")) sandbox.command("bx_f7k2q9hd", CommandRequest(command="host 3000 --public")) sandbox.command("bx_f7k2q9hd", CommandRequest(command="host 5173 --localhost")) ``` The command does these steps: 1. It opens the firewall for that port. 2. It registers an HTTPS subdomain. 3. It prints the URL. If you run it again for the same port, you get the same URL. A sandbox can host up to 50 ports. | Option | Description | | - | - | | `--title <title>` | Set the display title for the hosted port. | | `--private` | Require the generated `_token` query parameter to access the URL. | | `--public` | Clear any saved access token and return a URL that does not require `_token`. | | `--localhost` | The service listens on localhost only. The sandbox relays the URL to it. `host url` takes it too. | By default, `host <port>` creates a protected URL with a `_token` query parameter. This protection stays. If you host the same port again, the URL has the same `_token`, unless you pass `--public`. After `--public`, the next protected `host` call makes a new token. See [Replace a leaked token](/hosting#replace-a-leaked-token). For a raw TCP or UDP port without HTTPS, read [Raw TCP or UDP ports](/hosting#raw-tcp-or-udp-ports). ## `host list` Show the hosted ports of the current sandbox: ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} host list ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"host list"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "host list" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.command("bx_f7k2q9hd", CommandRequest(command="host list")) ``` * `host list` shows protected ports as `(gated)`. * `host list` shows relayed ports as `(localhost)`. * `host list` does not print the access token. * To print the full URL with `_token=...`, use `host url <port>`. ## `host url <port>` Wait until the HTTPS URL is ready, then print it: ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} host url 3001 host url 3001 --public ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"host url 3001"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "host url 3001" }); await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "host url 3001 --public" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.command("bx_f7k2q9hd", CommandRequest(command="host url 3001")) sandbox.command("bx_f7k2q9hd", CommandRequest(command="host url 3001 --public")) ``` For a protected port, it prints the full token-gated URL: ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} https://<sandbox-subdomain>-3001.on.boat.dev?_token=<access-token> ``` Use it when one service needs the public URL of another service: ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} BACKEND_URL=$(host url 3001) ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} BACKEND_URL=$(curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"host url 3001"}' | jq -r '.stdout') ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const result = await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "host url 3001" }); const backendUrl = result.stdout.trim(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} result = sandbox.command("bx_f7k2q9hd", CommandRequest(command="host url 3001")) backend_url = result.actual_instance.stdout.strip() # command() returns a wrapper ``` ## `host hide <port>` Take down the public URL: ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} host hide 3000 ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"host hide 3000"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "host hide 3000" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.command("bx_f7k2q9hd", CommandRequest(command="host hide 3000")) ``` * It closes public access, unregisters the HTTPS route and turns off the localhost relay. * It does not stop the local server process. Stop the server yourself when you are done. * It keeps the access tokens. If you host the same port again, existing protected links work again. To make a leaked link useless, read [Replace a leaked token](/hosting#replace-a-leaked-token). To get an ungated URL after a port became protected, run `host <port> --public`. # How public URLs work Source: https://docs.boat.dev/hosting/how-it-works How boat routes a public HTTPS request to a port in your sandbox, apps that listen on localhost, and the Vite 'host not allowed' error. ## What `host <port>` does 1. The sandbox asks the boat backend for a stable public route for that sandbox and port. 2. The backend registers a subdomain. It uses the current machine address of the sandbox and the port that you asked for. 3. boat prints the URL. The hostname is the sandbox subdomain plus the port. ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} https://<sandbox-subdomain>-<port>.on.boat.dev ``` ## How a request reaches your app 1. boat terminates TLS for `on.boat.dev`. 2. boat proxies the request to the sandbox, on the port that you exposed. 3. Your app answers from inside the sandbox. The public HTTPS route sits in front of your app. It connects to the sandbox address, not to the loopback interface. An app on `0.0.0.0` answers there directly. ## Services that listen on localhost An app on `localhost`, `127.0.0.1` or `::1` only does not answer on the sandbox address. Declare it with `--localhost`: ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} browser -> route -> sandbox address:<port> -> Boat relay -> 127.0.0.1:<port> or [::1]:<port> ``` * The sandbox relays the port to `127.0.0.1`, then to `::1` if nothing answers on `127.0.0.1`. * The relay passes raw TCP, so HTTP, WebSockets and hot reload work. * The relay stays on after a stop, a resume and an agent upgrade. A fork does not keep it. * Each relayed port has its own small relay process. `lsof -ti :<port> | xargs kill -9` or `npx kill-port <port>` kills that relay too. The rest of the sandbox keeps working, and the relay starts again in about one second. * Every host call sets the value again. Hosting the same port without `--localhost` turns the relay off and closes its open connections. * `host hide <port>` and making the port private also turn the relay off. * Do not use `--localhost` for an app on `0.0.0.0`. The relay then holds the port, and the app cannot start again on it. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} npm run dev -- --port 5173 # Vite listens on localhost by default host 5173 --localhost ``` ## "Blocked request" or "host not allowed" Some dev servers refuse requests for host names that they do not know. Vite shows `Blocked request. This host is not allowed.` Allow the boat domain: ```js vite.config.js theme={"theme":{"light":"github-light","dark":"github-dark-default"}} export default { server: { allowedHosts: [".on.boat.dev"] }, }; ``` ## Credentials The `host` command in the sandbox uses `ASCII_TOKEN`. This token can only host ports of its own sandbox. boat registers the route. Read [Security for platforms](/security#boat-credentials-inside-a-sandbox). ## The `on.ascii.dev` domain > [!NOTE] > > boat serves every hosted address under `on.boat.dev` and `on.ascii.dev`, with the same label. `on.ascii.dev` is the name from before the rename. So `SUBDOMAIN-3000.on.ascii.dev` and `SUBDOMAIN-3000.on.boat.dev` are the same route. Links that you shared as `on.ascii.dev` keep working until boat retires that suffix. Publish `on.boat.dev` links. # Integrated agents Source: https://docs.boat.dev/integrated-agents Run Claude Code, Codex and five other coding agents inside a sandbox with boat prompt. boat keeps memory, streams events and runs tasks in parallel. Every sandbox has seven coding-agent harnesses, installed and ready: **Claude Code, Codex, pi, OpenCode, Prime Agent, Kimi Code, and Mistral Vibe**. Run `boat prompt` to give one of them a task. **1. Connect a key or a subscription** Open [Agents & Proxying](https://boat.dev/dashboard?tab=agents) and sign in to Claude or ChatGPT, or paste an API key. Do this one time. Without it, a prompt fails with `409 provider_not_configured`. Read [Keys and subscriptions](/integrated-agents/keys). **2. Give the agent a task** ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new boat prompt <id> "Add tests for the billing module" ``` The command prints the work of the agent until the turn ends. To run the agent on your own GitHub repository, read [Run a coding agent on your repo](/recipes/agent-on-repo). To run many agents at once, read [Run many agents in parallel](/recipes/parallel-agents). boat does these things for you: * It streams back what the agent does. * It keeps the memory of the agent. * It runs many tasks at the same time. * It keeps the tasks when the sandbox stops and resumes. * It lets you change the model or the harness during a task. Nothing here is hidden. It is the code you would write if you put an agent on a bare cloud computer. This page shows that code, how boat does it, and where you add your own instructions, tools, keys or harness. ## What boat builds for you | You would have to build | boat does it with | | - | - | | Install the harness, keep it updated | Seven harnesses, installed and updated on every sandbox | | Give it API keys, or the keys of your user | Your keys from [Agents & Proxying](https://boat.dev/dashboard?tab=agents), or per-sandbox keys with `boat new -e`. Read [Keys and subscriptions](/integrated-agents/keys) | | Keep real keys out of a sandbox that other people use | Placeholder keys through the AI credentials proxy. Read [AI credentials](/ai-credentials) | | Start the harness with a prompt in the right directory | `boat prompt "…"` / `POST /prompt`. It runs in `/home/user` | | Capture stdout, parse tool calls, stream them to your UI | `boat events --follow` / `GET /events`: structured prompt, response, and tool-call events. Read [Stream events](/integrated-agents/conversations#stream-events) | | Keep the session id, so the next prompt continues the thread | A **conversation**. boat keeps the history and the harness session | | Run two tasks at once without a session collision | Many parallel conversations per sandbox, each with its own harness process | | Send SIGINT to the right process | `boat interrupt --convo <id>`. To change the task without a stop, use `boat steer` | | Type to the agent while it works, for each harness | `boat steer "…"` / `POST /steer`. Read [Steer a running turn](/integrated-agents/steering) | | Save sessions to disk, so a reboot loses nothing | Conversations survive `boat stop`, `boat resume`, `boat fork` | | Let the user pick a model or a thinking level | `--model`, `--reasoning-effort` and `--fast` on every prompt | | Let the user pick a harness, and keep the context when they change it | `--provider` on every prompt. The conversation history carries across | | Add house rules, MCP servers, skills, tools | Ordinary harness config files in the sandbox home. Read [Customize the harness](/integrated-agents/customize) | | Attach a screenshot or a file | `boat prompt --attach` | | Let the agent see and use a real screen | The `computer` tools, on every harness. Read [Computer use](/integrated-agents/computer-use) | You can still do each of these by hand. boat never stops you. Run `boat ssh` and run what you want. Read [Bring your own harness](/integrated-agents/customize#bring-your-own-harness). ## How it fits together ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark-default"}} %%{init: {"theme": "base", "fontFamily": "IBM Plex Mono", "themeVariables": {"fontFamily": "IBM Plex Mono", "fontSize": "14px", "primaryColor": "#F1F3F9", "primaryBorderColor": "#263FA9", "primaryTextColor": "#060606", "secondaryColor": "#E0E3F2", "tertiaryColor": "#FEFEFE", "lineColor": "#060606", "textColor": "#060606", "mainBkg": "#F1F3F9", "nodeBorder": "#263FA9", "clusterBkg": "#FEFEFE", "clusterBorder": "#C4C4C4", "edgeLabelBackground": "#FEFEFE", "actorBkg": "#F1F3F9", "actorBorder": "#263FA9", "actorTextColor": "#060606", "actorLineColor": "#9E9E9E", "signalColor": "#060606", "signalTextColor": "#060606", "labelBoxBkgColor": "#F1F3F9", "labelBoxBorderColor": "#263FA9", "noteBkgColor": "#E0E3F2", "noteBorderColor": "#E0E3F2", "noteTextColor": "#060606", "sectionBkgColor": "#F1F3F9", "altSectionBkgColor": "#FEFEFE", "taskBkgColor": "#263FA9", "taskBorderColor": "#263FA9", "taskTextColor": "#FEFEFE", "gridColor": "#E0E0E0"}, "flowchart": {"padding": 16, "nodeSpacing": 48, "rankSpacing": 48, "curve": "linear"}, "sequence": {"boxMargin": 16, "actorMargin": 48, "noteMargin": 16, "messageMargin": 32, "mirrorActors": false}, "state": {"padding": 16}, "gantt": {"barHeight": 24, "barGap": 8, "fontSize": 14, "sectionFontSize": 14}}}%% flowchart TD You["You: CLI, API, SDK"] subgraph Backend["boat backend"] Q["Queue prompts<br/>pick harness + model"] E["Collect events"] end subgraph boat["Your Sandbox"] AS["Agent server<br/>(always on)"] A["Conversation A<br/>claude process"] B["Conversation B<br/>pi process"] C["Conversation C<br/>codex process"] D[("/home/user<br/>files, config, sessions")] end You -- "boat prompt" --> Q --> AS AS --> A & B & C A & B & C --> D AS -- "events" --> E -- "boat events" --> You ``` * Every sandbox runs a small agent server. It is always on. * Each **conversation** has one harness process and one history. * The harnesses are ordinary processes. They run as `user` in `/home/user`. * They read ordinary config files and credentials. So you can look at all of it and replace all of it. ## Learn more > [card] [Harnesses and models](/integrated-agents/harnesses-and-models) > > The seven harnesses, their models, the live model catalog, and fast mode. > [card] [Keys and subscriptions](/integrated-agents/keys) > > Your keys or the keys of your users. Subscriptions, DeepSeek, Amazon Bedrock and Mistral. > [card] [AI credentials and proxy](/ai-credentials) > > Credential profiles, a second account when one runs out, and placeholder keys for shared sandboxes. > [card] [Conversations](/integrated-agents/conversations) > > Agent memory, parallel conversations, the prompt lifecycle, and a change of harness. > [card] [Steer a running turn](/integrated-agents/steering) > > Send a new message to an agent while it works, without a stop. > [card] [Computer use](/integrated-agents/computer-use) > > The agent sees and uses the sandbox desktop. Tools, config files and checks. > [card] [Customize the harness](/integrated-agents/customize) > > House rules, MCP servers, skills, tools, and your own harness. ## Reference * CLI flags: [`boat prompt`](/cli-reference#boat-prompt-id), [`boat conversations`](/cli-reference#boat-conversations-id), `boat steer`, `boat events --follow --convo`, `boat interrupt --convo`. All are in the [CLI reference](/cli-reference). * API: [Prompt](/api/reference/agent/prompt-sandbox-agent), [Conversations](/api/reference/agent/list-sandbox-conversations), [Events](/api/reference/agent/list-sandbox-events), [Steer](/api/reference/agent/steer-a-running-turn), [Interrupt](/api/reference/agent/interrupt-running-agent-work), with the same `new`, `conversationId`, and `conversation` fields. `provider` is optional on a prompt. Without it, boat uses the default harness from Agents & Proxying. * SDKs: [Python](/sdks/python), [TypeScript](/sdks/typescript) * Build a product on top: [SDKs](/sdks/overview), [Sandbox per user](/platform-guide) * Drive boat from Claude Code, Codex or Cursor on your computer: [Use boat from your coding agent](/ai-tools) # Computer use Source: https://docs.boat.dev/integrated-agents/computer-use Every harness on a sandbox can see and use the Linux desktop of the sandbox through the built-in computer tools. Every sandbox runs a Linux desktop. Every harness on it can see and use that desktop with ordinary tools. You do not install or register anything: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt "Open example.com in the browser and tell me the page title" boat prompt --provider codex "Log into the admin app in Chrome and screenshot the dashboard" ``` The tools come from the [Cua Driver](https://github.com/trycua/cua). It is preinstalled on every sandbox. It is registered as an MCP server named `computer` for all seven harnesses: ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark-default"}} %%{init: {"theme": "base", "fontFamily": "IBM Plex Mono", "themeVariables": {"fontFamily": "IBM Plex Mono", "fontSize": "14px", "primaryColor": "#F1F3F9", "primaryBorderColor": "#263FA9", "primaryTextColor": "#060606", "secondaryColor": "#E0E3F2", "tertiaryColor": "#FEFEFE", "lineColor": "#060606", "textColor": "#060606", "mainBkg": "#F1F3F9", "nodeBorder": "#263FA9", "clusterBkg": "#FEFEFE", "clusterBorder": "#C4C4C4", "edgeLabelBackground": "#FEFEFE", "actorBkg": "#F1F3F9", "actorBorder": "#263FA9", "actorTextColor": "#060606", "actorLineColor": "#9E9E9E", "signalColor": "#060606", "signalTextColor": "#060606", "labelBoxBkgColor": "#F1F3F9", "labelBoxBorderColor": "#263FA9", "noteBkgColor": "#E0E3F2", "noteBorderColor": "#E0E3F2", "noteTextColor": "#060606", "sectionBkgColor": "#F1F3F9", "altSectionBkgColor": "#FEFEFE", "taskBkgColor": "#263FA9", "taskBorderColor": "#263FA9", "taskTextColor": "#FEFEFE", "gridColor": "#E0E0E0"}, "flowchart": {"padding": 16, "nodeSpacing": 48, "rankSpacing": 48, "curve": "linear"}, "sequence": {"boxMargin": 16, "actorMargin": 48, "noteMargin": 16, "messageMargin": 32, "mirrorActors": false}, "state": {"padding": 16}, "gantt": {"barHeight": 24, "barGap": 8, "fontSize": 14, "sectionFontSize": 14}}}%% flowchart TD P["boat prompt"] --> H["Harness process<br/>claude / codex / pi / opencode / prime / kimi / vibe"] H -- "stdio MCP<br/>server name: computer" --> M["cua-driver mcp"] M -- "unix socket" --> D["cua-driver daemon<br/>systemd user service"] D --> X["The Sandbox desktop<br/>Xorg :0, 1920x1080, Chrome"] X -.-> S["boat desktop<br/>watch it live"] ``` The daemon runs as the desktop user. So the tools act on the same screen that `boat desktop` streams. Open a stream in one window and watch the agent work in it. ## What the agent gets | Group | Tools | | - | - | | Look | `get_window_state` (screenshot plus the accessibility tree in one call), `get_desktop_state`, `get_screen_size`, `list_windows`, `list_apps` | | Point and type | `click`, `double_click`, `right_click`, `drag`, `scroll`, `move_cursor`, `type_text`, `press_key`, `hotkey`, `set_value` | | Apps and windows | `launch_app`, `kill_app`, `bring_to_front`, `set_window_frame`, `invoke_menu` | | Browser | `browser_navigate`, `browser_click`, `browser_type`, `get_browser_state`, `browser_download` | | Clipboard | `clipboard_read`, `clipboard_write` | By default, the tools send clicks and keystrokes in the background. They go to the target window, but they do not raise it or move the real pointer. So the agent can use several windows without a fight for focus. Some widgets accept input only when they have focus. In that case the tool says so. The agent can then try again with `delivery_mode: "foreground"`. This activates the window, does the action, and gives focus back. In `boat events`, each harness shows the tool names with its own prefix: | Harness | Example tool name | | - | - | | Claude Code, Kimi Code | `mcp__computer__click` | | Codex | `mcp:computer/click` | ## Where it is registered The registration is an ordinary entry in the config file of each harness. boat writes it at sandbox start, and merges it with what you put there yourself: | Harness | File | Entry | | - | - | - | | Claude Code | `~/.claude.json` | `mcpServers.computer` | | Codex | `~/.codex/config.toml` | `[mcp_servers.computer]`, in a marked block | | pi | `~/.pi/agent/mcp.json` | `mcpServers.computer` | | OpenCode | `~/.config/opencode/opencode.json` | `mcp.computer` | | Prime Agent | `~/.prime/agent/settings.json` | `mcpServers.computer` | | Kimi Code | `~/.kimi-code/mcp.json` | `mcpServers.computer` | | Mistral Vibe | none: the agent server passes it when it opens each session | `computer` | * boat does not touch your own MCP servers in those files. * If you remove `computer` from a file, that harness loses the tools. * boat writes the entry again at the next sandbox start. To remove the tools for good, delete the daemon from the sandbox. OpenCode has one tool, `browser_prepare`, turned off in `opencode.json` `tools`. The reason: OpenCode sends MCP tool schemas to the model provider without change, and the Anthropic API rejects the schema of that tool. Without this, every OpenCode turn on an Anthropic model fails. Prime Agent calls the server from inside its Python tool, as `await mcp.call_tool("computer", "click", {...})`. ## Practical notes * **One screen, shared.** All conversations on a sandbox use the same desktop. Two agents that click at the same time interfere with each other. Give each parallel GUI task its own sandbox, or run the tasks one after the other. * **It survives stop, resume and fork.** The daemon is a systemd user service on the sandbox. It starts again automatically. The socket is on `/run`, so a resumed sandbox never gets an old socket. * **Logins persist.** A Chrome profile that the agent signed into is on the disk of the sandbox. It comes back on resume and goes with a fork. * **Screenshots are large.** A full-desktop screenshot is a real image in the context of the model. When a task runs in a loop, ask for one window (`get_window_state` with a window id). * **Watch it, and record it.** Run `boat desktop` to open the stream and watch the agent work. To record the run to an MP4, read [Drive and record the desktop](/desktop-streaming/drive-and-record). ## Check the daemon If a prompt says that it has no computer tools, check the daemon. Some paths in the sandbox keep an older internal name, `ascii`: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec <id> 'systemctl --user status cua-driver.service --no-pager' boat exec <id> '/opt/ascii/cua-driver/cua-driver status --socket /run/ascii-cua/driver.sock' boat exec <id> 'systemctl --user restart cua-driver.service' ``` # Conversations Source: https://docs.boat.dev/integrated-agents/conversations How the agent keeps its memory, runs many tasks at once, streams its events, survives a stop, and changes harness or model in a thread. A **conversation** is a thread of prompts and responses with its own memory. The native session of the harness holds that memory. * The first `boat prompt` on a sandbox starts a conversation. * Every later prompt continues it. You never have to handle the session id. But you can get it when you want it: * Every prompt prints its conversation id: `conversation: <id>` under `queued:`. * `--json` and the API response give it as `conversationId`. * Every event carries one. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt "Now add tests" # this shell's current conversation boat prompt --new "Look into the flaky CI job" # a brand-new conversation boat prompt --resume <id> "Continue where we left off" # a specific one boat conversations # every conversation on the sandbox, with ids ``` ## List conversations `boat conversations` (`GET /sandboxes/{id}/conversations`) lists the conversations, newest first. Each row shows: * the prompt count * whether a turn is running * the last harness and model * a preview of the last prompt * which one is the current conversation of the sandbox Use it to get back the id of a thread that you started yesterday, or from another shell. Then pass that id to `--resume`. ## The current conversation is per shell The current conversation is scoped to your shell, like the `current` sandbox id. * `--new` makes the new conversation the current one for this shell. * A bare `boat prompt` continues the current one. So two shells, two people, or two machines can prompt the same sandbox. Each one keeps its own thread. They do not interfere. ## Parallel conversations Conversations run at the same time. Each one has its own harness process and its own history: ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark-default"}} %%{init: {"theme": "base", "fontFamily": "IBM Plex Mono", "themeVariables": {"fontFamily": "IBM Plex Mono", "fontSize": "14px", "primaryColor": "#F1F3F9", "primaryBorderColor": "#263FA9", "primaryTextColor": "#060606", "secondaryColor": "#E0E3F2", "tertiaryColor": "#FEFEFE", "lineColor": "#060606", "textColor": "#060606", "mainBkg": "#F1F3F9", "nodeBorder": "#263FA9", "clusterBkg": "#FEFEFE", "clusterBorder": "#C4C4C4", "edgeLabelBackground": "#FEFEFE", "actorBkg": "#F1F3F9", "actorBorder": "#263FA9", "actorTextColor": "#060606", "actorLineColor": "#9E9E9E", "signalColor": "#060606", "signalTextColor": "#060606", "labelBoxBkgColor": "#F1F3F9", "labelBoxBorderColor": "#263FA9", "noteBkgColor": "#E0E3F2", "noteBorderColor": "#E0E3F2", "noteTextColor": "#060606", "sectionBkgColor": "#F1F3F9", "altSectionBkgColor": "#FEFEFE", "taskBkgColor": "#263FA9", "taskBorderColor": "#263FA9", "taskTextColor": "#FEFEFE", "gridColor": "#E0E0E0"}, "flowchart": {"padding": 16, "nodeSpacing": 48, "rankSpacing": 48, "curve": "linear"}, "sequence": {"boxMargin": 16, "actorMargin": 48, "noteMargin": 16, "messageMargin": 32, "mirrorActors": false}, "state": {"padding": 16}, "gantt": {"barHeight": 24, "barGap": 8, "fontSize": 14, "sectionFontSize": 14}}}%% gantt dateFormat s axisFormat %S s section A claude refactor billing :a1, 0, 40 add tests (waits for A) :a2, after a1, 25 section B pi fix flaky test :b1, 0, 30 section C codex write the changelog :c1, 5, 20 ``` The rules are the rules you would write yourself: * **One turn at a time per conversation.** A second prompt to the same conversation waits for the current turn, because it needs the context of that turn. Prompts to different conversations run at the same time. * **A cap per sandbox** on turns that run at the same time. The cap depends on the memory of the sandbox: | Size | Turns at the same time | | - | - | | `small` | Fewer than `default` | | `default` (8 GB) | About two dozen | | `large` | More than `default` | Above the cap, prompts wait in a queue and start when turns finish. boat drops nothing. To set an exact number, set the `ASCII_MAX_PARALLEL_CONVERSATIONS` environment variable on the sandbox (the variable keeps an older internal name). Or change the size of the sandbox ([Sandbox sizes](/machines)). * **List them** with `boat conversations`. Each row shows whether a turn runs in it. So you see the parallel work at a glance. * **Events stream all conversations by default**, tagged with `conversationId`. To watch one, run `boat events --follow --convo <id>`. Read [Stream events](#stream-events). * **Interrupt is scoped.** `boat interrupt --convo <id>` stops one turn. The others keep running. A bare `boat interrupt` stops everything on the sandbox. Files that the turn already changed stay on disk. * **Steer is scoped too.** `boat steer --convo <id> "..."` changes one running turn without a stop. Read [Steer a running turn](/integrated-agents/steering). ## Agent lifecycle A prompt moves through a small state machine. Watch it with `boat events` or `GET /prompts/{promptId}`: ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark-default"}} %%{init: {"theme": "base", "fontFamily": "IBM Plex Mono", "themeVariables": {"fontFamily": "IBM Plex Mono", "fontSize": "14px", "primaryColor": "#F1F3F9", "primaryBorderColor": "#263FA9", "primaryTextColor": "#060606", "secondaryColor": "#E0E3F2", "tertiaryColor": "#FEFEFE", "lineColor": "#060606", "textColor": "#060606", "mainBkg": "#F1F3F9", "nodeBorder": "#263FA9", "clusterBkg": "#FEFEFE", "clusterBorder": "#C4C4C4", "edgeLabelBackground": "#FEFEFE", "actorBkg": "#F1F3F9", "actorBorder": "#263FA9", "actorTextColor": "#060606", "actorLineColor": "#9E9E9E", "signalColor": "#060606", "signalTextColor": "#060606", "labelBoxBkgColor": "#F1F3F9", "labelBoxBorderColor": "#263FA9", "noteBkgColor": "#E0E3F2", "noteBorderColor": "#E0E3F2", "noteTextColor": "#060606", "sectionBkgColor": "#F1F3F9", "altSectionBkgColor": "#FEFEFE", "taskBkgColor": "#263FA9", "taskBorderColor": "#263FA9", "taskTextColor": "#FEFEFE", "gridColor": "#E0E0E0"}, "flowchart": {"padding": 16, "nodeSpacing": 48, "rankSpacing": 48, "curve": "linear"}, "sequence": {"boxMargin": 16, "actorMargin": 48, "noteMargin": 16, "messageMargin": 32, "mirrorActors": false}, "state": {"padding": 16}, "gantt": {"barHeight": 24, "barGap": 8, "fontSize": 14, "sectionFontSize": 14}}}%% stateDiagram-v2 [*] --> queued: boat prompt queued --> running: conversation free and boat under its cap running --> running: boat steer (message joins this turn) running --> finished running --> interrupted: boat interrupt running --> failed: harness or credential error (reason in the event) finished --> [*] interrupted --> [*] failed --> [*] ``` A steer never makes a state of its own. The turn that was running is the turn that finishes. The work your message causes is part of that turn. ## Stream events boat has no SSE or WebSocket stream for agent events, and no webhook when a prompt finishes. Poll instead, about once per second. | You want | CLI | API | | - | - | - | | Watch the work live | `boat events <id> --follow --convo <conversationId>` | Poll `GET /sandboxes/{id}/events?sort=asc&cursor=…` | | Know when a prompt is done | `boat prompt` waits by itself | Poll `GET /sandboxes/{id}/prompts/{promptId}` until `done` is `true` | `boat prompt` already prints the events of its own turn and exits when the turn ends. `boat events --follow` prints every new event until you press Ctrl+C. Without `--convo`, it prints all conversations. A prompt ends in one of three states: `finished`, `failed` or `interrupted`. `POST /prompt` returns the `promptId` to poll. To follow events from your own code, read in ascending order and pass a cursor: 1. The first call has no cursor. It returns up to 100 events, oldest first. 2. The cursor is the base64url form (no padding) of `<timestamp>:<id>` of the last event that you read. 3. Each later call passes that cursor and returns only newer events. An empty list means that nothing new happened yet. ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} cursor="" while true; do page=$(curl -sS "$BOAT_API_BASE/sandboxes/$BOAT_ID/events?sort=asc&conversation=$CONV_ID${cursor:+&cursor=$cursor}" \ -H "Authorization: Bearer $BOAT_API_KEY") echo "$page" | jq -c '.events[]' last=$(echo "$page" | jq -r '.events[-1] | select(.) | "\(.timestamp):\(.id)"') [ -n "$last" ] && cursor=$(printf '%s' "$last" | base64 | tr '+/' '-_' | tr -d '=\n') sleep 1 done ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk import stream_events, stream_prompt from boat_sdk.models.prompt_request import PromptRequest # The events of one new prompt, until it finishes: for event in stream_prompt(sandbox, sandbox_id, PromptRequest(prompt="Run the tests")): print(event.type, event.data) # Every new event on the sandbox, without an end: for event in stream_events(sandbox, sandbox_id, type="prompt,response"): print(event.type, event.data) ``` What the events hold: | Event | Field | | - | - | | Agent text | `data.content` on `response` events | | Partial text that the agent still writes | `data.is_streaming` is `true` | | Tool calls and their results | `data.tools` on `response` events | | Prompt state | `data.status` on `prompt` events | | A steer | its own `steer` event | The Python and TypeScript SDKs run this loop for you. Read [Python SDK](/sdks/python#stream-the-agents-work). ## Conversations survive a stop The sandbox lifecycle is under the prompt lifecycle. Conversations move with it: ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark-default"}} %%{init: {"theme": "base", "fontFamily": "IBM Plex Mono", "themeVariables": {"fontFamily": "IBM Plex Mono", "fontSize": "14px", "primaryColor": "#F1F3F9", "primaryBorderColor": "#263FA9", "primaryTextColor": "#060606", "secondaryColor": "#E0E3F2", "tertiaryColor": "#FEFEFE", "lineColor": "#060606", "textColor": "#060606", "mainBkg": "#F1F3F9", "nodeBorder": "#263FA9", "clusterBkg": "#FEFEFE", "clusterBorder": "#C4C4C4", "edgeLabelBackground": "#FEFEFE", "actorBkg": "#F1F3F9", "actorBorder": "#263FA9", "actorTextColor": "#060606", "actorLineColor": "#9E9E9E", "signalColor": "#060606", "signalTextColor": "#060606", "labelBoxBkgColor": "#F1F3F9", "labelBoxBorderColor": "#263FA9", "noteBkgColor": "#E0E3F2", "noteBorderColor": "#E0E3F2", "noteTextColor": "#060606", "sectionBkgColor": "#F1F3F9", "altSectionBkgColor": "#FEFEFE", "taskBkgColor": "#263FA9", "taskBorderColor": "#263FA9", "taskTextColor": "#FEFEFE", "gridColor": "#E0E0E0"}, "flowchart": {"padding": 16, "nodeSpacing": 48, "rankSpacing": 48, "curve": "linear"}, "sequence": {"boxMargin": 16, "actorMargin": 48, "noteMargin": 16, "messageMargin": 32, "mirrorActors": false}, "state": {"padding": 16}, "gantt": {"barHeight": 24, "barGap": 8, "fontSize": 14, "sectionFontSize": 14}}}%% flowchart TD N["boat new"] --> R["ready"] R --> P["prompt … prompt"] P --> S["boat stop<br/>disk snapshot incl. sessions"] S --> R2["boat resume / boat fork"] R2 --> P2["boat prompt --resume id<br/>same memory"] ``` * A stop takes a snapshot of the disk. The snapshot includes the history of every conversation and the native session files of the harness under `/home/user`. * A resumed or forked sandbox gets them back. So `--resume <id>` continues with full memory. * Conversations and every config file in [Customize the harness](/integrated-agents/customize) survive a stop. * Processes that the harness started by hand do not survive a stop, the same as on any reboot. A dev server or a tunnel it started are examples. ## Switch harness or model in a conversation Continue a conversation on a different harness. The new harness keeps the thread: ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark-default"}} %%{init: {"theme": "base", "fontFamily": "IBM Plex Mono", "themeVariables": {"fontFamily": "IBM Plex Mono", "fontSize": "14px", "primaryColor": "#F1F3F9", "primaryBorderColor": "#263FA9", "primaryTextColor": "#060606", "secondaryColor": "#E0E3F2", "tertiaryColor": "#FEFEFE", "lineColor": "#060606", "textColor": "#060606", "mainBkg": "#F1F3F9", "nodeBorder": "#263FA9", "clusterBkg": "#FEFEFE", "clusterBorder": "#C4C4C4", "edgeLabelBackground": "#FEFEFE", "actorBkg": "#F1F3F9", "actorBorder": "#263FA9", "actorTextColor": "#060606", "actorLineColor": "#9E9E9E", "signalColor": "#060606", "signalTextColor": "#060606", "labelBoxBkgColor": "#F1F3F9", "labelBoxBorderColor": "#263FA9", "noteBkgColor": "#E0E3F2", "noteBorderColor": "#E0E3F2", "noteTextColor": "#060606", "sectionBkgColor": "#F1F3F9", "altSectionBkgColor": "#FEFEFE", "taskBkgColor": "#263FA9", "taskBorderColor": "#263FA9", "taskTextColor": "#FEFEFE", "gridColor": "#E0E0E0"}, "flowchart": {"padding": 16, "nodeSpacing": 48, "rankSpacing": 48, "curve": "linear"}, "sequence": {"boxMargin": 16, "actorMargin": 48, "noteMargin": 16, "messageMargin": 32, "mirrorActors": false}, "state": {"padding": 16}, "gantt": {"barHeight": 24, "barGap": 8, "fontSize": 14, "sectionFontSize": 14}}}%% sequenceDiagram participant You participant Conv as Conversation A participant CC as Claude Code participant Pi as pi You->>Conv: prompt 1, prompt 2 (--provider claude) Conv->>CC: turns You->>Conv: --resume A --provider pi "take it from here" Conv->>Pi: full earlier transcript + new prompt Pi-->>You: continues with the whole context ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt --resume <A> --provider pi --model claude-sonnet-5 "Take it from here" ``` boat freezes the transcript of the earlier harness into the conversation. Then it gives that transcript to the new harness. So the change is one flag, not a script that rebuilds the context. To give your users a selector for harness and model, map it to `provider` and `model` on `POST /prompt`. # Customize the harness: rules, MCP, skills Source: https://docs.boat.dev/integrated-agents/customize Add house rules, MCP servers, skills and tools to the harnesses on a sandbox, reach your own app, or bring your own harness. > [!NOTE] > > This page covers the agents that run inside a sandbox. To let Claude Code, Codex or Cursor on your own computer drive boat, read [Use boat from your coding agent](/ai-tools). Every harness reads its own config files from the sandbox home. boat adds only two things: * A short system prompt. It tells the harness that it runs headless in a sandbox, and that the `boat` CLI exists. * The `boat` skill. You add everything else. Use any of these: * `boat ssh`, `boat exec` or `boat scp` * a file that the agent writes * an [environment setup script](/environments) * a [saved snapshot](/snapshots), so every new sandbox starts with it We tested each row on this page end to end through `boat prompt`, on the current harness versions. Each row names the file that changed the answer of the harness. ## Instructions and hidden rules Add a rules file. Every prompt on that sandbox then obeys it, even when the prompt does not mention it: | Harness | Files read (all applied together) | Not read | | - | - | - | | Claude Code | `~/CLAUDE.md`, `~/.claude/CLAUDE.md` | `AGENTS.md` | | Codex | `~/AGENTS.md`, `~/.codex/AGENTS.md` | `config.toml` `developer_instructions` (boat sets the base instructions) | | pi | `~/AGENTS.md`, `~/.pi/agent/AGENTS.md`, `~/.pi/agent/APPEND_SYSTEM.md` | `CLAUDE.md` when an `AGENTS.md` exists | | OpenCode | `~/AGENTS.md`, `~/.config/opencode/AGENTS.md`, files listed in `opencode.json` `instructions` | | | Prime Agent | `~/AGENTS.md`, `~/.prime/agent/AGENTS.md`, `~/.prime/agent/APPEND_SYSTEM.md` | | | Kimi Code | `~/AGENTS.md`, `~/.kimi-code/AGENTS.md`, `~/.agents/AGENTS.md` | `CLAUDE.md` | | Mistral Vibe | `AGENTS.md` at the root of a git repository it works in, after you trust that folder (`~/.vibe/trusted_folders.toml`) | `~/AGENTS.md`, `CLAUDE.md`. Use a skill for house rules | * One `~/AGENTS.md` plus one `~/CLAUDE.md` covers every harness except Mistral Vibe. * `APPEND_SYSTEM.md` (pi, Prime) goes at the end of the system prompt itself, not into the project context. * When an environment clones a single repository, Claude Code starts inside that repository. So a `CLAUDE.md` there also applies. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec <id> "printf '# House rules\nAlways run the test suite before saying you are done.\n' > ~/AGENTS.md; cp ~/AGENTS.md ~/CLAUDE.md" ``` ## MCP servers | Harness | How to register | Config written | | - | - | - | | Claude Code | `claude mcp add --scope user <name> -- <command>` | `~/.claude.json` (project scope: `~/.mcp.json`) | | Codex | `codex mcp add <name> -- <command>` | `~/.codex/config.toml` `[mcp_servers.<name>]` | | pi | `pi install npm:pi-mcp-extension`, then `~/.pi/agent/mcp.json` | `{"mcpServers": {"<name>": {"transport": "stdio", "command": …, "lifecycle": "eager"}}}` | | OpenCode | `~/.config/opencode/opencode.json` | `"mcp": {"<name>": {"type": "local", "command": [...]}}` | | Prime Agent | `prime-agent mcp add <name> -- <command>` | `~/.prime/agent/settings.json` `mcpServers` | | Kimi Code | `~/.kimi-code/mcp.json` | `{"mcpServers": {"<name>": {"command": …, "args": [...]}}}` (`{"url": …}` for HTTP) | | Mistral Vibe | `~/.vibe/config.toml` | `[[mcp_servers]]` with `name`, `transport = "stdio"`, `command`, `args` (`url` for HTTP) | * Remote (HTTP) servers work the same way, with a URL instead of a command. * On a sandbox, the MCP resource browsing tools of Claude Code are turned off. MCP tools stay on. Every sandbox already has one server registered this way: `computer`, in these same files. Your server next to it does not change it, and it never overwrites yours. Read [Computer use](/integrated-agents/computer-use). ## Reach your own app from the sandbox A sandbox has no route back to your laptop. So the agents in it cannot see an MCP server, a local model, or a webhook receiver on your `localhost`. `boat forward --reverse` opens that route. A port on your machine then answers at `127.0.0.1:<port>` inside the sandbox. It uses the same SSH session as `boat ssh`. Nothing is public on either end. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} # leave this running; your MCP server on localhost:7777 is now in the sandbox boat forward bx_f7k2q9hd --reverse --local 7777 ``` Register it one time inside the sandbox. Then every harness can call it: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_f7k2q9hd "claude mcp add --scope user mine --transport http http://127.0.0.1:7777/mcp" ``` * The registration is in the sandbox home. It survives `boat stop`, `boat resume`, and `boat fork`. * The tunnel does not survive. Start it again the next time the agent must reach you. * A local model works the same way. `boat forward <id> --reverse --local 11434` puts Ollama on `http://127.0.0.1:11434` inside the sandbox. Any harness that uses that base URL can call it. For the flags and the redial behaviour, read [`boat forward --reverse`](/cli-reference#reverse-reach-your-machine-from-the-sandbox). Products that do not ship the CLI can open the same tunnel. The CLI only wraps stock OpenSSH: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} # 1. authorize your public key on the sandbox; the reply carries machineIp curl -s -X POST https://boat.dev/api/v1/sandboxes/$BOAT_ID/sshkey \ -H "Authorization: Bearer $BOAT_API_KEY" -H 'Content-Type: application/json' \ -d "{\"key\": \"$(cat ~/.ssh/id_ed25519.pub)\"}" # 2. open the reverse tunnel and leave it running ssh -o ExitOnForwardFailure=yes -i ~/.ssh/id_ed25519 -N -R 7777:127.0.0.1:7777 user@<machineIp> ``` ## Skills A skill is a folder with a `SKILL.md` file. The file has frontmatter with `name` and `description`, then the instructions. Every harness on a sandbox already has a skills directory with the `boat` skill in it. Add yours next to it: | Harness | Skills directory | | - | - | | Claude Code | `~/.claude/skills/<name>/SKILL.md` | | Codex | `~/.codex/skills/<name>/SKILL.md` | | pi | `~/.pi/agent/skills/<name>/SKILL.md` | | OpenCode | `~/.config/opencode/skills/<name>/SKILL.md` | | Prime Agent | `~/.prime/agent/skills/<name>/SKILL.md` | | Kimi Code | `~/.kimi-code/skills/<name>/SKILL.md` (also `~/.agents/skills/<name>/SKILL.md`) | | Mistral Vibe | `~/.vibe/skills/<name>/SKILL.md` (also `~/.agents/skills/<name>/SKILL.md`) | ## Command-line tools Anything on `PATH` is a tool. To add one, do one of these: * Put a script in `~/.local/bin` or `/usr/local/bin`. * Install it with `npm i -g`, `pip install` or `apt install`. Then ask for it by name. All seven harnesses run it through their shell tool. ## Custom in-process tools and extensions Use these when a tool must show as a native function call, not a shell command: | Harness | Mechanism | Path | | - | - | - | | pi | extension calling `pi.registerTool({...})` | `~/.pi/agent/extensions/<name>.ts` | | Prime Agent | same extension API | `~/.prime/agent/extensions/<name>.ts` | | OpenCode | `tool({description, args, execute})` from `@opencode-ai/plugin` (dependencies install themselves on first run) | `~/.config/opencode/tools/<name>.ts` | | Claude Code | hooks in `~/.claude/settings.json`, plugins | see [Claude Code docs](https://code.claude.com/docs/en/hooks) | | Codex | hooks in `~/.codex/hooks.json` | see [Codex docs](https://learn.chatgpt.com/docs/hooks) | | Kimi Code | `[[hooks]]` in `~/.kimi-code/config.toml`, plugins | see [Kimi Code docs](https://moonshotai.github.io/kimi-code/en/customization/hooks.html) | | Mistral Vibe | hooks in `~/.vibe/hooks.toml` | see [Mistral Vibe on GitHub](https://github.com/mistralai/mistral-vibe#hooks) | ## What is shared, what persists * **Config is per sandbox, not per conversation.** Every parallel conversation on a sandbox reads the same home directory, whatever its harness. There is one `AGENTS.md`, one skills folder, one MCP list. For rules per user, use a sandbox per user, or put the rules in the prompt. * **boat captures everything in `/home/user` on stop.** Rules, MCP registrations, skills, extensions, tools you installed under home, and the harness sessions all come back on `boat resume` and `boat fork`. Tools installed outside home (`apt`, `/usr/local`) are also part of the system snapshot. * **Set it up one time.** An [environment](/environments) setup script or a [saved snapshot](/snapshots) gives every new sandbox the same rules, tools and servers from the first prompt. ## Bring your own harness The built-in harnesses are ordinary binaries on `PATH`. They have the same credentials that the agent server uses. You have three ways to go further than `boat prompt`: * **Run a built-in harness yourself.** Use `boat ssh` or `boat exec`. Run `claude`, `codex`, `pi`, `opencode`, `prime-agent`, `kimi`, or `vibe` (Mistral Vibe) directly, in any mode they support. The agent server does not lock the files or the processes. * **Install a harness that boat does not ship.** Run `boat exec "npm i -g <harness>"`, or add it to an environment or a snapshot. Run it over `boat exec` or SSH. It works next to the built-in harnesses and reads the same per-sandbox `-e` keys. * **Run your own agent loop.** Put a small HTTP daemon in the sandbox and talk to it directly. [Agents in your product](/platform-guide/agents#bring-your-own-harness-the-daemon-pattern) shows how. `boat host` gives it a URL. [Webhooks](/webhooks) tell your control plane when the sandbox is up. Whatever you run, these keep working: `boat events`, attachments under `~/attachments`, [desktop streaming](/desktop-streaming), snapshots, and forks. # Claude Code, Codex and other harnesses Source: https://docs.boat.dev/integrated-agents/harnesses-and-models The seven coding-agent harnesses on every sandbox (Claude Code, Codex, pi, OpenCode, Prime Agent, Kimi Code, Mistral Vibe), their models, and fast mode. Pick the harness for each prompt with `--provider` (API: `provider`). It is optional. If you omit it, boat uses the default harness that you chose on [Agents & Proxying](https://boat.dev/dashboard?tab=agents). ## Harnesses | `--provider` | Harness | Models | | - | - | - | | `claude` | Claude Code | Anthropic models, or DeepSeek models on a DeepSeek key | | `codex` | OpenAI Codex | OpenAI models, or DeepSeek models on a DeepSeek key | | `pi` | pi | Anthropic, OpenAI, Mistral, xAI Grok, OpenCode Go and pay-as-you-go, and OpenRouter or llmgateway-routed models (DeepSeek and Mistral included) | | `opencode` | OpenCode | same multi-vendor catalog | | `prime` | Prime Agent | same multi-vendor catalog | | `kimi` | Kimi Code CLI (Moonshot AI) | Kimi models: K3, Kimi for Coding, K2.7 Code, K2.6 | | `mistral` | Mistral Vibe (Mistral AI) | Mistral models: Large 4 (default), Medium 3.5, Small 4 | The API also accepts `claude-code` for `claude` and `prime-agent` for `prime`. ### Claude Code Run `boat prompt --provider claude "…"`. It runs on a Claude Pro or Max subscription, an Anthropic API key, DeepSeek or Amazon Bedrock. ### Codex Run `boat prompt --provider codex "…"`. It runs on a ChatGPT subscription, an OpenAI API key, DeepSeek or Amazon Bedrock. For the keys each harness needs, read [Keys and subscriptions](/integrated-agents/keys). ## The model catalog Each model accepts a different set of reasoning levels. The catalog changes often, so boat serves it live. This page does not list it. * `boat prompt --help` prints the catalog. * `GET /provider-models` returns it as JSON. You can change the model or the thinking level on any prompt. The prompt stays in the same conversation. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt --provider pi --model claude-sonnet-5 --reasoning-effort high "Refactor the billing module" boat prompt --model gpt-5.6-terra "Same task, second opinion" # same conversation, other model ``` ## Fast mode Fast mode runs the same model with faster output. The provider bills it at its higher fast rate. | Harness | Fast mode is | Speed | Billing | | - | - | - | - | | Codex | The "Fast" service tier | About 1.5x to 2x faster | Uses ChatGPT plan limits faster | | Claude Code | Opus fast mode | Up to 2.5x faster | Billed from Claude usage credits | * Only models with `"fastMode": true` in `GET /provider-models` accept it. Examples are GPT-6.1 Sol, GPT-6 Sol and Opus. * A prompt without `fast` uses the choice saved on Agents & Proxying. * `fast: false` forces standard speed. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt --provider codex --model gpt-6.1-sol --fast "Fix the failing tests" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/$BOAT_ID/prompt" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"provider":"codex","model":"gpt-6.1-sol","fast":true,"prompt":"Fix the failing tests"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.prompt({ sandboxId, provider: "codex", model: "gpt-6.1-sol", fast: true, prompt: "Fix the failing tests" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.prompt(sandbox_id, PromptRequest(provider="codex", model="gpt-6.1-sol", fast=True, prompt="Fix the failing tests")) ``` A model without fast mode refuses `fast: true` with `400 fast_mode_not_supported`. The error message lists the models that have fast mode. # Keys and subscriptions Source: https://docs.boat.dev/integrated-agents/keys Connect a Claude or ChatGPT subscription or an API key before the first prompt, or run on the keys of your users. DeepSeek, Amazon Bedrock and Mistral setup. Connect a key or a subscription before the first prompt. Without one, `boat prompt` fails with `409 provider_not_configured`. The harness reads its credentials from the environment and the auth files of the sandbox. boat fills them from one of these sources: | Source | How | Who sees the keys | | - | - | - | | **Your account** | Connect keys or subscriptions on [Agents & Proxying](https://boat.dev/dashboard?tab=agents) one time. Every sandbox gets them | Anyone with a shell in the sandbox | | **Your account, through the proxy** | Turn on the [AI credentials proxy](/ai-credentials#the-ai-credentials-proxy). The sandbox gets placeholder keys | Nobody. The real keys stay with boat | | **Per sandbox, from your user** | `boat new --no-env -e ANTHROPIC_API_KEY=… -e OPENAI_API_KEY=…` (API: `noEnv: true` plus `env`) | Only that sandbox. Your account keys never go on it | To share keys with a team, switch to a second account when one runs out of credits, or keep keys out of shared sandboxes, read [AI credentials](/ai-credentials). > [!WARNING] > > Your account keys go on a sandbox only if its [environment](/environments) lets them in. If you chose the platform option at onboarding (the preselected option), your first environment is **Safe for third parties**. This setting withholds all your secrets: variables, secret files, GitHub access and AI credentials. > > A prompt then fails with `409 provider_not_configured` or a "no credential" error, even when Agents & Proxying shows you as connected. Pick one fix: > > * **Only you use these sandboxes.** Open [Dashboard > Environment](https://boat.dev/dashboard?tab=environment). Turn off **Safe for third parties**. Keep **Agents credentials** on. > * **Other people use these sandboxes.** Keep **Safe for third parties** on. Turn on AI credentials proxying for that environment. The sandbox then gets placeholder keys only. Read [Safe for third parties, with AI credentials](/ai-credentials#safe-for-third-parties-with-ai-credentials). > > New sandboxes get the change at once. For running sandboxes, press the upgrade button on that page. Agents & Proxying warns you when an environment blocks your keys. ## Connect a subscription Agents & Proxying connects subscriptions the same way for all five vendors: | Subscription | Plans | | - | - | | **Claude** | Pro or Max | | **ChatGPT** | Plus, Pro or Team | | **Kimi** | Kimi Code | | **Mistral** | Le Chat Pro or Team, for Mistral Vibe | | **Grok** | SuperGrok or X Premium+, for pi, OpenCode and Prime Agent | 1. Click **Sign in**. 2. Approve on the page of the vendor. ChatGPT, Kimi and Grok show a short code to confirm. Mistral needs no code. 3. The dashboard shows the subscription as connected. The Mistral sign-in gives boat a Mistral API key. This key bills against the Vibe quota of your plan, not against paid API credits. It does not expire. boat keeps the sign-in alive for you. The server refreshes the token before every prompt and every sandbox start. So a sandbox never starts on an expired token. To remove a subscription from every sandbox, click **Sign out** on the same row. ## Where to get each key or plan Agents & Proxying shows **Get a key** or **Get a plan** beside each row that is not connected. `boat ai profile set-key` and `boat ai add-account` print the same link before they ask for the key. | Credential | Get it at | Then | | - | - | - | | Claude subscription | [claude.ai/upgrade](https://claude.ai/upgrade) | Buy Pro or Max, then click **Sign in** | | ChatGPT subscription | [chatgpt.com/#pricing](https://chatgpt.com/#pricing) | Buy Plus or Pro, then click **Sign in** | | Kimi Code subscription | [kimi.ai/membership/pricing](https://www.kimi.ai/membership/pricing) | Buy a Kimi Code plan, then click **Sign in**. For a kimi.com account (mainland China), click **Sign in (China)** | | Mistral Vibe subscription | [mistral.ai/pricing](https://mistral.ai/pricing) | Buy Le Chat Pro, then click **Sign in** | | Grok subscription | [grok.com/supergrok](https://grok.com/supergrok) | Buy SuperGrok (or X Premium+), then click **Sign in** | | Anthropic API key | [platform.claude.com/settings/keys](https://platform.claude.com/settings/keys) | Click **Create Key** | | OpenAI API key | [platform.openai.com/api-keys](https://platform.openai.com/api-keys) | Click **Create new secret key** | | OpenRouter API key | [openrouter.ai/settings/keys](https://openrouter.ai/settings/keys) | Click **Create API Key** | | LLM Gateway API key | [llmgateway.io/dashboard](https://llmgateway.io/dashboard) | Open your project, then **API Keys**, then **Create API Key** | | DeepSeek API key | [platform.deepseek.com/api_keys](https://platform.deepseek.com/api_keys) | Add balance, then click **Create new API key** | | Kimi (Moonshot) API key | [platform.kimi.ai/console/api-keys](https://platform.kimi.ai/console/api-keys) | Click **Create API Key** | | Mistral API key | [console.mistral.ai/api-keys](https://console.mistral.ai/api-keys) | Click **Create new key** | | xAI API key | [console.x.ai](https://console.x.ai/team/default/api-keys) | Click **Create API Key** | | OpenCode key | [opencode.ai/console](https://opencode.ai/console) | **Billing**: subscribe to Go. **Service accounts**: add one, then add an **Inference only** key | | Amazon Bedrock | [Bedrock console, API keys](https://console.aws.amazon.com/bedrock/home#/api-keys) | Enable the models, then create a Bedrock API key. See [Amazon Bedrock](#amazon-bedrock) | ## Use the keys of your users `--no-env` keeps every one of your credentials out of the sandbox. The `-e` values are the only credentials the sandbox has. Use this for a product where each end user brings their own key or subscription and picks a harness in a selector: ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark-default"}} %%{init: {"theme": "base", "fontFamily": "IBM Plex Mono", "themeVariables": {"fontFamily": "IBM Plex Mono", "fontSize": "14px", "primaryColor": "#F1F3F9", "primaryBorderColor": "#263FA9", "primaryTextColor": "#060606", "secondaryColor": "#E0E3F2", "tertiaryColor": "#FEFEFE", "lineColor": "#060606", "textColor": "#060606", "mainBkg": "#F1F3F9", "nodeBorder": "#263FA9", "clusterBkg": "#FEFEFE", "clusterBorder": "#C4C4C4", "edgeLabelBackground": "#FEFEFE", "actorBkg": "#F1F3F9", "actorBorder": "#263FA9", "actorTextColor": "#060606", "actorLineColor": "#9E9E9E", "signalColor": "#060606", "signalTextColor": "#060606", "labelBoxBkgColor": "#F1F3F9", "labelBoxBorderColor": "#263FA9", "noteBkgColor": "#E0E3F2", "noteBorderColor": "#E0E3F2", "noteTextColor": "#060606", "sectionBkgColor": "#F1F3F9", "altSectionBkgColor": "#FEFEFE", "taskBkgColor": "#263FA9", "taskBorderColor": "#263FA9", "taskTextColor": "#FEFEFE", "gridColor": "#E0E0E0"}, "flowchart": {"padding": 16, "nodeSpacing": 48, "rankSpacing": 48, "curve": "linear"}, "sequence": {"boxMargin": 16, "actorMargin": 48, "noteMargin": 16, "messageMargin": 32, "mirrorActors": false}, "state": {"padding": 16}, "gantt": {"barHeight": 24, "barGap": 8, "fontSize": 14, "sectionFontSize": 14}}}%% sequenceDiagram participant U as Your user participant App as Your app participant API as boat API U->>App: pastes key, picks Claude Code App->>API: POST /sandboxes {noEnv: true, env: {ANTHROPIC_API_KEY}} API-->>App: sandbox id App->>API: POST /prompt {provider: "claude", prompt} API-->>App: events (streamed) App-->>U: live output ``` A subscription works the same way. For a Claude Pro or Max subscription, make a token with `claude setup-token` on your computer. Then pass it: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --no-env -e CLAUDE_CODE_OAUTH_TOKEN=… boat prompt <id> --provider claude "Summarize this repo" ``` Check what the sandbox got: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec <id> 'echo ${ANTHROPIC_API_KEY:+set} ${CLAUDE_CODE_OAUTH_TOKEN:+set}' ``` Keys are per sandbox, not per conversation. A sandbox that several users share runs on one set of credentials. * When the keys of each paying user must stay apart, give each user their own sandbox. * When the keys are yours, share one sandbox across conversations. ## Environment variables The harnesses read these variables. Any subset works. If the vendor key of a harness is missing, that harness refuses the prompt with a credential error. The other harnesses keep working. | Variable | Used by | | - | - | | `ANTHROPIC_API_KEY` | Claude Code, pi, OpenCode, Prime Agent | | `OPENAI_API_KEY` | Codex, pi, OpenCode, Prime Agent | | `OPENROUTER_API_KEY` | pi, OpenCode, Prime Agent | | `LLMGATEWAY_API_KEY` | pi, OpenCode, Prime Agent | | `CLAUDE_CODE_OAUTH_TOKEN` | Claude Code. A Claude Pro or Max subscription token from `claude setup-token` | | `MOONSHOT_API_KEY` | Kimi Code. A Kimi open platform key (api.moonshot.ai) | | `MISTRAL_API_KEY` | Mistral Vibe, pi, OpenCode, Prime Agent. A [Mistral API key](https://console.mistral.ai/api-keys), or the key the Mistral Vibe sign-in made | | `XAI_API_KEY` | pi, OpenCode, Prime Agent. An [xAI API key](https://console.x.ai) for the Grok models | | `OPENCODE_API_KEY` | pi, OpenCode, Prime Agent. An [OpenCode key](https://opencode.ai/console): the Go plan and pay-as-you-go credits | | `KIMI_CODE_ACCESS_TOKEN`, `KIMI_CODE_REFRESH_TOKEN` | Kimi Code. A Kimi Code subscription token pair: the `access_token` and `refresh_token` that `kimi login` stores in `~/.kimi-code/credentials/kimi-code.json` | | `KIMI_CODE_REGION` | Kimi Code. Set `global` for a kimi.ai login. Unset means a kimi.com login | | `DEEPSEEK_API_KEY` | Claude Code and Codex. A [DeepSeek platform key](https://platform.deepseek.com/api_keys). Read [DeepSeek](#deepseek) | | `AWS_BEARER_TOKEN_BEDROCK` + `AWS_REGION` | Claude Code (with `CLAUDE_CODE_USE_BEDROCK=1`) and Codex (with `OPENAI_BASE_URL`). Read [Amazon Bedrock](#amazon-bedrock) | Kimi Code does not read a credential from the environment itself. Before the first prompt, the sandbox writes these values into `~/.kimi-code/config.toml` and the token file. After that, the CLI refreshes the subscription token by itself. ## DeepSeek Claude Code and Codex can run on the models of DeepSeek instead of Anthropic or OpenAI. One credential covers both: a [DeepSeek platform key](https://platform.deepseek.com/api_keys). It is a single string that starts with `sk-`. DeepSeek publishes an Anthropic-shaped endpoint and an OpenAI-shaped endpoint for the same key. So boat does not change either harness, and neither harness needs a gateway in front of it. | Source | How | | - | - | | **Your account** | Agents & Proxying, the DeepSeek API key row. Paste the key one time. Then point Claude Code or Codex (or both) at it and pick a DeepSeek model | | **Per sandbox, from your user** | `boat new --no-env -e DEEPSEEK_API_KEY=sk-…`. This one variable sets up both harnesses. If you also pass the key of another vendor, that harness keeps its own credential | What the sandbox gives each harness, and the model ids to pass: | Harness | Environment | Model ids | | - | - | - | | Claude Code | `ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic`, `ANTHROPIC_AUTH_TOKEN` = the key, `ANTHROPIC_API_KEY` empty. If it is not empty, Claude Code sends an `x-api-key` header that the endpoint rejects | `deepseek-flash`, `deepseek-v4-pro`. DeepSeek also maps the Claude model names onto these. So the small, fast and subagent models of the harness work by themselves | | Codex | `OPENAI_BASE_URL=https://api.deepseek.com/v1` and the key. Codex ignores `OPENAI_BASE_URL` itself, so the agent server writes a `model_providers.deepseek` block that points at `https://api.deepseek.com/` with `wire_api = "responses"`. Web search is off | `deepseek-flash`, `deepseek-v4-pro`. Reasoning levels are `low` and `high`, the two levels that both Codex and DeepSeek accept | ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --no-env -e DEEPSEEK_API_KEY=sk-… boat prompt --provider claude --model deepseek-flash "Summarize this repo" boat prompt --provider codex --model deepseek-v4-pro --reasoning-effort high "Now review the diff" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"noEnv":true,"env":{"DEEPSEEK_API_KEY":"sk-…"}}' curl -sS -X POST "$BOAT_API_BASE/sandboxes/$BOAT_ID/prompt" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"provider":"claude","model":"deepseek-flash","prompt":"Summarize this repo"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const created = await sandbox.create({ noEnv: true, env: { DEEPSEEK_API_KEY: "sk-…" } }); await sandbox.prompt({ sandboxId: created.sandbox.id, provider: "claude", model: "deepseek-flash", prompt: "Summarize this repo", }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} created = sandbox.create(create_sandbox_request=CreateSandboxRequest(no_env=True, env={"DEEPSEEK_API_KEY": "sk-…"})) sandbox.prompt(created.sandbox.id, PromptRequest(provider="claude", model="deepseek-flash", prompt="Summarize this repo")) ``` pi, OpenCode and Prime Agent get DeepSeek in a different way. They use your OpenRouter key, with no DeepSeek account. They need only `OPENROUTER_API_KEY`. The models are: * `openrouter:deepseek/deepseek-v4.1-flash` * `openrouter:deepseek/deepseek-v4-flash-0731` * `openrouter:deepseek/deepseek-v4-pro-0813` ## Amazon Bedrock Claude Code and Codex can run on models that your AWS account serves, instead of the Anthropic or OpenAI API. The simplest credential is a [Bedrock API key](https://docs.aws.amazon.com/bedrock/latest/userguide/api-keys.html): * It is one string that starts with `ABSK`. * You make it in the Bedrock console, under API keys. * It is valid in every region. IAM access keys also work: access key id, secret, and an optional session token. | Source | How | | - | - | | **Your account** | Agents & Proxying, the Bedrock row under Claude Code or Codex. Set the region, then the API key or the IAM keys. Point the harness at it and pick a Bedrock model | | **Per sandbox, from your user** | `boat new --no-env -e AWS_BEARER_TOKEN_BEDROCK=ABSK… -e AWS_REGION=us-east-1 -e CLAUDE_CODE_USE_BEDROCK=1` | ### Claude Code on Bedrock The sandbox gives Claude Code `CLAUDE_CODE_USE_BEDROCK=1`, `AWS_REGION`, and the key (or `AWS_ACCESS_KEY_ID` / `AWS_SECRET_ACCESS_KEY`). The model ids are Bedrock cross-region inference profiles on the Anthropic line: * `us.anthropic.claude-sonnet-4-6` * `us.anthropic.claude-opus-4-6-v1` * `us.anthropic.claude-sonnet-4-5-20250929-v1:0` * `us.anthropic.claude-opus-4-5-20251101-v1:0` * `us.anthropic.claude-haiku-4-5-20251001-v1:0` * `us.anthropic.claude-sonnet-5` * `us.anthropic.claude-opus-5` * `us.anthropic.claude-fable-5-2` * `us.anthropic.claude-fable-5-1` * `us.anthropic.claude-fable-5` * `us.anthropic.claude-opus-4-8` * `us.anthropic.claude-opus-4-7` When you use the Bedrock credential, these are the only Claude Code models that boat offers. The default becomes Sonnet 4.6. The reason: inside Claude Code, the plain `sonnet` and `opus` aliases point to model ids that many AWS accounts have not enabled. ### Codex on Bedrock The sandbox gives Codex `OPENAI_BASE_URL=https://bedrock-mantle.<region>.api.aws/v1` and the key. Codex ignores `OPENAI_BASE_URL` itself. So the agent server selects the built-in `amazon-bedrock` provider of Codex for that region. It uses the OpenAI-compatible [Mantle endpoint](https://docs.aws.amazon.com/bedrock/latest/userguide/bedrock-mantle.html) of Bedrock. Web search is off. The model ids are the OpenAI line on Mantle: * `openai.gpt-5.6-terra` * `openai.gpt-5.6-sol` * `openai.gpt-5.6-luna` * `openai.gpt-5.5` * `openai.gpt-5.5-2026-04-23` * `openai.gpt-5.4` * `openai.gpt-5.4-2026-03-05` Codex on Bedrock needs the API key. IAM keys alone do not authenticate the OpenAI-compatible endpoint. The list does not include the open-weight `gpt-oss` models. It also does not include the third-party models on Mantle (Kimi, MiniMax, Qwen, DeepSeek, GLM, Mistral). These models answer the `/v1` routes of Mantle, but not the `/openai/v1/responses` route that Codex calls. ### Example ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --no-env -e AWS_BEARER_TOKEN_BEDROCK=ABSK… -e AWS_REGION=us-east-1 -e CLAUDE_CODE_USE_BEDROCK=1 boat prompt --provider claude --model us.anthropic.claude-sonnet-4-6 "Summarize this repo" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"noEnv":true,"env":{"AWS_BEARER_TOKEN_BEDROCK":"ABSK…","AWS_REGION":"us-east-1","CLAUDE_CODE_USE_BEDROCK":"1"}}' curl -sS -X POST "$BOAT_API_BASE/sandboxes/$BOAT_ID/prompt" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"provider":"claude","model":"us.anthropic.claude-sonnet-4-6","prompt":"Summarize this repo"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const created = await sandbox.create({ noEnv: true, env: { AWS_BEARER_TOKEN_BEDROCK: "ABSK…", AWS_REGION: "us-east-1", CLAUDE_CODE_USE_BEDROCK: "1" }, }); await sandbox.prompt({ sandboxId: created.sandbox.id, provider: "claude", model: "us.anthropic.claude-sonnet-4-6", prompt: "Summarize this repo", }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} created = sandbox.create(create_sandbox_request=CreateSandboxRequest(no_env=True, env={"AWS_BEARER_TOKEN_BEDROCK": "ABSK…", "AWS_REGION": "us-east-1", "CLAUDE_CODE_USE_BEDROCK": "1"})) sandbox.prompt(created.sandbox.id, PromptRequest(provider="claude", model="us.anthropic.claude-sonnet-4-6", prompt="Summarize this repo")) ``` ### Model access is granted per AWS account and region The lists above show what Amazon Bedrock offers for each harness. They do not show what your account can call today. Bedrock grants model access per AWS account and per region. boat lists a model as soon as Bedrock serves it, including frontier models that AWS has not granted to you yet. Your access to a model is between your account and AWS. To request access: 1. Open the [Amazon Bedrock console](https://console.aws.amazon.com/bedrock/) in the region that your credential uses. 2. Go to **Model catalog**. 3. Find the model. 4. Choose **Request model access**. Some models ask for a short use case form. AWS approves these, so the approval is not instant. Access in one region does not carry to another region. If you pick a model that your account cannot use, the prompt fails. The error names the model, the reason and the fix. For example: ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} Amazon Bedrock has not granted this AWS account access to anthropic.claude-opus-5. Bedrock grants model access per AWS account and per region, so a model in the sandbox catalog still has to be enabled on your side: open the Amazon Bedrock console in the region this sandbox's credential uses, find anthropic.claude-opus-5 in the Model catalog, request access, and retry once AWS approves it. Pick a model you already have access to in the meantime. ``` Two related failures show different errors: | Cause | What you see | | - | - | | AWS rejects the key | An authentication error. The harness names the endpoint it called | | The region prefix of the model id does not match the region of your credential | `The provided model identifier is invalid` | The `us.` profiles above work only from US regions. From `eu-west-1`, pass `eu.anthropic.claude-sonnet-4-6` instead. The same applies to `au.` and `jp.`. A `global.` prefix works from any supported source region. It needs a wider IAM policy. Read [global cross-region inference](https://docs.aws.amazon.com/bedrock/latest/userguide/global-cross-region-inference.html). ## Mistral Mistral Vibe runs the models of Mistral. pi, OpenCode and Prime Agent run the same models on the same credential. They also run them through OpenRouter or LLM Gateway, on those keys. | Source | How | | - | - | | **Your account** | Agents & Proxying: the Mistral Vibe subscription row (Sign in) or the Mistral API key row | | **Per sandbox, from your user** | `boat new --no-env -e MISTRAL_API_KEY=…` | | Harness | Model ids | | - | - | | Mistral Vibe | `mistral-large-4` (default), `mistral-medium-3.5`, `mistral-small-4`. Reasoning levels are `none` and `high`, the two levels the Mistral API accepts | | pi, OpenCode, Prime Agent | The same ids plus `mistral-large-3` on the Mistral credential. `openrouter:mistralai/mistral-large-4-0` and the other OpenRouter ids on an OpenRouter key. `llmgateway:mistral-large-4` and the other LLM Gateway ids on an LLM Gateway key | When both Mistral credentials are on, boat uses the subscription key. So usage goes to the Vibe quota of your plan first. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt --provider mistral "Summarize this repo" boat prompt --provider pi --model mistral-large-4 "Now review the diff" ``` ## Grok (xAI) pi, OpenCode and Prime Agent run the Grok models of xAI with their built-in xAI provider. Claude Code and Codex do not: xAI has no endpoint that either harness can call as it is. | Source | How | | - | - | | **Your account** | Agents & Proxying: the Grok subscription row (Sign in, then confirm the code on accounts.x.ai) or the xAI API key row | | **Per sandbox, from your user** | `boat new --no-env -e XAI_API_KEY=…` | Model ids: `grok-4.7`, `grok-4.6`, `grok-build-0.1`. When both xAI credentials are on, boat uses the subscription. boat renews the sign-in. The sandbox gets the access token only, never the renew token. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt --provider opencode --model grok-4.7 "Summarize this repo" ``` ## OpenCode Go and pay-as-you-go One [OpenCode key](https://opencode.ai/console) (`oc_sk_…`) covers the [Go plan](https://opencode.ai/go) and pay-as-you-go credits. pi, OpenCode and Prime Agent use it. | Plan | Model ids | | - | - | | Go (pi and OpenCode only: Go refuses Prime Agent, which does not send the session header Go requires) | `opencode-go:kimi-k3`, `opencode-go:glm-5.3`, `opencode-go:qwen3.8-max`, `opencode-go:deepseek-v4-pro`, `opencode-go:minimax-m3`, `opencode-go:mimo-v2.6-pro`, `opencode-go:grok-4.7`, `opencode-go:gpt-6-luna` | | Pay-as-you-go | `opencode:claude-opus-5-5`, `opencode:claude-sonnet-5-5`, `opencode:gpt-6.1-sol`, `opencode:gemini-4-argon` | ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --no-env -e OPENCODE_API_KEY=oc_sk_… boat prompt --provider pi --model opencode-go:kimi-k3 "Summarize this repo" ``` # Steer a running turn Source: https://docs.boat.dev/integrated-agents/steering Send a new message to an agent while it works, or interrupt it. The agent uses a steer and keeps what it was doing. You have three options while a turn runs: | Command | API | What happens to the running turn | | - | - | - | | `boat prompt` | [`POST /prompt`](/api/reference/agent/prompt-sandbox-agent) | The new prompt waits until the turn finishes | | `boat interrupt` | [`POST /interrupt`](/api/reference/agent/interrupt-running-agent-work) | The turn stops. Files that it already changed stay. The conversation keeps its memory | | **`boat steer`** | [`POST /steer`](/api/reference/agent/steer-a-running-turn) | The turn gets your new message. The agent uses it and keeps all it was doing | Use `boat steer` to change the task. Use `boat interrupt` only to stop the work. `boat steer` is the same as typing into a coding agent while it works. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt "Refactor billing and run the full test suite" boat steer "Skip the integration tests, the unit tests are enough" boat steer --convo <id> "Also update the changelog when you are done" ``` If you omit `--convo`, `boat steer` steers the conversation that this shell prompted last. A bare `boat prompt` continues the same conversation. ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark-default"}} %%{init: {"theme": "base", "fontFamily": "IBM Plex Mono", "themeVariables": {"fontFamily": "IBM Plex Mono", "fontSize": "14px", "primaryColor": "#F1F3F9", "primaryBorderColor": "#263FA9", "primaryTextColor": "#060606", "secondaryColor": "#E0E3F2", "tertiaryColor": "#FEFEFE", "lineColor": "#060606", "textColor": "#060606", "mainBkg": "#F1F3F9", "nodeBorder": "#263FA9", "clusterBkg": "#FEFEFE", "clusterBorder": "#C4C4C4", "edgeLabelBackground": "#FEFEFE", "actorBkg": "#F1F3F9", "actorBorder": "#263FA9", "actorTextColor": "#060606", "actorLineColor": "#9E9E9E", "signalColor": "#060606", "signalTextColor": "#060606", "labelBoxBkgColor": "#F1F3F9", "labelBoxBorderColor": "#263FA9", "noteBkgColor": "#E0E3F2", "noteBorderColor": "#E0E3F2", "noteTextColor": "#060606", "sectionBkgColor": "#F1F3F9", "altSectionBkgColor": "#FEFEFE", "taskBkgColor": "#263FA9", "taskBorderColor": "#263FA9", "taskTextColor": "#FEFEFE", "gridColor": "#E0E0E0"}, "flowchart": {"padding": 16, "nodeSpacing": 48, "rankSpacing": 48, "curve": "linear"}, "sequence": {"boxMargin": 16, "actorMargin": 48, "noteMargin": 16, "messageMargin": 32, "mirrorActors": false}, "state": {"padding": 16}, "gantt": {"barHeight": 24, "barGap": 8, "fontSize": 14, "sectionFontSize": 14}}}%% sequenceDiagram participant You participant Turn as The running turn You->>Turn: boat prompt "refactor billing, run the tests" Note over Turn: working, tests running You->>Turn: boat steer "skip the integration tests" Note over Turn: still the same turn, now with your instruction Turn-->>You: finishes the whole thing ``` ## How each harness gets the message Four of the seven harnesses accept a message during a turn natively. Nothing stops. OpenCode, Kimi Code and Mistral Vibe have no such feature. Their protocol has "prompt" and "cancel", and nothing between them. For these harnesses, boat uses a fallback automatically. | Harness | Delivery | Turn interrupted? | | - | - | - | | Claude Code | Native. The message goes into the turn when the harness takes it in. If it does not, boat runs it right after, as its own turn on the same session. | No | | Codex | Native. `turn/steer` adds your message to the turn in progress. | No | | pi | Native. The message goes in at the next model call of the turn. This is usually right after the tool in progress finishes. | No | | Prime Agent | Native. Same as pi. | No | | OpenCode | Fallback. boat stops the turn. It then starts a new turn at once on the **same** conversation, with "Continue what you were doing" plus your instruction. | Yes, and it continues by itself | | Kimi Code | Fallback. Same as OpenCode. | Yes, and it continues by itself | | Mistral Vibe | Fallback. Same as OpenCode. | Yes, and it continues by itself | ## boat makes sure the agent acts on a steer A harness can accept a message and then do nothing with it. So boat does not trust the harness. boat does these things: * Where the harness has its own steering queue, boat watches it. * boat waits for that queue to empty before it marks the turn finished. * Where boat cannot see the delivery, it runs your instruction as its own turn when the turn ends. So when `boat steer` returns and the turn later reports `finished`, the agent did the instruction. It did not only receive it. ## Steer modes The API response and the event both carry `native`. The event also carries the exact `mode`. It is one of `native`, `native-continued`, `fallback`, or `late`. **`native-continued`** is the honest middle case. The harness accepted the message, but its turn ended without acting on it. So boat ran it at once as its own turn on the same session. Nothing was interrupted and nothing was forgotten. The instruction only runs one turn boundary later. The `fallback` path also keeps the harness session and all its memory. So nothing is forgotten. The cost is the one tool call that was in progress. The agent can redo a small part of the work it had just started. ## A steer in the event stream A steer is its own event in the stream. It is never a queued prompt: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat events --convo <id> ``` ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} you [prompt]: Refactor billing and run the full test suite you [steer]: Skip the integration tests, the unit tests are enough ... ``` ## Steer with no running turn If the conversation has no turn in progress, boat refuses the steer with `no_running_turn` (409). This is on purpose. You asked to change a running turn. A new queued turn would be a surprise. To start a new turn, use `boat prompt`. # AgentEnv Source: https://docs.boat.dev/integrations/agentenv Run AgentEnv RL environments and agents on boat sandboxes with the built-in boat sandbox provider: install, config, a first run, sizes and what the provider refuses. [AgentEnv](https://www.agentenvframework.com/) is an open-source framework from engineers at Scale AI. You use it to build RL environments, and to run and grade agents inside them. AgentEnv has a built-in `boat` sandbox provider. With it, each environment and each agent runs in its own boat sandbox: an Ubuntu VM with Docker inside. ``` agent-env run ──> boat provider ──> one boat sandbox per env, one per agent ``` ## Set it up You need Python 3.11.4 or later and a boat account. For the trial, see [Free trial](/free-trial). **1. Get a boat API key** Create a key on the [API keys](/api-keys) tab of the dashboard, or run `boat api-key create agentenv --preset ci`. Keep it in an environment variable: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} export BOAT_API_KEY=boat_... ``` **2. Install AgentEnv with the boat extra** ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} pip install 'agentenv-framework[boat]' ``` **3. Configure the provider** Add the key reference to your AgentEnv config. Use `env:` or `secret:`, never the key itself: ```toml title=".agentenv/config.toml" theme={"theme":{"light":"github-light","dark":"github-dark-default"}} [sandbox.providers.boat.config] api_key = "env:BOAT_API_KEY" ``` **4. Check your setup** Run the built-in hello task on boat. It needs no model: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} agent-env run hello --sandbox boat ``` ## Use boat for your runs Make boat the default for environments, agents or both: ```toml title=".agentenv/config.toml" theme={"theme":{"light":"github-light","dark":"github-dark-default"}} [sandbox] default = "boat" # envs and deploy_sandbox steps agent_default = "boat" # agents ``` To choose boat for one run only, pass a flag: | Command | Flag | | - | - | | `agent-env run` | `--sandbox boat` | | `agent-env task run` | `--env-sandbox boat`, `--agent-sandbox boat` | A comma-separated value, for example `"boat,local"`, tries the next provider when one fails to create a sandbox. ## What happens on boat | AgentEnv step | What happens on boat | | - | - | | Create an env or agent | Creates a sandbox of the smallest size that fits the request, and waits until it is ready. | | Exposed ports | boat hosts each port on a public HTTPS URL. | | Run ends | AgentEnv deletes the sandbox. | | Run crashes or is cancelled | The provider finds the sandbox by its label and deletes it. | | Nothing deletes it | boat stops the sandbox at the AgentEnv timeout, 2 hours by default. | Each sandbox is a [no-env sandbox](/environments#safe-for-third-parties). It gets none of your secrets, credentials or private repositories, and it cannot act on your account or on other sandboxes. Snapshots are off, so a stopped sandbox keeps no disk. ### Sizes AgentEnv asks for CPU, memory and disk. The provider picks the smallest boat size that covers all three: | Size | vCPU | Memory | Disk | | - | - | - | - | | `small` | 2 | 4 GiB | 51 GB | | `default` | 4 | 8 GiB | 51 GB | | `large` | 8 | 16 GiB | 111 GB | | `xlarge` | 16 | 32 GiB | 251 GB | A request bigger than `xlarge` fails. See [Machines](/machines). ### Labels Every sandbox carries the label `agentenv.managed=true`. AgentEnv attribution (for example `[sandbox.attribution]` in its config) becomes `agentenv.attr.*` labels. Use them to find a run's sandboxes and to join [sandbox usage](/api/reference/sandboxes/get-sandbox-usage) to your runs. ## Limits When boat refuses a create because a [start limit](/limits) is full, the provider waits and tries again. It makes up to 6 attempts. Keep the number of envs and agents that start at the same time under your limits. ## Not available The provider refuses these with an error. It never creates a sandbox that is less isolated than you asked for. * An `image` override. Every sandbox boots the standard boat image. See [Base image and tools](/machines/tools). * A `network_policy` that restricts egress. boat has no egress allowlist yet. ## Configuration | Key | Default | Description | | - | - | - | | `api_key` | none (required) | boat API key, as `env:NAME` or `secret:NAME`. | | `api_url` | `https://boat.dev/api/v1` | API base URL. | ## Resources > [card] [AgentEnv sandboxes](https://www.agentenvframework.com/docs/sandboxes#boat) > > The boat provider in the AgentEnv docs. > [card] [Source on GitHub](https://github.com/scaleapi/agentenv-framework) > > The AgentEnv framework and its providers. > [card] [Evals and RL environments](/evals) > > Run many eval episodes on boat: saved snapshots, forks, limits and cost. > [card] [API keys](/api-keys) > > Create the key that the provider needs. # Eve adapter Source: https://docs.boat.dev/integrations/eve Run Eve agents in boat sandboxes with the @asciidev/eve-box backend: setup, a complete example, options, and safe sandboxes for other people. > [!NOTE] > > The package keeps its old name, `@asciidev/eve-box`, and its function `asciiBox()`. Version 0.1.6 calls the old Box API, which sends a `Sunset` date of 31 October 2026. Without `apiKey`, it reads `BOX_API_KEY`. See [Migrating from Box](/migrating-from-box). [Eve](https://www.npmjs.com/package/eve) is a TypeScript framework for coding agents. Eve runs each agent in a sandbox: a filesystem and a shell where the agent reads files, writes files and runs commands. Eve lets you choose where that sandbox runs. boat is a cloud sandbox: a full Linux machine that you create over an API. `@asciidev/eve-box` connects Eve to boat. It is an Eve **sandbox backend**. It sends the Eve filesystem and process operations to the boat API. Your Eve agents then run on boat sandboxes, not on your laptop. > [!NOTE] > > You need only two things for this guide: Node.js 18+ and a boat API key. You do not need to know Eve or boat before you start. ## How it fits together | Part | Job | | - | - | | **Eve** | Holds your agent logic. Calls a sandbox for filesystem and shell work. | | **`@asciidev/eve-box`** | The adapter that you plug into Eve. | | **boat** | The machine where the work runs. | ``` your Eve agent ──> Eve sandbox API ──> @asciidev/eve-box ──> Sandbox machine ``` ## Set it up **1. Create a boat account** Sign in at [boat.dev](https://boat.dev) and start a plan. See [Quickstart](/quickstart) and [Free trial](/free-trial). **2. Get a boat API key** Create a key on the [API keys](/api-keys) tab of the dashboard, or run `boat api-key create eve --preset ci`. Keep it in an environment variable, never in source control. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} export BOAT_API_KEY=boat_... ``` **3. Install the packages** ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} npm install @asciidev/eve-box eve ``` Use a modern TypeScript config: `"module": "NodeNext"`, `"target": "ES2022"`, `"lib": ["ES2022", "DOM"]`. Set `"type": "module"` in `package.json`. **4. Define the sandbox backend** Set the Eve sandbox to use boat. In an Eve project, put this in your sandbox definition file: ```ts title="sandbox.ts" theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { defineSandbox } from "eve/sandbox"; import { asciiBox } from "@asciidev/eve-box"; export default defineSandbox({ backend: asciiBox({ apiKey: process.env.BOAT_API_KEY!, ttlSeconds: 3600, // auto-stop the sandbox one hour after creation }), }); ``` The Eve agents in this project now run on boat. ## A complete example This script runs on its own. It creates a boat sandbox session and tests the operations that Eve uses: run commands, read files and write files. Use it to check your setup before you connect the backend to a larger Eve agent. ```ts title="hello-sandbox.ts" theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { asciiBox } from "@asciidev/eve-box"; async function main() { const backend = asciiBox({ apiKey: process.env.BOAT_API_KEY!, name: "eve-hello", ttlSeconds: 600, }); // Create a session (this provisions a sandbox and waits until it is ready). const handle = await backend.create({ templateKey: null, sessionKey: "hello-session", runtimeContext: { appRoot: process.cwd() }, }); const session = await handle.useSessionFn({ networkPolicy: "allow-all" }); // Write a file, run a command against it, and read the result back. await session.writeTextFile({ path: "notes/hello.txt", content: "hello from Boat\n" }); const result = await session.run({ command: "cat notes/hello.txt && uname -a" }); console.log("exit:", result.exitCode); console.log(result.stdout); // Paths resolve under /workspace, matching Eve's sandbox contract. console.log(session.resolvePath("notes/hello.txt")); // -> /workspace/notes/hello.txt } main().catch((error) => { console.error(error); process.exitCode = 1; }); ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} BOAT_API_KEY=boat_... npx tsx hello-sandbox.ts ``` The output shows the file contents, the `uname` output of the machine, and exit code `0`. ## What the backend maps | Eve operation | boat behaviour | | - | - | | `run` | Runs a bounded command in the sandbox work directory. | | `spawn` | Starts a background process. Gives streamed `stdout`/`stderr`, `wait()` and `kill()`. | | `readTextFile` / `writeTextFile` | Reads and writes files under the sandbox work directory. | | `readBinaryFile` / `writeBinaryFile` | The same, with base64 transfer for binary content. | | `removePath` | Removes files and directories in the workspace. | | `resolvePath` | Resolves relative paths from `/workspace`. | | create / resume | Creates a new sandbox, or connects again to one from the saved Eve session state. | ## Configuration `asciiBox(options)` accepts these options: | Option | Default | Description | | - | - | - | | `apiKey` | `process.env.BOX_API_KEY` | boat API key (`boat_...`). The examples pass `process.env.BOAT_API_KEY`. | | `baseUrl` | the old Box API | API base URL. | | `name` | `eve-<sessionKey>` | Name, or `(input) => string`, for the sandboxes that Eve creates. | | `ttlSeconds` | `3600` | Auto-stop TTL in seconds. `null` turns off auto-stop. | | `noEnv` | `false` | Keeps your account secrets and credentials out of sandboxes. Read [Agents that other people use](#running-agents-for-other-people). | | `env` | none | Environment variables for each sandbox that Eve creates. Read [Agents that other people use](#running-agents-for-other-people). | | `pollMs` | `500` | How often `spawn()` streams and `wait()` poll. | | `commandTimeoutMs` | none | Timeout for blocking `run()` commands. | | `networkPolicy` | none | Initial network policy. Read [Network policies](#network-policies). | ## Running agents for other people > [!WARNING] > > By default, a sandbox gets **your** boat account. This includes your secrets, secret files, repositories cloned with your GitHub credentials, and your SSH identity. This is fine for your own agents. If other people can control the agent, set `noEnv: true`. Then they cannot read your secrets or act as you. With `noEnv: true`, the sandbox starts without your account credentials. It cannot act on your account or other sandboxes. This does not restrict network access. You then give it only what it needs: * Secrets: through `env`. * Files and setup: through the Eve `onSession` hook. ```ts title="sandbox.ts" theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { defineSandbox } from "eve/sandbox"; import { asciiBox } from "@asciidev/eve-box"; export default defineSandbox({ backend: asciiBox({ apiKey: process.env.BOAT_API_KEY!, noEnv: true, // Scoped secrets: the only env this sandbox gets: env: { MY_APP_TOKEN: process.env.MY_APP_TOKEN! }, }), async onSession({ use }) { const sandbox = await use(); // Seed files and run setup with the session API. These wrap Boat's file // and command APIs, so you don't need `boat scp` or `boat ssh`. await sandbox.writeTextFile({ path: "config/app.json", content: JSON.stringify({ mode: "prod" }) }); await sandbox.run({ command: "git clone https://github.com/acme/public-repo . && npm ci" }); }, }); ``` Rules for `env`: * `env` keys merge over your account variables. The per-sandbox value wins. * The limit is 100 variables and 64 KB in total. * boat rejects reserved boat-internal names. The session API replaces the boat CLI inside Eve: | Eve call | Same as | | - | - | | `writeFile` / `readFile` | [`boat scp`](/ssh-access#copy-files) | | `run` / `spawn` | `boat exec <id> <cmd>` / `boat exec <id> --detach <cmd>` | A no-env sandbox cannot reach your private repositories. Clone public ones, or let the user sign in inside the sandbox. Read [No-env sandboxes](/environments#safe-for-third-parties). ## Reusing a prepared environment Setup runs when boat first creates the sandbox for each session. To start many sessions from the same prepared state: 1. Prepare one sandbox. 2. Save it as a [saved snapshot](/snapshots/templates): `boat snapshot <id> my-stack`. 3. Create each new sandbox from it: `boat new --from my-stack`, or `from` in the [API](/api/reference/sandboxes/create-sandbox). A [fork](/api/reference/sandboxes/fork-sandbox) also copies a sandbox, but it follows the newest snapshot of its source. A saved snapshot does not change. ## Network policies boat does not enforce the fine-grained Eve network policies yet. * The backend accepts `"allow-all"`. * For stricter policies, it throws `EveSandboxUnsupportedError`. This includes `"deny-all"`, allow-lists and subnet rules. Thus you never get isolation that is not real. If you need policies that a firewall enforces, run that Eve agent on a backend that supports them. ## Resources > [card] [npm package](https://www.npmjs.com/package/@asciidev/eve-box) > > `@asciidev/eve-box` on npm. > [card] [Source on GitHub](https://github.com/ariana-dot-dev/eve-box) > > Issues, examples and the adapter source. > [card] [boat quickstart](/quickstart) > > Install boat and create your first sandbox. > [card] [boat API keys](/api-keys) > > Create and manage the key that this adapter needs. # Harbor adapter Source: https://docs.boat.dev/integrations/harbor Run Harbor agent trials and evals on boat sandboxes with the harbor-box environment adapter. What works today, Terminal-Bench 2.0 status, and the harbor run command. `harbor-box` runs [Harbor](https://pypi.org/project/harbor/) trials in boat sandboxes instead of local Docker containers. It is a Harbor environment adapter: the class `BoxEnvironment` in the module `harbor_box_environment`. > [!WARNING] > > **Terminal-Bench 2.0 does not run on boat through this adapter today.** Every Terminal-Bench 2.0 task names a prebuilt Docker image (`docker_image`), and `harbor-box` 0.1.2 refuses tasks with a Docker image. Use the adapter for your own tasks that run on the standard boat sandbox. For other ways to run evals on boat, see [Evals and RL environments](/evals). > [!NOTE] > > The package keeps its old name, `harbor-box`. Version 0.1.2 reads the key from `BOX_API_KEY` and calls the old Box API. That API sends a `Sunset` date of 31 October 2026. See [Migrating from Box](/migrating-from-box). ## Set it up You need Python 3.12 or later and a boat account. For the trial, see [Free trial](/free-trial). 1. Create an API key on the [API keys](/api-keys) tab of the dashboard, or run `boat api-key create harbor --preset ci`. 2. Install the adapter. It also installs Harbor (`harbor>=0.14.0`), `httpx` and `tenacity`: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} pip install harbor-box ``` 3. Give the key to the adapter. It reads `BOX_API_KEY`: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} export BOX_API_KEY=boat_... ``` ## Run a Harbor job on boat Pass the adapter as the environment of `harbor run`. `-e` takes a custom environment as `module:Class`: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} harbor run -p path/to/task -a claude-code -m anthropic/claude-sonnet-4-5 \ -e harbor_box_environment:BoxEnvironment -n 4 ``` | Flag | Meaning | | - | - | | `-p` | A local task or dataset directory | | `-a`, `-m` | The Harbor agent and its model | | `-e` | The environment: here the boat adapter | | `-n` | Trials that run at the same time. Each trial is one sandbox, so keep `-n` under your [start limits](/limits) | > [!WARNING] > > At the end of a trial, `harbor-box` 0.1.2 fails to delete its sandbox (the delete call has no confirmation header). The sandbox keeps running until its auto-stop, 24 hours by default. After each job, run `boat list` and delete the trial sandboxes with `boat delete <id> --yes`. ## Check your setup This script creates one sandbox through the adapter, writes a file, runs a command and stops the sandbox. boat tested it with `harbor-box` 0.1.2 and Harbor 0.24. ```python title="hello_sandbox.py" theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import asyncio import tempfile from pathlib import Path from harbor.models.task.config import EnvironmentConfig from harbor.models.trial.paths import TrialPaths from harbor_box_environment import BoxEnvironment async def main() -> None: with tempfile.TemporaryDirectory() as raw: tmp = Path(raw) # Harbor needs an environment directory. Boat reads only the WORKDIR of the Dockerfile. env_dir = tmp / "environment" env_dir.mkdir() (env_dir / "Dockerfile").write_text("FROM ubuntu:24.04\nWORKDIR /workspace\n") trial_paths = TrialPaths(tmp / "trial") trial_paths.mkdir() env = BoxEnvironment( environment_dir=env_dir, environment_name="harbor-hello", session_id="hello-session", trial_paths=trial_paths, task_env_config=EnvironmentConfig(workdir="/workspace"), ttl_seconds=600, # auto-stop 10 minutes after creation ) await env.start(force_build=False) # creates a sandbox and waits until it is ready try: await env.upload_file(__file__, "/workspace/hello_sandbox.py") result = await env.exec("echo 'hello from Boat' > notes.txt && cat notes.txt && uname -a") print("exit:", result.return_code) print(result.stdout) finally: await env.stop(delete=False) # stop; delete=True fails in 0.1.2 if __name__ == "__main__": asyncio.run(main()) ``` ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} BOX_API_KEY=boat_... python hello_sandbox.py ``` The output shows `hello from Boat`, the `uname` line of the sandbox and `exit: 0`. ## What the adapter maps | Harbor operation | What happens on boat | | - | - | | `start` | Creates a sandbox and waits until it is ready. | | `stop` | Stops the sandbox. boat keeps its disk in a snapshot for 14 days. | | `exec` | Runs a command in the sandbox. Optional: `cwd`, `env`, `user` and timeout. | | `upload_file`, `download_file` | Copies files to and from the sandbox. Binary files go as base64. | | `upload_dir`, `download_dir` | Copies directory trees. | | `ensure_dirs` | Creates the work and mount directories. | | `is_file`, `is_dir` | Checks paths in the sandbox. | ## Configuration `BoxEnvironment(...)` takes the standard Harbor arguments (`environment_dir`, `environment_name`, `session_id`, `trial_paths`, `task_env_config`) and these options: | Option | Default | Description | | - | - | - | | `api_key` | `BOX_API_KEY` | boat API key (`boat_...`). `harbor run` also needs `BOX_API_KEY` set. | | `base_url` | the old Box API | API base URL. | | `ttl_seconds` | `86400` (24 hours) | Auto-stop timer. `None` turns auto-stop off. | | `no_env` | `True` | Creates [no-env sandboxes](#isolation). Set `False` to use your environment. | | `request_timeout_seconds` | `60` | HTTP timeout for each request. | ## What the adapter does with your task boat does not build Docker images. Each trial starts on the standard boat sandbox (Ubuntu with common toolchains). See [Base image and tools](/machines/tools). | Task input | What the adapter does | | - | - | | Files in the environment directory | Uploads them to the working directory at start. | | `Dockerfile` | Reads only the `WORKDIR` of the last stage. It does not run `RUN` or `COPY`. Install dependencies with a command (`await env.exec(...)`) or from your agent. | | `docker_image` in `task.toml` | Refuses the task. | | Environment variables | Sends them to the sandbox. | To start many trials from one prepared state, prepare one sandbox, save a [saved snapshot](/snapshots/templates), and create each trial sandbox from it. See [Evals and RL environments](/evals). ## Isolation The adapter creates **no-env** sandboxes by default. A trial gets none of your secrets, credentials or private repositories, and it cannot act on your account or on other sandboxes. To use your [environment](/environments), pass `no_env=False`. ## Not available The adapter refuses these task settings with an error: * A prebuilt Docker image (`docker_image`), Docker image builds and Compose. * Network policies: no network, or allow-lists. * GPUs, TPUs and Windows. The adapter writes files as the sandbox user, not as root. A task that writes outside the work directory (for example `/solution` or `/tests`) fails. ## Resources > [card] [PyPI package](https://pypi.org/project/harbor-box/) > > `harbor-box` on PyPI. > [card] [Harbor: run a job](https://docs.harborframework.com/jobs/run-a-job) > > The `harbor run` flags. > [card] [Evals and RL environments](/evals) > > Run many eval episodes on boat: saved snapshots, forks, limits and cost. > [card] [API keys](/api-keys) > > Create the key that the adapter needs. # Limits and errors Source: https://docs.boat.dev/limits Every boat limit per plan: sandboxes at once, included starts, extra starts, and command and output caps. The error codes, how to retry, and how to raise a limit. A start is free up to your included number. Above it, a start costs money. Above the maximum, it fails. Create, fork and resume each count as one start. A resume that takes back the kept machine of the sandbox does not count. ## Limits per plan | Plan | Sandboxes at once | Included starts per minute / hour / day | Maximum starts per day | | - | - | - | - | | [Free trial](/free-trial) | 2 | 5 / 25 / 75 | 75 | | \$20 | 100 | 12 / 60 / 200 | 1,200 | | \$100 | 300 | 30 / 210 / 840 | 5,040 | | \$500 | 1,000 | 65 / 420 / 1,680 | 10,080 | | \$2000 | 2,000 | 90 / 600 / 2,400 | 14,400 | * boat counts starts over the last 60 seconds, 60 minutes and 24 hours. There is no reset date. * A stopped sandbox does not count against "at once". * For organizations, read [Seats, limits and caps](/organizations/seats-and-limits). * To see what you have left, run `boat limits`. ## Extra starts A start above your included number is an extra start. It needs a first payment. | Start | Price | Per day on the \$20 plan | | - | - | - | | Included | Free | 1 to 200 | | Up to 1.5 times included | \$0.03 | 201 to 300 | | Up to 2 times | \$0.05 | 301 to 400 | | Up to 6 times | \$0.07 | 401 to 1,200 | | Above 6 times | Fails | 1,201 and up | * The prices apply per minute, hour and day. A start pays the highest of the three. * The maximum per minute is 3 times, not 6. Your wallet pays first. With an empty wallet, [your invoice](#extra-starts-on-your-invoice) pays if you turned it on. If neither pays, the start fails. **boat never queues a start.** A failed start does not run later. Send a new call after `nextStartAt`. Only [`runs-on: boat` jobs](/ci#what-happens-at-a-limit) can wait. ### Extra starts on your invoice ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat billing extra-starts on boat billing extra-starts off ``` * It is off by default. A trial, a past-due account, or a plan set to end cannot use it. * The cap per seat per month is \$80 on the \$20 plan, \$400 on the \$100 plan, and \$1,500 above. * If your plan ends first, your wallet pays what is left and can go negative. * In a script, add `--yes` to accept the terms. ### In the API `GET /limits` returns: | Field | Means | | - | - | | `nextStartDollars` | Price of the next start. `null` when it would fail. | | `startLimitsWithWallet` | The maximums. `null` when extra starts are not available now. | | `overagePrices.startBrackets` | The price table. | | `startWindowFull` | Only while a limit is full: `window`, `limit`, `freesAt`, `paidBy` (`wallet`, `invoice` or `null`), `message` (the text the CLI prints) and `help` (the same text in parts). | | `planNudge` | Only when the next plan fits your last 30 days better. `text` has the sum. boat can send it by email once a billing period. Turn that off in [Alerts](https://boat.dev/dashboard?tab=alerts). | ## Other limits | Limit | Value | | - | - | | Auto-stop | Default 1 hour. Maximum 30 days, or off. Trial: 2 hours maximum. | | Sizes | `xlarge` needs the \$100 plan or higher. The trial has no `large` or `xlarge`. `boat limits` shows the sizes that you can create now. In the API: `machineTypes` in `GET /limits`. | | Disk of a stopped sandbox | Kept for at least 14 days after the stop, then eligible for automated retention cleanup. The job currently reports candidates without deleting them in production. | | Saved snapshots | 10 included for every \$20 of plan per seat, never fewer than 10, per account or organization. Each one more costs \$0.056 a day from the wallet. No maximum or scheduled expiry. Unpaid extras can be deleted after 7 days. | | Command that waits for its result | API: default timeout 30 s, maximum 600 s. For longer work, run it detached. No maximum with `boat exec --timeout 0` (CLI) or `run_command` / `runCommand` (SDK). | | Output of a waiting command | 8 MiB per stream | | Command output kept per account | 10 MiB compressed per hour (about 50 MiB of text) | | Output of other processes | 64 KiB/s per process, plus 10 MiB compressed per hour per account | | Prompt attachments | 12 files, 25 MB per file, 64 MB in total | | Webhooks | 10 per account | | API keys | Lifetime 90 days by default, 365 days maximum, or never expires (`--ttl never`) | | API requests | 10,000 per 60 seconds from one IP address | For the command limits, read [Background commands](/long-running-tasks/background-commands) and [Command history and logs](/long-running-tasks/command-history). ## Errors and what to do | Status | Code | Cause | What to do | | - | - | - | - | | `429` | `rate_limited` | A start limit is full. The start did not run and does not queue. The body has `window` (`minute`, `hour` or `day`), `limit`, `cause` (`trial`, `plan`, `cap` or `ceiling`), `nextStartAt` and `retryAfterSeconds`. | Pick an option in `message`, or send a new call after `nextStartAt`. At cause `ceiling`, only a bigger plan or more seats help. | | `429` | `limit_reached` | The plan's "at once" limit is full. | Stop a sandbox, or raise the plan. | | `429` | `member_limit_reached` | The organization owner capped how many sandboxes you run at once. | Stop one, or ask the owner to raise your cap. | | `429` | `trial_compute_limit_reached` | The trial used its 25 hours. | [End the trial](/free-trial#end-the-trial-early). | | `429` | `IP_RATE_LIMIT_EXCEEDED` (in `code`) | More than 10,000 API requests in 60 seconds from one IP address. An open stream counts once, when it opens. | Wait the `retryAfter` seconds in the body. Watch the `RateLimit` header to slow down before this. | | `402` | `billing_required` | The included time is used and the wallet is empty, or the account or organization has no plan. | Open the `billingUrl` in the body. Add money to the wallet, or start a plan. | | `402` | `team_member_cap_reached` | You used your per-member usage cap in the organization. | Ask the owner to raise it. It resets with the billing month. | | `403` | `trial_machine_class_not_allowed` | `large` during the trial. | Use `default`, or end the trial. | | `413` | `file_too_large` | A file read is above 5 MiB. | Get a download link with `POST /sandboxes/{sandboxId}/files/download-url`. | | `400` | `invalid_query` | A list call got a query parameter that it does not know. | Remove the parameter. | | `400` | `trial_auto_stop_required` | No auto-stop, or more than 2 hours, during the trial. | Set an auto-stop of 2 hours or less. | | `409` | `snapshot_data_expired` | boat deleted the data after the sandbox had been stopped for at least 14 days. | You cannot resume it. Next time, save a [saved snapshot](/snapshots/stop#keep-a-stopped-sandbox-longer-than-14-days) before day 14. | | `503` | `no_ready_machine` | You asked to [fail fast](/machines/fail-fast) and no machine is ready. Nothing started or counted. | Retry after `retryAfterSeconds` (5). | | `503` | `out_of_capacity` | boat is out of machines for a short time. Running sandboxes are not affected. | Retry after `retryAfterSeconds` (120). | ### Retry rules * Every `429` sends a `Retry-After` header: the wait in seconds. The body also has the wait: `retryAfterSeconds` on `rate_limited`, `retryAfter` on an IP limit. A `503` has `retryAfterSeconds`. * Every API answer carries your IP limit in two headers ([IETF RateLimit fields](https://datatracker.ietf.org/doc/draft-ietf-httpapi-ratelimit-headers/)). `r` is the number of requests you have left. `t` is the seconds until the window resets: ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} RateLimit-Policy: "ip";q=10000;w=60 RateLimit: "ip";r=9412;t=60 ``` * Create, resume and fork answers also carry your start limits, one policy per window: `starts-minute` (`w=60`), `starts-hour` (`w=3600`) and `starts-day` (`w=86400`). `RateLimit` reports the start window with the fewest starts left: `"<policy>";r=<starts left>;t=<seconds>`. An account with no start limit gets no start policies. * A start that fails with `rate_limited` does not count as a start. * Send an `Idempotency-Key` header on create and fork. A retry with the same key never makes a second sandbox or spends a second start. * The CLI does not retry. It prints the limit message and exits with an error. ## Raise a limit | You need | Do this | | - | - | | More starts or more sandboxes at once | Move to a bigger plan: `boat billing plan 100`, or [Dashboard > Billing](https://boat.dev/dashboard?tab=billing). The change applies at once. | | More of everything, for a team | Move to a bigger plan first. On the \$2000 plan, buy seats on an [organization](/organizations/seats-and-limits): each seat adds the full limits and included time. | | More time, same limits | Add money to the wallet (`boat wallet pay 50`) or turn on [auto top-up](/billing#auto-top-up). | | More starts for a short time | Use [extra starts](#extra-starts). | | More than the \$2000 plan gives | boat raises limits only on custom plans above \$2000 a month. [Contact us](/support) for a custom plan. | | Trial limits gone | Pay the first plan. Read [Free trial](/free-trial). | # Keep a sandbox running Source: https://docs.boat.dev/long-running-tasks Keep a sandbox running longer or 24/7, run long commands in the background, restart processes after resume or fork, and read past command output. A sandbox stops by itself 1 hour after it starts or resumes. This is the default auto-stop timer. For work that runs longer, use the tools on these pages. ## What you can do | You want | Use | Command | | - | - | - | | A sandbox that runs until you stop it | [Turn off auto-stop](/long-running-tasks/auto-stop#turn-off-auto-stop) | `boat extend <id> --no-auto-stop` | | More time, with a deadline | [Extend with a deadline](/long-running-tasks/auto-stop#extend-with-a-deadline) | `boat extend <id> --hours 12` | | An agent prompt that runs past the deadline | Nothing. While a prompt runs, boat moves the deadline forward by one auto-stop period | `boat prompt <id> "…"` | | A command that runs longer than the 30-second default timeout, or a server | [Background commands](/long-running-tasks/background-commands) | `boat exec <id> --detach "<command>"` | | The output of a past command, also on a stopped sandbox | [Command history and logs](/long-running-tasks/command-history) | `boat history <id>` | | The processes in a sandbox | [List processes](/long-running-tasks/command-history#list-processes) | `boat ps <id>` | | A process that comes back after stop, resume and fork | [Always-on services](/long-running-tasks/always-on-services) | `sudo systemctl enable --now <service>` | > [!NOTE] > > On the free trial, you cannot turn off auto-stop, and auto-stop cannot be more than 2 hours. boat refuses the call with `trial_auto_stop_required`. Everything else on these pages works on the trial. Read [Free trial](/free-trial). ## What comes back after a resume | Process | After a resume or fork | | - | - | | A systemd service that you enabled | Starts again by itself. | | A process that you started by hand | Does not come back. Start it again. | | A detached background command | Does not come back. | ## Learn more > [card] [Auto-stop and keep alive](/long-running-tasks/auto-stop) > > Turn off auto-stop, read the deadline, and extend a sandbox. > [card] [Background commands](/long-running-tasks/background-commands) > > Start a long command, read its output, attach to it, and stop it. > [card] [Command history and logs](/long-running-tasks/command-history) > > Read the output of past commands and processes. List the processes. > [card] [Always-on services, 24/7](/long-running-tasks/always-on-services) > > Make a process come back after stop, resume and fork. ## Related * [Snapshots](/snapshots) * [Environments](/environments) * [SSH](/ssh-access) * [Desktop streaming](/desktop-streaming) * [Public URLs](/hosting) # Always-on services, 24/7 Source: https://docs.boat.dev/long-running-tasks/always-on-services Run a server, bot or worker 24/7: make a process come back by itself after stop, resume and fork with a systemd service. To run a process 24/7, do two things: 1. [Turn off auto-stop](/long-running-tasks/auto-stop#turn-off-auto-stop): `boat extend <id> --no-auto-stop`. 2. Run the process as an enabled systemd service, as shown below. It then comes back after any stop, resume or fork. ## What comes back after a resume or fork `boat stop` makes a snapshot of the file system. `boat resume` restores that file system. `boat fork` makes a new sandbox from the latest snapshot. A resume takes a few seconds, for any amount of data in the sandbox. For what a snapshot saves, restore behavior, retention, and how to look at or download a snapshot, see [Snapshots](/snapshots). A stop and resume is the same as a server reboot: | Process | After a resume | | - | - | | A systemd service that you enabled | Starts again by itself. | | A process that you started by hand: a dev server, a background job, a tunnel, a browser session | Does not come back. Start it again, or make it a systemd service. | ## Run an always-on service To make a process come back after stop, resume and fork with no action from you, run it as an enabled systemd service. The unit file is under `/etc`, which is in the snapshot. Thus a resumed or forked sandbox starts the service by itself. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sudo tee /etc/systemd/system/my-app.service >/dev/null <<'UNIT' [Unit] Description=My app After=network.target [Service] User=user WorkingDirectory=/home/user/my-app ExecStart=/usr/bin/npm run start Restart=always [Install] WantedBy=multi-user.target UNIT sudo systemctl daemon-reload sudo systemctl enable --now my-app ``` * `Restart=always` also starts the process again if it crashes. * To check the service, run `systemctl status my-app`. * To read its logs, run `journalctl -u my-app`. Run these commands inside the sandbox. Use `boat ssh`, the [command endpoint](/api/reference/agent/execute-sandbox-command), or the `command` method of the SDKs. If the service serves HTTP, expose it with `host <port>`. After a resume, `host` on the same port gives the same URL and token. Thus links that you gave out continue to work. See [Public URLs](/hosting). ## Resume or fork To continue earlier work, resume the sandbox. To branch earlier work, fork it. Both use the latest snapshot. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat resume bx_f7k2q9hd boat fork bx_f7k2q9hd ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/resume" \ -H "Authorization: Bearer $BOAT_API_KEY" curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/fork" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.resume({ sandboxId: "bx_f7k2q9hd" }); const forked = await sandbox.fork({ sandboxId: "bx_f7k2q9hd" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.resume("bx_f7k2q9hd") forked = sandbox.fork("bx_f7k2q9hd") ``` ## Repeatable setup If you do not use a systemd service, start your work again after each resume or fork. Make the setup and start commands idempotent. * Run a short setup command normally. It must end within its timeout: 30 seconds by default, 600 at most. * Run a dev server or any process that does not end as a **detached** command. A normal command is killed at its timeout. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ssh "$sandbox_id" -- bash -s < ./setup.sh boat exec "$sandbox_id" --cwd my-app --detach "npm run dev" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/$BOAT_ID/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"bash ./setup.sh","cwd":"my-app","timeoutSeconds":600}' curl -sS -X POST "$BOAT_API_BASE/sandboxes/$BOAT_ID/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"npm run dev","cwd":"my-app","detached":true}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.command({ sandboxId, command: "bash ./setup.sh", cwd: "my-app", timeoutSeconds: 600 }); await sandbox.command({ sandboxId, command: "npm run dev", cwd: "my-app", detached: true }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.command(sandbox_id, CommandRequest(command="bash ./setup.sh", cwd="my-app", timeout_seconds=600)) sandbox.command(sandbox_id, CommandRequest(command="npm run dev", cwd="my-app", detached=True)) ``` For command timeouts and retries, see [Background commands](/long-running-tasks/background-commands#timeouts-and-retries). # Auto-stop and keep alive Source: https://docs.boat.dev/long-running-tasks/auto-stop Keep a sandbox alive: turn off auto-stop, read the auto-stop deadline, and extend a sandbox. A running agent prompt moves the deadline. ## Keep a sandbox alive Every sandbox has an auto-stop timer. * The default is 1 hour. The maximum is 30 days, or no auto-stop at all. * The timer counts from creation or from the last resume, not from your last activity. * A sandbox with a 1 hour TTL stops one hour after it starts, even in the middle of your own commands. * **A running agent prompt is the exception.** When the deadline comes while a prompt runs or waits, boat moves the deadline to one TTL later. It does this again until no prompt is active. | You want | Command | | - | - | | No auto-stop | `boat extend <id> --no-auto-stop` | | Stop 12 hours from now | `boat extend <id> --hours 12` | | See the deadline | `boat info <id>` | > [!NOTE] > > On the free trial, you cannot turn off auto-stop, and the TTL cannot be more than 2 hours. boat refuses the call with `trial_auto_stop_required`. Read [Free trial](/free-trial). ## Turn off auto-stop Use this when the sandbox must run until you stop it yourself. Examples are demos, browser sessions, long setup jobs and unattended workflows. A stop interrupts this work, and you must then start the processes again. Turn off auto-stop when you create the sandbox. For a sandbox that exists, set its TTL to `null`. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --no-auto-stop boat extend bx_f7k2q9hd --no-auto-stop ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"ttlSeconds":null}' curl -sS -X PATCH "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"ttlSeconds":null}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const created = await sandbox.create({ ttlSeconds: null }); await sandbox.update({ sandboxId: "bx_f7k2q9hd", ttlSeconds: null, }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} created = sandbox.create(create_sandbox_request=CreateSandboxRequest(ttl_seconds=None)) sandbox.update("bx_f7k2q9hd", UpdateSandboxRequest(ttl_seconds=None)) ``` You can also select **No auto-stop** in the dashboard. ### TTL on resume and fork `resume` and `fork` also accept `ttlSeconds`. Thus a sandbox that comes back does not need a second call to set its lifetime. | Call | When you do not give `ttlSeconds` | | - | - | | Resume | The sandbox keeps its current setting. | | Fork | The new sandbox gets 1 hour. It does not copy the setting of the source sandbox. | Thus a fork of a sandbox with auto-stop off does not silently make a second sandbox that never stops. See [Snapshots](/snapshots). ## Read the auto-stop deadline Each resume sets the deadline again. The new deadline is the resume time plus the TTL of the sandbox. If you schedule long jobs, do these steps: 1. Read the deadline after each resume. 2. Before a job that runs past the deadline, extend the sandbox. `archiveAfter` is the deadline. It is `null` when auto-stop is off. `ttlSeconds` is the TTL as you last set it. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat info bx_f7k2q9hd # shows the deadline and the time left ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd" \ -H "Authorization: Bearer $BOAT_API_KEY" | jq -r .sandbox.archiveAfter ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const info = await sandbox.get({ sandboxId: "bx_f7k2q9hd" }); console.log(info.sandbox.archiveAfter); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} info = sandbox.get("bx_f7k2q9hd") print(info.sandbox.archive_after) ``` At the deadline, the sandbox stops the same as with `boat stop`. The stop starts within about 5 seconds of the deadline. boat cuts off the jobs that run. See [what a stop does to running work](/snapshots/stop#what-a-stop-does). There is one exception. While a prompt to the agent of the sandbox runs, boat moves the deadline forward by one TTL. Your own jobs do not move the deadline. Examples are `boat exec` commands and services. Read `archiveAfter` again each time. Do not keep the first value. The API reports a stopped sandbox as `archived`. ## Extend with a deadline `boat extend` sets a new TTL. The new deadline is **now plus the TTL**, not the start time plus the TTL. The sandbox also keeps this TTL for later resumes. * `boat extend <id> --hours 12`: the sandbox stops 12 hours from now. * `--hours` and `--ttl` set the remaining time. They do not add to it. * `PATCH /sandboxes/{id}` with `ttlSeconds` does the same. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat extend bx_f7k2q9hd --hours 12 boat info bx_f7k2q9hd # archiveAfter is now 12 hours from now boat extend bx_f7k2q9hd --ttl 2592000 ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PATCH "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"ttlSeconds":43200}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.update({ sandboxId: "bx_f7k2q9hd", ttlSeconds: 12 * 60 * 60, }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.update("bx_f7k2q9hd", UpdateSandboxRequest(ttl_seconds=12 * 60 * 60)) ``` * `2592000` seconds is 30 days. * 30 days is the maximum numeric TTL that the boat API accepts. * boat caps larger values to 30 days. # Background commands Source: https://docs.boat.dev/long-running-tasks/background-commands Run a long command or a server in the background with --detach, read its output, attach to it, and stop it. A synchronous command stops at its `timeoutSeconds` limit. The default is 30 seconds. The maximum is 600 seconds (10 minutes). For a longer job or a server that does not end, start the command detached, then poll for its result. Examples are builds, installs, data processing and dev servers. A long job that you want to wait for needs no polling: * CLI: `boat exec <id> --timeout 0 -- <command>` runs it detached, prints its output live until it ends, and exits with its exit code. * SDK: `run_command` ([Python](/sdks/python#run-a-command-with-no-time-limit)) and `runCommand` ([TypeScript](/sdks/typescript#run-a-command-with-no-time-limit)) do the same and yield the output. * API: start the command with `detached: true`, then [attach](#attach-to-a-background-process) to it. This replaces the `nohup ... &` pattern for simple cases. You do not keep an SSH session open. You do not write a unit file. The flow is: start, then poll, then collect. ## Start a command and read its status ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} pid="$(boat exec bx_f7k2q9hd --detach "npm run build" | jq -r .processId)" boat exec bx_f7k2q9hd --status "$pid" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/$BOAT_ID/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"npm run build","detached":true}' # {"type":"command.started","processId":1234,"pid":1234,"logPath":"/home/user/.ascii/processes/1234.log",...} curl -sS "$BOAT_API_BASE/sandboxes/$BOAT_ID/commands/1234" \ -H "Authorization: Bearer $BOAT_API_KEY" # {"type":"command.status","running":false,"exitCode":0,"stdout":"...","stderr":"...",...} ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const started = await sandbox.command({ sandboxId, command: "npm run build", detached: true, }); const status = await sandbox.commandStatus({ sandboxId, processId: started.processId }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.command_request import CommandRequest started = sandbox.command(sandbox_id, CommandRequest(command="npm run build", detached=True)) status = sandbox.command_status(sandbox_id, started.process_id) ``` * The command continues on the sandbox after the start call returns. * boat appends stdout and stderr to `~/.ascii/processes/<pid>.log` on the sandbox. The folder keeps an older internal name. * The status call gives `running`, the `exitCode` when the command ends, and the last part of each log. ## Read only new output 1. Give `stdoutOffset` and `stderrOffset` to the status call. Start at 0. 2. The answer holds only the output written after those byte offsets. 3. The answer also holds `stdoutNextOffset` and `stderrNextOffset`. Use them in the next call. 4. When `more` is `true`, call again immediately. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} # The CLI follows for you: see Attach below. boat exec bx_f7k2q9hd --attach "$pid" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/sandboxes/$BOAT_ID/commands/1234?stdoutOffset=0&stderrOffset=0" \ -H "Authorization: Bearer $BOAT_API_KEY" # {"type":"command.status","running":true,"stdout":"compiling...\n","stdoutNextOffset":13,"stderrNextOffset":0,"more":false,...} ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} let stdoutOffset = 0, stderrOffset = 0; for (;;) { const r: any = await sandbox.commandStatus({ sandboxId, processId: started.processId, stdoutOffset, stderrOffset }); process.stdout.write(r.stdout); process.stderr.write(r.stderr); stdoutOffset = r.stdoutNextOffset; stderrOffset = r.stderrNextOffset; if (!r.running && !r.more) break; if (!r.more) await new Promise((ok) => setTimeout(ok, 1000)); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import sys, time out_offset = err_offset = 0 while True: r = sandbox.command_status(sandbox_id, started.process_id, stdout_offset=out_offset, stderr_offset=err_offset) sys.stdout.write(r.stdout) sys.stderr.write(r.stderr) out_offset, err_offset = r.stdout_next_offset, r.stderr_next_offset if not r.running and not r.more: break if not r.more: time.sleep(1) ``` ## Attach to a background process Attach opens one stream. The stream sends the output while the command writes it, until the command ends. Use attach instead of polling. The API allows 10,000 requests in 60 seconds per IP address. A stream counts once, when it opens, however long it stays open. Polling each of many processes every second reaches the limit. One open stream per process does not. Each line of the stream is one JSON object: | Line | When | | - | - | | `attached` | First. | | `stdout` / `stderr` | Each chunk of output, with its `nextOffset`. | | `heartbeat` | After 15 seconds with no output. | | `reconnect` | After 10 minutes. The stream ends. The line holds `stdoutOffset` and `stderrOffset`. | | `exit` | Last. It holds the exit code. | After a `reconnect` line, open the stream again with those offsets. You get no gap and no repeat, for as long as the command runs. The CLI reconnects for you. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_f7k2q9hd --attach "$pid" # prints the output from its start, then exits with the command's exit code ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sSN "$BOAT_API_BASE/sandboxes/$BOAT_ID/commands/1234/stream?stdoutOffset=0&stderrOffset=0" \ -H "Authorization: Bearer $BOAT_API_KEY" # {"type":"attached","processId":1234,"stdoutOffset":0,"stderrOffset":0} # {"type":"stdout","data":"compiling...\n","nextOffset":13} # {"type":"exit","status":"exited","exitCode":0,"signal":null,"stdoutOffset":13,"stderrOffset":0} ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} let offsets = { stdout: 0, stderr: 0 }; for (let done = false; !done; ) { const res = await fetch(`${BOAT_API_BASE}/sandboxes/${sandboxId}/commands/${pid}/stream?stdoutOffset=${offsets.stdout}&stderrOffset=${offsets.stderr}`, { headers: { Authorization: `Bearer ${BOAT_API_KEY}` } }); const lines = res.body!.pipeThrough(new TextDecoderStream()); let buf = ""; for await (const chunk of lines) { buf += chunk; let i; while ((i = buf.indexOf("\n")) >= 0) { const f = JSON.parse(buf.slice(0, i)); buf = buf.slice(i + 1); if (f.type === "stdout" || f.type === "stderr") { process[f.type].write(f.data); offsets[f.type] = f.nextOffset; } if (f.type === "reconnect") offsets = { stdout: f.stdoutOffset, stderr: f.stderrOffset }; if (f.type === "exit" || f.type === "error") done = true; } } } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import json, sys, requests offsets = {"stdout": 0, "stderr": 0} done = False while not done: url = f"{BOAT_API_BASE}/sandboxes/{sandbox_id}/commands/{pid}/stream" params = {"stdoutOffset": offsets["stdout"], "stderrOffset": offsets["stderr"]} with requests.get(url, params=params, headers={"Authorization": f"Bearer {BOAT_API_KEY}"}, stream=True) as r: for line in r.iter_lines(): if not line: continue f = json.loads(line) if f["type"] in ("stdout", "stderr"): getattr(sys, f["type"]).write(f["data"]) offsets[f["type"]] = f["nextOffset"] elif f["type"] == "reconnect": offsets = {"stdout": f["stdoutOffset"], "stderr": f["stderrOffset"]} elif f["type"] in ("exit", "error"): done = True ``` Polling and attach both read the sandbox live. Thus the sandbox must run. * A sandbox on an older agent answers `409 agent_outdated` until its next agent upgrade. * To read output after the sandbox stops, use the [command history](/long-running-tasks/command-history). ## Stop a background command Stop the command by its process id. This also stops every process that the command started. 1. boat sends `SIGTERM` to the whole process group. 2. After 5 seconds, boat sends `SIGKILL` to the processes that remain. 3. The response holds the [history record](/long-running-tasks/command-history) of the command, with status `killed` and its last output. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_f7k2q9hd --kill "$pid" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X DELETE "$BOAT_API_BASE/sandboxes/$BOAT_ID/commands/1234" \ -H "Authorization: Bearer $BOAT_API_KEY" # {"type":"command.stopped","processId":1234,"running":false,"signaled":true,"command":{"commandId":"cmd_...","status":"killed",...}} ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.stopCommand({ sandboxId, processId: started.processId }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.stop_command(sandbox_id, started.process_id) ``` ## When the agent restarts The process runs under the systemd user manager of the sandbox user. Thus a restart of the agent of the sandbox does not interrupt it. A platform upgrade is an example of such a restart. The agent keeps a record of each process on disk. After a restart the status still shows the command, its directory and whether it runs: * A process that ends before the restart keeps its `exitCode`. * A process that runs during the restart shows `exited` with `exitCode` `null` when it ends. * A process started by an agent older than the record shows `lost`, and `running` is a best-effort check. Detached processes do not continue after a stop, resume or fork. For a process that must come back by itself, run it as an [always-on service](/long-running-tasks/always-on-services). ## Timeouts and retries Synchronous commands accept `timeoutSeconds` from 1 to 600. The default is 30. boat refuses values outside that range with a 400 `invalid_timeout` error. boat never retries a command call automatically. A command is not idempotent. After a timeout (`retryable: false`) or a network failure during the call, the command can already run on the sandbox. You decide what to do next. # Command history and logs Source: https://docs.boat.dev/long-running-tasks/command-history Read the logs and output of past commands and processes in a sandbox, also when the sandbox is stopped, and list the processes. boat keeps the output of the processes in a sandbox. You can read it while the sandbox is stopped. A sandbox created with [monitoring off](/data-retention/snapshots-and-monitoring-off#monitoring-off) has no history. In the dashboard, open the **⋯** menu of a sandbox and select **History**. A background command that runs shows its output live. You can stop it there. ## What boat keeps | Source | Mode | Kept for | | - | - | - | | A command you run through `boat exec` or the commands endpoint | `sync`, `stream` or `detached` | 90 days | | Any other process that writes output: an `ssh` session, a systemd service, a docker container, a process that an agent starts | `process` | 72 hours | The start answer of each command holds the `commandId` of its record. | Kept | Details | | - | - | | The command | Its text (first 64 KiB), working directory, mode, process id | | The result | `status` (`running`, `exited`, `timed_out`, `failed`, `killed`, `lost`), exit code, signal, start and end time | | The output | stdout and stderr, compressed. A waiting command keeps up to 8 MiB per stream, the same as its answer. A streamed command adds output every 2 seconds. A detached command adds output every 30 seconds, and one more time when the sandbox stops. | ## Read the history 1. List the history. 2. Read the output of one command. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat history bx_f7k2q9hd # cmd_k3v9x2mq7tbw exit 0 detached 2026-10-09 14:02:11 npm run build boat history bx_f7k2q9hd cmd_k3v9x2mq7tbw # stdout boat history bx_f7k2q9hd cmd_k3v9x2mq7tbw --stderr boat history bx_f7k2q9hd cmd_k3v9x2mq7tbw --follow # until it ends boat history bx_f7k2q9hd --mode commands # only what you ran boat history bx_f7k2q9hd --mode process # only the other processes ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/sandboxes/$BOAT_ID/command-history?limit=20&mode=commands" \ -H "Authorization: Bearer $BOAT_API_KEY" # {"type":"command.list","commands":[{"commandId":"cmd_k3v9x2mq7tbw","status":"exited","exitCode":0,...}],"nextCursor":null} curl -sS "$BOAT_API_BASE/sandboxes/$BOAT_ID/command-history/cmd_k3v9x2mq7tbw/logs?stream=stdout&offset=0" \ -H "Authorization: Bearer $BOAT_API_KEY" # {"type":"command.logs","offset":0,"nextOffset":1830,"size":1830,"data":"...","done":true} ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { commands } = await sandbox.commandHistory({ sandboxId, limit: 20, mode: "commands" }); let offset = 0; for (;;) { const page = await sandbox.commandLogs({ sandboxId, commandId: commands[0].commandId, stream: "stdout", offset }); process.stdout.write(page.data); offset = page.nextOffset; if (page.done) break; if (!page.data) await new Promise((r) => setTimeout(r, 2000)); // still running } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import sys, time page = sandbox.command_history(sandbox_id, limit=20, mode="commands") command_id = page.commands[0].command_id offset = 0 while True: logs = sandbox.command_logs(sandbox_id, command_id, stream="stdout", offset=offset) sys.stdout.write(logs.data) offset = logs.next_offset if logs.done: break if not logs.data: time.sleep(2) # still running ``` * Each read gives at most 1 MiB. * Read again from `nextOffset` until `done` is `true`. * To get the exact bytes of binary output, pass `encoding=base64`. > [!NOTE] > > An account keeps at most 10 MiB of compressed command output per hour. This is about 50 MiB of plain text. boat drops the output past that, and the command shows `outputTruncated: true`. ## Every process in the sandbox boat records what each process writes to its terminal, to a pipe, or to a socket such as the journal. You do not change your programs for this. Each process is one `process` record, with its command line, its process id and its exit code. | Rule | Details | | - | - | | Rate | Up to 64 KiB/s per process, with bursts up to 1 MiB. Output past that is dropped and the record shows `outputTruncated: true`. | | Account cap | 10 MiB of compressed process output per hour, separate from the command cap. Output past that is dropped and the record shows `outputTruncated: true`. | | Not recorded | Writes to regular files and to `/dev/null`, binary output, and the services that boat itself runs in the sandbox. | | Delay | New output appears within about 30 seconds. Output still on the sandbox when it stops is saved before the stop. | boat records a command that you run through `boat exec` one time, as a command. Its child processes do not show again as `process` records. > [!TIP] > > A busy sandbox has many short processes, such as shell prompts and login scripts. To see only what you ran, use `--mode commands` (`mode=commands` in the API). To see only the other processes, use `--mode process`. ## Retention and deletion The history is account data, the same as your sandbox files. * When you delete the sandbox, boat deletes its history. * With [zero data retention](/data-retention/zero-data-retention#enable-zero-data-retention), a stop queues the history for deletion with the rest of the sandbox. ## List processes List every process in a sandbox, the busiest first. A stopped sandbox answers with the last sample that boat kept, and `live: false`. boat takes the 12 busiest processes every 30 seconds and keeps them for 7 days. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ps bx_f7k2q9hd # PID CPU% MEM MB USER HISTORY COMMAND # 2210 98.0 812.4 user cmd_k3v9x2mq7tbw node build.js ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/sandboxes/$BOAT_ID/processes" \ -H "Authorization: Bearer $BOAT_API_KEY" # {"type":"process.list","live":true,"total":64,"processes":[{"pid":2210,"user":"user","cpuPercent":98,"memoryMB":812.4,"command":"node build.js",...}]} ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { live, processes } = await sandbox.processes({ sandboxId }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} listing = sandbox.processes(sandbox_id) ``` On a running sandbox, each process with a history record shows its `commandId` in the HISTORY column. To read its output, run `boat history <sandbox> <commandId>`. # Sandbox sizes: CPU, memory, disk Source: https://docs.boat.dev/machines The four sandbox sizes with their vCPU, RAM, disk and price per hour, how to pick one, and what every sandbox can do: root, Docker, systemd, no GPU. Pick a size with `--type` when you create a sandbox. Without `--type`, you get `default` (the medium size). | Size | Per hour | CPU | RAM | Disk | | - | - | - | - | - | | `small` | **\$0.018** | 2 vCPU | 4 GB | 51 GB | | `default` | **\$0.036** | 4 vCPU | 8 GB | 51 GB | | `large` | **\$0.072** | 8 vCPU | 16 GB | 111 GB | | `xlarge` \* | **\$0.200** | 16 vCPU | 32 GB | 251 GB | ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --type large ``` * `large` needs your first payment. The [free trial](/free-trial) cannot use it. * \* `xlarge` needs the \$100 plan or higher. You do not need to contact us. Normal compute rates and account limits apply. * These four sizes are the only sizes. boat has no custom size and no size above `xlarge`. * "Disk" is the maximum size of your own files. The operating system and the pre-installed tools are not in it. Run `df -h /` in a sandbox to see the live figure. * All sizes are x86_64. No size has a GPU. * For sandboxes at once and start limits per plan, see [Limits and errors](/limits). * The dashboard Sandboxes page shows the size of each sandbox in the **Type** column. Filter by size with **Type**. The API returns it as `type`. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new boat new --type small boat new --type large ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "https://boat.dev/api/v1/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"type":"large","ttlSeconds":3600}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const created = await sandbox.create({ type: "large", ttlSeconds: 3600 }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.create_sandbox_request import CreateSandboxRequest created = sandbox.create(create_sandbox_request=CreateSandboxRequest(type="large", ttl_seconds=3600)) ``` Stop, resume and fork keep the size. A fork gets the size of its source sandbox. To change the size, stop the sandbox, then resume it with `--type`. Read [Change size](/machines/change-size). ## What every sandbox has Each sandbox is a full Linux virtual machine with its own kernel. | | | | - | - | | OS | Ubuntu 24.04 LTS, Linux 6.8, x86_64. Read [Base image and pre-installed tools](/machines/tools). | | Root and sudo | The user is `user`. Passwordless `sudo` gives full root. | | Services | Real `systemd`: services, timers, `journalctl` | | Containers | Docker with BuildKit and Compose, on the sandbox's own kernel. `user` runs `docker` without `sudo`. | | Network | Public IPv4 or IPv6 plus outbound internet. Expose ports with a [public URL](/hosting). | | GPU | None. Graphics run on the CPU. The [desktop](/desktop-streaming) and headless Chrome work. | | Nested virtualization | `/dev/kvm` on every sandbox. Read [Virtualization](/machines/virtualization). | ## Learn more > [card] [Base image and pre-installed tools](/machines/tools) > > Languages, coding agents, Docker and utilities, with their versions. > [card] [Change size](/machines/change-size) > > Stop the sandbox, then resume it with a bigger or smaller size. > [card] [Virtualization](/machines/virtualization) > > Run KVM, Firecracker or the Android emulator in a sandbox. > [card] [Fail fast when no machine is free](/machines/fail-fast) > > Get an answer in about 1.5 seconds when no machine of your size is ready. ## Related * [Desktop streaming](/desktop-streaming) * [Public URLs](/hosting) * [SSH access](/ssh-access) # Change size Source: https://docs.boat.dev/machines/change-size Move a sandbox to a bigger or smaller size: stop it, then resume it with --type. Or fork it to a new size. A running sandbox cannot change size. Stop it first, then resume it with the new size. 1. Stop the sandbox: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat stop bx_23456789 ``` 2. Wait until `boat info bx_23456789` shows the state `stopped`. The API reports a stopped sandbox as `archived`. 3. Resume it with the new size: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat resume bx_23456789 --type large ``` A resume with `--type` on a running sandbox fails with `409 sandbox_running_stop_first`. Nothing changes. To get a copy at a new size and keep the source running, fork it: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat fork bx_23456789 --type small ``` | Command | What changes | | - | - | | `resume --type` | The stopped sandbox itself gets the new size. | | `fork --type` | The copy gets the new size. The source sandbox does not change. | Resume and fork already restore a snapshot onto a new machine. So a size change costs nothing more than the resume or fork itself. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat stop bx_23456789 until [ "$(boat info bx_23456789 --json | jq -r .sandbox.state)" = "stopped" ]; do sleep 2; done boat resume bx_23456789 --type large ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST https://boat.dev/api/v1/sandboxes/bx_23456789/stop \ -H "Authorization: Bearer $BOAT_API_KEY" # poll GET /sandboxes/bx_23456789 until state is "archived", then: curl -sS -X POST https://boat.dev/api/v1/sandboxes/bx_23456789/resume \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"type":"large"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.stop({ sandboxId: "bx_23456789" }); // poll sandbox.get({ sandboxId }) until state is "archived", then: await sandbox.resume({ sandboxId: "bx_23456789", type: "large" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.resume_request import ResumeRequest sandbox.stop("bx_23456789") # poll sandbox.get("bx_23456789") until state is "archived", then: sandbox.resume("bx_23456789", resume_request=ResumeRequest(type="large")) ``` ## Grow and shrink * A move to a bigger size always works. * `large` needs your first payment. `xlarge` needs the \$100 plan or higher. * A move to a smaller size fails with `type_too_small` when the sandbox holds more data than the smaller size can take. * After a refused move, the sandbox stays exactly as it was. You do not lose the sandbox. * To shrink past that limit, delete data. Then let the sandbox make a new snapshot, and try again. ## Cost A bigger size costs more per hour. The price per hour in [Sandbox sizes](/machines) is the full price. # Fail fast when no machine is free Source: https://docs.boat.dev/machines/fail-fast Get an answer in about 1.5 seconds when no machine of your size is ready, and fall back right away. About machine availability, not setup failures. > [!NOTE] > > This page is about machine availability. To stop when your setup script fails, read [Fail when setup fails](/setup#fail-when-setup-fails). These four calls put the sandbox on a machine that is already running and waiting: * Create a sandbox. * Deploy from a saved snapshot. * Fork. * Resume. They usually get a machine in less than one second. A burst can use all the ready machines of one size. Then the next calls wait while boat builds new machines. ## Use fail fast If you prefer to fall back to something else instead of waiting, pass `failFast` to any of these calls. The call then answers in about 1.5 seconds with one of two results: | Result | What it means | | - | - | | `202` | The usual answer. The sandbox is on a machine that was ready. | | `503` `no_ready_machine` | Nothing started. See below. | When you get `503` `no_ready_machine`: * boat does not create a sandbox or a fork. A resumed sandbox stays stopped. * You pay nothing. * The attempt does not count against your [start limits](/limits). * Retry, or fall back, immediately. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --fail-fast --type large boat new --fail-fast --from ci-runner boat fork --fail-fast bx_23456789 boat resume --fail-fast bx_23456789 ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "https://boat.dev/api/v1/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"failFast":true,"from":"ci-runner"}' # same field on POST /sandboxes/{id}/fork and /sandboxes/{id}/resume ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} try { const created = await sandbox.create({ failFast: true, from: "ci-runner" }); // also: sandbox.fork({ sandboxId, failFast: true }), sandbox.resume({ sandboxId, failFast: true }) } catch (error) { // 503 no_ready_machine: nothing was started; fall back or retry. } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.exceptions import ApiException from boat_sdk.models.create_sandbox_request import CreateSandboxRequest try: created = sandbox.create(create_sandbox_request=CreateSandboxRequest(fail_fast=True, var_from="ci-runner")) except ApiException as error: # 503 no_ready_machine: nothing was started; fall back or retry. pass ``` # Base image and pre-installed tools Source: https://docs.boat.dev/machines/tools The OS image of every sandbox and the versions of its languages, Docker, coding agents and utilities. Root access and how to install more. Every sandbox starts from the same base image: Ubuntu 24.04 LTS, Linux 6.8, x86_64. The tools below are ready when you first connect. ## Root and sudo * You work as the user `user`, in `/home/user`. * Passwordless `sudo` gives full root. Install more with `sudo apt-get install -y <package>`. * To keep what you install for new sandboxes, save a [saved snapshot](/snapshots/templates). Read [Environment, setup script or saved snapshot?](/environments/choose). ## Languages and runtimes Versions measured on a new sandbox on 2026-10-13. Run `<tool> --version` in your sandbox for the live value. | Tool | Version | Notes | | - | - | - | | `node` / `npm` / `nvm` | Node.js 24.18 | Default. nvm also has Node 22. The apt Node.js 20 stays for compatibility. | | `bun` / `bunx` | 1.3.14 | | | `deno` | 2.9.4 | | | `pnpm` | 10.34.5 | | | `python3` / `pip` / `venv` | Python 3.12.3 | Ubuntu's Python | | `uv` | 0.12.0 | | | `go` | 1.23.4 | | | `rustc` / `cargo` / `rustup` | 1.97.1 | Stable toolchain | | `java` / `mvn` / `gradle` | OpenJDK 11.0.31, Maven 3.8.7, Gradle 8.12 | Install JDK 17 or 21 with `apt-get` if you need it | | `kotlin` / `kotlinc` | 2.1.0 | | | `scala` / `scalac` / `sbt` | Scala 3.3.8, sbt 1.13.0 | | | `ruby` / `gem` / `bundle` | 4.0.1 | | | `php` / `composer` | PHP 8.4.24 | | | `erl` / `elixir` | Erlang/OTP 25, Elixir 1.14.0 | | | `dotnet` | .NET SDK 8.0.129 | | | `R` | 4.6.1 | | | `gcc` / `g++` / `clang` / `cmake` / `ninja` | GCC 13.3, Clang 18.1.3, CMake 3.31.3 | | ## Docker | Tool | Version | | - | - | | `docker` | Docker 29.7.0 with BuildKit | | `docker compose` | Compose 5.3.1 | * `user` runs `docker` without `sudo`. * Docker can start a few seconds after the sandbox is `ready`. Wait for it in scripts: `until docker info >/dev/null 2>&1; do sleep 1; done`. * The layer cache is per machine. Read [Docker builds across resume and fork](/snapshots/whats-saved#docker-builds). ## Coding agents boat updates these to their latest release when it prepares each machine. Run `<tool> --version` for the exact version. | Tool | Description | | - | - | | `claude` | Claude Code CLI | | `codex` | OpenAI Codex CLI | | `pi` | Pi coding agent ([pi.dev](https://pi.dev)) | | `opencode` | OpenCode terminal coding agent | | `hermes` | Hermes Agent by Nous Research. Browser tools are not pre-installed: `hermes` offers to add them. | | `openclaw` | OpenClaw CLI. The gateway does not start by itself: run `openclaw gateway`. | | `agent` / `cursor-agent` | Cursor CLI agent | | `prime-agent` | Prime Intellect's Prime Agent | | `kimi` | Kimi Code CLI by Moonshot AI | | `vibe` | Mistral Vibe by Mistral AI (`--provider mistral`) | | `host` | Expose localhost services to the internet | | `lux` | Desktop and browser automation with demo recording | | `boat` | boat CLI inside the sandbox | * These tools are installed system-wide, in `/usr/local` and `/opt`. * They take no space in your snapshots. They come back after a stop and resume. * Each harness signs in with its own `login` command. * `boat prompt` and the Agents & Proxying tab drive seven of them. Read [Harnesses and models](/integrated-agents/harnesses-and-models). * You can install your own copy, for example with `npm i -g` or the vendor installer into `~/.local/bin`. Your copy hides the pre-installed one. Your snapshots keep it as usual. ## Version control | Tool | Version | | - | - | | `git` | 2.43.0. Install a newer one if your CI actions need it. | | `gh` | 2.97.0 | ## Utilities | Tool | Version | | - | - | | `rg` (ripgrep) | 14.1.0 | | `jq` | 1.7 | | `curl` | Ubuntu 24.04 package | | `google-chrome-stable` | Chrome 151 | | `ffmpeg` | 6.1.1 | | `xdotool`, `wmctrl` | Ubuntu 24.04 packages | ## Defaults that affect CI jobs | Setting | Value | What to do | | - | - | - | | `LANG` and `LC_ALL` | `en_US.UTF-8` | `sort` orders lines differently from a `C.UTF-8` machine. To match one, set `LC_ALL=C.UTF-8` in your job. | | `git` | 2.43 | If your CI actions need a newer version, install it. | # Virtualization: KVM, Firecracker, Android Source: https://docs.boat.dev/machines/virtualization Nested virtualization in a sandbox: every sandbox has /dev/kvm, so QEMU/KVM, Firecracker and the Android emulator run at full speed. Every sandbox has nested virtualization. `/dev/kvm` is there, so QEMU/KVM, Firecracker and the Android emulator run at full speed. You do not need a flag or a permission. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec <id> 'test -e /dev/kvm && echo "KVM available"' ``` ## Where your sandbox runs Every sandbox runs as a full virtual machine on a physical host dedicated to boat. The fleet includes AMD Ryzen 7 9700X and Ryzen 9 9950X hosts. Sandboxes on the same host share CPU time. A sandbox's vCPUs are not dedicated physical cores. CPU virtualization extensions are passed through, and each sandbox has its own kernel. ## Run the Android emulator This script runs a headless Android emulator. Use `default` or bigger: the emulator needs about 3 GB of RAM. We tested it on a `large` sandbox. * The install takes about one minute. * Android 14 then boots in 20 to 30 seconds. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sudo apt-get install -y openjdk-17-jre-headless export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64 ANDROID_HOME=$HOME/android mkdir -p $ANDROID_HOME/cmdline-tools && cd /tmp curl -fsSLo clt.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip unzip -q clt.zip -d $ANDROID_HOME/cmdline-tools && mv $ANDROID_HOME/cmdline-tools/cmdline-tools $ANDROID_HOME/cmdline-tools/latest SDK=$ANDROID_HOME/cmdline-tools/latest/bin yes | $SDK/sdkmanager --licenses >/dev/null $SDK/sdkmanager "platform-tools" "emulator" "system-images;android-34;google_apis;x86_64" echo no | $SDK/avdmanager create avd -n phone -k "system-images;android-34;google_apis;x86_64" -d pixel_6 if [ ! -e /dev/kvm ]; then echo "No KVM on this sandbox: the Android emulator cannot start here." >&2 else $ANDROID_HOME/emulator/emulator -avd phone -no-window -no-audio -gpu swiftshader_indirect & $ANDROID_HOME/platform-tools/adb wait-for-device fi ``` To take a screenshot, run `adb exec-out screencap -p > screen.png`. # Migrating from Box Source: https://docs.boat.dev/migrating-from-box Box is now boat, and a box is now a sandbox. Old Box API paths, keys, CLI, SDK packages and hosted URLs still work. What to change and how to know you are done. Box became **boat** on September 15, 2026. The product, the account, the machines and the data stay the same. Two words replace the word "box": | Word | Meaning | | - | - | | **boat** | The product: the site, the CLI, the API, your account and your plan. | | **sandbox** | What you create in boat. It was a "box" before. Paths, keys, events and error codes say `sandbox`. | Your existing Box endpoints, CLI integrations, SDK packages, environment variables and hosted URLs still work. boat has not decided the retirement policy yet. The Sunset header is a migration warning only. It is not a shutdown that boat has implemented. It is also not a promise of permanent support. ## Timeline | Date | What happens | | - | - | | **2026-09-15** | boat ships. Box surfaces keep working. They now answer with `Deprecation` and `Sunset` headers. The `box` CLI prints a reminder at each run. | | **2026-10-31** | The Sunset date that boat shows now. boat has not decided if or when legacy endpoints, binaries, packages or hosted URLs retire. The rename adds no shutdown on a date. | ## The rename in one table | | Box (legacy compatibility) | boat | | - | - | - | | Dashboard | `box.ascii.dev/box/dashboard` | [`boat.dev/dashboard`](https://boat.dev/dashboard) | | Docs | `docs.ascii.dev/box/<page>` | `docs.boat.dev/<page>` (every old URL redirects) | | API base | `https://ascii.dev/api/box/v1` | `https://boat.dev/api/v1` | | Resource paths | `/boxes/{boxId}` | `/sandboxes/{sandboxId}` | | JSON keys | 14 keys, every one listed in [Every renamed name](/migrating-from-box/renamed-names#json-keys) | the same 14 with `sandbox` in place of `box` | | Envelope `type` | 13 values, [all listed](/migrating-from-box/renamed-names#envelope-type-values) | `sandbox.` in place of `box.` | | Error codes | 17 codes, [all listed](/migrating-from-box/renamed-names#error-code-values) | `sandbox_` in place of `box_` | | Webhook events | 6 events: `box.ready`, `box.error`, `box.archived`, `box.hydrated`, `box.degraded`, `box.recovered` | `sandbox.` in place of `box.` | | API keys | `box_...` | `boat_...` (keys you already have stay valid) | | Org header | `X-Box-Org` | `X-Boat-Org` | | CLI | `box`, `box-dev` | `boat`, `boat-dev` | | CLI env vars | 20 variables, [all listed](/migrating-from-box/renamed-names#cli-environment-variables) | `BOAT_` in place of `BOX_` | | CLI config | `~/.config/ascii/box/config.json` | `~/.config/ascii/boat/config.json` | | Snapshot ignore file | `.boxignore` | `.boatignore` | | Hosted URLs | `https://<label>.on.ascii.dev` | `https://<label>.on.boat.dev` (same route, same token, both answer) | | Inside a sandbox | `box` CLI, `BOX_ID`, `BOX_CURRENT_ID` | `boat` CLI, `BOAT_ID`, `BOAT_CURRENT_ID` (both spellings exported) | | Python SDK | `ascii-box-sdk` / `ascii_box_sdk` | `boat-sdk` / `boat_sdk` | | TypeScript SDK | `@asciidev/box-sdk` | `@boatdev/sdk` | | Other languages | `ascii_box_sdk`, `github.com/ascii-dev/box-go-sdk` | No boat package yet. Generate a client from [`/openapi/boat-v1.yaml`](/openapi/boat-v1.yaml). | | Integrations | `harbor-box`, `@asciidev/eve-box` | Same packages. They still call the Box API. See [Harbor](/integrations/harbor) and [Eve](/integrations/eve). | These items do not change: * IDs (`bx_...`) and snapshot IDs. * The `X-Ascii-*` headers (`X-Ascii-Confirm-Delete` and the webhook headers) and `Idempotency-Key`. They are the current names. * `sandboxId` on API keys. It already said sandbox. * All of your data. ## Am I done? Check each item: * Your API client logs show no `Sunset` header. * Your scripts do not call a `box` binary. The reminder line no longer shows. * `pip show ascii-box-sdk` and `npm ls @asciidev/box-sdk` return nothing. * `GET /api/v1/webhooks` lists webhooks with `sandbox.*` events. * Your published links say `on.boat.dev`. ## Retirement policy boat currently keeps these legacy items: * The legacy API routes. * The binary and environment aliases. * The hosted addresses. The October 31 header does not cause a `410 Gone`. It does not disable installed clients. It does not remove DNS. boat must still make an explicit policy decision on the scope and time of a future retirement. This guide does not promise a shutdown on that date. It also does not promise permanent support. Questions: see [Support](/support). ## Learn more > [card] [Migration steps](/migrating-from-box/steps) > > What to change in the CLI, the SDKs, raw HTTP, webhooks, hosted URLs and inside a sandbox. > [card] [Every renamed name](/migrating-from-box/renamed-names) > > The full list of renamed paths, keys, types, codes, events, variables, headers and files. # Every renamed name Source: https://docs.boat.dev/migrating-from-box/renamed-names The full list of Box names that changed to boat: API paths, JSON keys, types, error codes, 6 webhook events, variables, headers, flags and files. This is the full list, read from the API specifications and the CLI source. It is not a sample. A name that is not in these tables did not change. ## API paths | Box | boat | | - | - | | `/boxes` | `/sandboxes` | | `/boxes/{boxId}` | `/sandboxes/{sandboxId}` | | `/boxes/{boxId}/stop` | `/sandboxes/{sandboxId}/stop` | | `/boxes/{boxId}/resume` | `/sandboxes/{sandboxId}/resume` | | `/boxes/{boxId}/fork` | `/sandboxes/{sandboxId}/fork` | | `/boxes/{boxId}/prompt` | `/sandboxes/{sandboxId}/prompt` | | `/boxes/{boxId}/events` | `/sandboxes/{sandboxId}/events` | | `/boxes/{boxId}/conversations` | `/sandboxes/{sandboxId}/conversations` | | `/boxes/{boxId}/prompts/{promptId}` | `/sandboxes/{sandboxId}/prompts/{promptId}` | | `/boxes/{boxId}/files` | `/sandboxes/{sandboxId}/files` | | `/boxes/{boxId}/commands` | `/sandboxes/{sandboxId}/commands` | | `/boxes/{boxId}/commands/{processId}` | `/sandboxes/{sandboxId}/commands/{processId}` | | `/boxes/{boxId}/artifacts` | `/sandboxes/{sandboxId}/artifacts` | | `/boxes/{boxId}/steer` | `/sandboxes/{sandboxId}/steer` | | `/boxes/{boxId}/interrupt` | `/sandboxes/{sandboxId}/interrupt` | | `/boxes/{boxId}/desktop` | `/sandboxes/{sandboxId}/desktop` | | `/boxes/{boxId}/host` | `/sandboxes/{sandboxId}/host` | | `/boxes/{boxId}/sshkey` | `/sandboxes/{sandboxId}/sshkey` | | `/boxes/{boxId}/snapshots` | `/sandboxes/{sandboxId}/snapshots` | | `/boxes/{boxId}/snapshots/latest` | `/sandboxes/{sandboxId}/snapshots/latest` | | `/boxes/{boxId}/usage` | `/sandboxes/{sandboxId}/usage` | ## JSON keys These keys change in requests and in responses. | Box | boat | | - | - | | `activeBoxes` | `activeSandboxes` | | `box` | `sandbox` | | `boxCount` | `sandboxCount` | | `boxId` | `sandboxId` | | `boxIds` | `sandboxIds` | | `boxLifecycle` | `sandboxLifecycle` | | `boxPlanDollars` | `sandboxPlanDollars` | | `boxPlanKey` | `sandboxPlanKey` | | `boxType` | `sandboxType` | | `boxes` | `sandboxes` | | `maxActiveBoxes` | `maxActiveSandboxes` | | `passBoxCredentials` | `passSandboxCredentials` | | `queuedBoxes` | `queuedSandboxes` | | `sourceBoxId` | `sourceSandboxId` | ## OpenAPI schema and SDK type names | Box | boat | | - | - | | `Box` | `Sandbox` | | `BoxActionResponse` | `SandboxActionResponse` | | `BoxBearerAuth` | `BoatBearerAuth` | | `BoxEnvironment` | `SandboxEnvironment` | | `BoxEnvironmentListResponse` | `SandboxEnvironmentListResponse` | | `BoxEnvironmentResponse` | `SandboxEnvironmentResponse` | | `BoxEnvironmentVersionSummary` | `SandboxEnvironmentVersionSummary` | | `BoxEvent` | `SandboxEvent` | | `BoxId` | `SandboxId` | | `BoxInfoResponse` | `SandboxInfoResponse` | | `BoxListResponse` | `SandboxListResponse` | | `BoxUsageResponse` | `SandboxUsageResponse` | | `CreateBoxEnvironmentRequest` | `CreateSandboxEnvironmentRequest` | | `CreateBoxRequest` | `CreateSandboxRequest` | | `CreateBoxResponse` | `CreateSandboxResponse` | | `UpdateBoxEnvironmentRequest` | `UpdateSandboxEnvironmentRequest` | | `UpdateBoxRequest` | `UpdateSandboxRequest` | | `UpgradeBoxEnvironmentRequest` | `UpgradeSandboxEnvironmentRequest` | | `UpgradeBoxEnvironmentResponse` | `UpgradeSandboxEnvironmentResponse` | ## OpenAPI operation IDs and SDK method names | Box | boat | | - | - | | `boxes` | `sandboxes` | | `deleteBox` | `deleteSandbox` | | `deliverBoxLifecycleEvent` | `deliverSandboxLifecycleEvent` | | `getLatestBoxSnapshot` | `getLatestSandboxSnapshot` | | `listBoxSnapshots` | `listSandboxSnapshots` | ## Envelope type values | Box | boat | | - | - | | `box.create` | `sandbox.create` | | `box.created` | `sandbox.created` | | `box.deleting` | `sandbox.deleting` | | `box.error` | `sandbox.error` | | `box.fork` | `sandbox.fork` | | `box.forking` | `sandbox.forking` | | `box.info` | `sandbox.info` | | `box.list` | `sandbox.list` | | `box.resume` | `sandbox.resume` | | `box.resuming` | `sandbox.resuming` | | `box.stopping` | `sandbox.stopping` | | `box.updated` | `sandbox.updated` | | `box.usage` | `sandbox.usage` | ## Error code values | Box | boat | | - | - | | `box_billing_not_configured` | `sandbox_billing_not_configured` | | `box_busy` | `sandbox_busy` | | `box_deletion_conflict` | `sandbox_deletion_conflict` | | `box_direct_failed` | `sandbox_direct_failed` | | `box_email_auth_not_configured` | `sandbox_email_auth_not_configured` | | `box_not_archivable` | `sandbox_not_archivable` | | `box_not_found` | `sandbox_not_found` | | `box_not_promptable` | `sandbox_not_promptable` | | `box_not_snapshotable` | `sandbox_not_snapshotable` | | `box_purge_pending` | `sandbox_purge_pending` | | `box_recent_snapshot_required` | `sandbox_recent_snapshot_required` | | `box_required` | `sandbox_required` | | `box_restoring` | `sandbox_restoring` | | `box_resuming` | `sandbox_resuming` | | `box_running_stop_first` | `sandbox_running_stop_first` | | `box_securing` | `sandbox_securing` | | `box_starting` | `sandbox_starting` | | `box_stopping` | `sandbox_stopping` | ## Webhook events | Box | boat | | - | - | | `box.archived` | `sandbox.archived` | | `box.degraded` | `sandbox.degraded` | | `box.error` | `sandbox.error` | | `box.hydrated` | `sandbox.hydrated` | | `box.ready` | `sandbox.ready` | | `box.recovered` | `sandbox.recovered` | ## CLI environment variables | Box | boat | | - | - | | `BOX_AMSTERDAM_API_URL` | `BOAT_AMSTERDAM_API_URL` | | `BOX_AMSTERDAM_CURRENT_ID` | `BOAT_AMSTERDAM_CURRENT_ID` | | `BOX_API_URL` | `BOAT_API_URL` | | `BOX_CURRENT_CONVO` | `BOAT_CURRENT_CONVO` | | `BOX_CURRENT_CONVO_FILE` | `BOAT_CURRENT_CONVO_FILE` | | `BOX_CURRENT_ID` | `BOAT_CURRENT_ID` | | `BOX_CURRENT_ID_FILE` | `BOAT_CURRENT_ID_FILE` | | `BOX_DASHBOARD_URL` | `BOAT_DASHBOARD_URL` | | `BOX_DEV_API_URL` | `BOAT_DEV_API_URL` | | `BOX_DEV_CURRENT_CONVO` | `BOAT_DEV_CURRENT_CONVO` | | `BOX_DEV_CURRENT_ID` | `BOAT_DEV_CURRENT_ID` | | `BOX_ID` | `BOAT_ID` | | `BOX_ORG` | `BOAT_ORG` | | `BOX_SCP_ARCHIVE` | `BOAT_SCP_ARCHIVE` | | `BOX_SCP_LEGACY` | `BOAT_SCP_LEGACY` | | `BOX_SCP_RSYNC` | `BOAT_SCP_RSYNC` | | `BOX_SSH_TRACE` | `BOAT_SSH_TRACE` | | `BOX_STAGING_API_URL` | `BOAT_STAGING_API_URL` | | `BOX_STAGING_CURRENT_CONVO` | `BOAT_STAGING_CURRENT_CONVO` | | `BOX_STAGING_CURRENT_ID` | `BOAT_STAGING_CURRENT_ID` | ## In-sandbox environment variables boat exports both spellings inside each sandbox. | Box | boat | | - | - | | `BOX_ID` | `BOAT_ID` | | `BOX_CURRENT_ID` | `BOAT_CURRENT_ID` | | `BOX_DEV_CURRENT_ID` | `BOAT_DEV_CURRENT_ID` | | `BOX_CLI_API_URL` | `BOAT_CLI_API_URL` | | `BOX_CLI_CHANNEL` | `BOAT_CLI_CHANNEL` | | `BOX_CLI_MODE` | `BOAT_CLI_MODE` | ## HTTP headers and query parameters | Box | boat | | - | - | | `X-Box-Org` | `X-Boat-Org` | | `?box_api_url=` (dashboard links) | `?boat_api_url=` | | `?box_bootstrap=` (post-login links) | `?boat_bootstrap=` | | `?box_token=` (deprecated before the rename) | `?boat_token=` | | `?tab=boxes` (dashboard) | `?tab=sandboxes` | ## CLI flags | Box | boat | | - | - | | `boat api-key create --box <id>` | `boat api-key create --sandbox <id>` | ## Files and directories | Box | boat | | - | - | | `.boxignore` | `.boatignore` | | `~/.config/ascii/box/config.json` | `~/.config/ascii/boat/config.json` | | `~/.config/ascii/box-dev/config.json` | `~/.config/ascii/boat-dev/config.json` | | `~/.ascii/bin/box` | `~/.ascii/bin/boat` | | agent skill `skills/box/SKILL.md` | `skills/boat/SKILL.md` | # Migration steps Source: https://docs.boat.dev/migrating-from-box/steps What to change to move from Box to boat: the CLI, the SDKs, raw HTTP, webhooks, hosted URLs and the inside of a sandbox. Do the steps that apply to you. For the full list of renamed names, read [Every renamed name](/migrating-from-box/renamed-names). ## 1. CLI Install the `boat` CLI: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -fsSL https://boat.dev/install | sh # macOS, Linux irm https://boat.dev/install.ps1 | iex # Windows ``` You stay signed in. `boat` reads the config that `box` wrote. Then do these steps: 1. In scripts and CI, replace `box` with `boat`. Subcommands do not change: `boat new`, `boat list`, `boat ssh`. 2. Rename `BOX_*` variables to `BOAT_*`. Now, if a `BOAT_*` variable is not set, boat uses its `BOX_*` twin. It then prints a one-line notice on stderr. 3. Rename `.boxignore` files to `.boatignore`. boat reads both files now. If a directory has both, `.boatignore` wins. 4. Change `boat api-key create --box bx_1` to `--sandbox bx_1`. The final compatibility release of `box` prints a migration reminder. Use `boat` to get later updates. No date check disables legacy binaries. ## 2. SDKs Replace the package: ```bash Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} pip uninstall ascii-box-sdk pip install boat-sdk ``` ```bash TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} npm uninstall @asciidev/box-sdk npm install @boatdev/sdk ``` Then change your code: | What | Box | boat | | - | - | - | | Import | `ascii_box_sdk`, `@asciidev/box-sdk` | `boat_sdk`, `@boatdev/sdk` | | Base URL | `https://ascii.dev/api/box/v1` | `https://boat.dev/api/v1` | | Client class (keeps the product name) | `BoxApi` (`ascii_box_sdk.api.box_api`) | `BoatApi` (`boat_sdk.api.boat_api`) | | Request and response types (say sandbox) | `CreateBoxRequest`, `Box`, `boxId`, `.box`, `.boxes`, `deleteBox` | `CreateSandboxRequest`, `Sandbox`, `sandboxId`, `.sandbox`, `.sandboxes`, `deleteSandbox` | The helpers keep their names: | SDK | Helpers | | - | - | | Python | `wait_until_ready`, `wait_until_idle`, `wait_for_desktop`, `wait_for_prompt`, `wait_for_prompt_done`, `stream_events`, `stream_prompt`, `stop_and_remove`, `read_text`, `write_text`, `exec_command`, `stream_command` | | TypeScript | `waitUntilReady`, `waitUntilIdle`, `waitForDesktop`, `waitForPrompt`, `waitForPromptDone`, `streamEvents`, `streamPrompt`, `stopAndRemove`, `readText`, `writeText`, `execCommand`, `streamCommand` | In Python, pass the request body by keyword: `boat.create(create_sandbox_request=CreateSandboxRequest(...))`. See [Python SDK](/sdks/python). To change the types and keys, do a whole-word search and replace: | Find | Replace with | | - | - | | `box` | `sandbox` | | `Box` | `Sandbox` | | `boxes` | `sandboxes` | | `Boxes` | `Sandboxes` | Then make two changes by hand: the package import, and `BoxApi` to `BoatApi`. ## 3. Raw HTTP ```diff theme={"theme":{"light":"github-light","dark":"github-dark-default"}} - POST https://ascii.dev/api/box/v1/boxes + POST https://boat.dev/api/v1/sandboxes - Authorization: Bearer box_... (still accepted) + Authorization: Bearer boat_... (what new keys look like) ``` Responses use the new words: `sandbox` / `sandboxes` / `sandboxId`, `type: "sandbox.created"`, `code: "sandbox_not_found"`. Request bodies also use the new keys, for example `passSandboxCredentials` and `sourceSandboxId`. A request to `/api/box/*` answers in box words now. It has these headers: ```http theme={"theme":{"light":"github-light","dark":"github-dark-default"}} Deprecation: @1789430400 Sunset: Sat, 31 Oct 2026 00:00:00 GMT Link: <https://docs.boat.dev/migrating-from-box>; rel="deprecation" ``` If your client logs response headers, search the logs for `Sunset`. Each match is a call that you did not move yet. ## 4. Webhooks Webhooks that you created before the rename still send `box.*` events with payloads that say `box`. Signatures, headers and retries do not change. To move a webhook: 1. Create it again through the boat API, or with `boat webhook create`. 2. Delete the old webhook. The new webhook sends `sandbox.*` events and `X-Ascii-Event: sandbox.ready`. There are 6 events: `ready`, `error`, `archived` (stopped), `hydrated`, `degraded` and `recovered`. ## 5. Hosted URLs Each hosted route answers on two addresses, with the same `_token`: * `https://<label>.on.ascii.dev` * `https://<label>.on.boat.dev` Update the links that you published or embedded to the `on.boat.dev` form. boat has not decided the retirement policy for the `on.ascii.dev` form. ## 6. Inside a sandbox * The `boat` CLI is on the PATH of each sandbox. `box` still points to it. * boat exports `BOAT_ID`, `BOAT_CURRENT_ID` and `BOAT_CLI_*` next to their `BOX_*` twins. * Agent skills use the `boat` skill. boat removes a `box` skill directory at the next start. # OpenTelemetry Source: https://docs.boat.dev/opentelemetry Send sandbox and account metrics, and sandbox lifecycle events, to Datadog, Grafana Cloud, Honeycomb, or any OTLP collector. No traces, no agent or AI token data. boat pushes your account's telemetry to one OTLP/HTTP endpoint that you choose. You do not install an agent in your sandboxes. | Signal | Path | When | | - | - | - | | Sandbox and account metrics | `<endpoint>/v1/metrics` | Every 60 seconds | | Sandbox lifecycle events, as OTLP log records | `<endpoint>/v1/logs` | When each event occurs | boat does not send these: | Not sent | Where to read it instead | | - | - | | Traces and spans | None. boat sends no traces. | | Agent prompts, responses and tool calls | [Agent events](/integrated-agents/conversations#stream-events) | | AI token usage | [`boat ai usage`](/ai-credentials#usage), for proxied sandboxes | | The output of commands and processes | [Command history and logs](/long-running-tasks/command-history) | To export telemetry from your own app in a sandbox, run your own OpenTelemetry SDK or collector in the sandbox. | | CLI | API | SDKs | | - | - | - | - | | Set or replace | `boat telemetry set <endpoint> -H key=value` | `PUT /telemetry` | `setTelemetry` | | Read status | `boat telemetry` | `GET /telemetry` | `getTelemetry` | | Remove | `boat telemetry unset` | `DELETE /telemetry` | `deleteTelemetry` | An account has one endpoint. The headers hold your vendor credentials. So the API needs a key with `account.admin`. ## Set the endpoint Use the **Webhooks & OTel** tab in the dashboard. You can also use the CLI, the API or an SDK. 1. Give the base URL of the collector. boat adds `/v1/metrics` and `/v1/logs`. 2. Give the headers that your vendor needs. Read [Vendor settings](#vendor-settings). If you paste a URL that ends in `/v1/metrics`, boat removes that part. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat telemetry set https://otlp.datadoghq.com -H dd-api-key=$DD_API_KEY # https://otlp.datadoghq.com # headers dd-api-key # last export - # Saved. Test export accepted. ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PUT "$BOAT_API_BASE/telemetry" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"endpoint":"https://otlp.datadoghq.com","headers":{"dd-api-key":"'"$DD_API_KEY"'"}}' # {"type":"telemetry.updated","telemetry":{"endpoint":"https://otlp.datadoghq.com","headers":["dd-api-key"],...},"test":{"ok":true,"status":202,"message":null}} ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const saved = await sandbox.setTelemetry({ endpoint: "https://otlp.datadoghq.com", headers: { "dd-api-key": process.env.DD_API_KEY! }, }); console.log(saved.test.ok, saved.test.status); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import os from boat_sdk.models.telemetry_set_request import TelemetrySetRequest saved = sandbox.set_telemetry(TelemetrySetRequest( endpoint="https://otlp.datadoghq.com", headers={"dd-api-key": os.environ["DD_API_KEY"]}, )) print(saved.test.ok, saved.test.status) ``` When you save, boat sends one empty metrics export immediately. boat returns the answer of the collector in `test`. So you see a wrong key or endpoint before you wait for data. The first metrics arrive within 60 seconds. > [!NOTE] > > * The endpoint must use HTTPS on port 443 or 4318. > * The endpoint must resolve only to public addresses. > * boat encrypts the header values at rest and never returns them. > * You can set up to 20 headers. ### Vendor settings | Vendor | Endpoint | Headers | | - | - | - | | Datadog | `https://otlp.datadoghq.com` (use the OTLP host of your Datadog site) | `dd-api-key=<API key>` | | Grafana Cloud | The OTLP endpoint on your stack's OpenTelemetry card, for example `https://otlp-gateway-prod-eu-west-2.grafana.net/otlp` | `Authorization=Basic <base64 of instanceId:token>` | | Honeycomb | `https://api.honeycomb.io` (EU: `https://api.eu1.honeycomb.io`) | `x-honeycomb-team=<API key>`, `x-honeycomb-dataset=boat` | | Your own OpenTelemetry Collector | `https://otel.example.com` (port 443 or 4318) | The auth header that your collector checks | For Grafana Cloud, make the header value like this: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} echo -n "$GRAFANA_INSTANCE_ID:$GRAFANA_TOKEN" | base64 ``` ### Your own collector and Prometheus 1. Run the OpenTelemetry Collector with an OTLP/HTTP receiver behind TLS. 2. Export to Prometheus with remote write, or expose a scrape endpoint: ```yaml otelcol.yaml theme={"theme":{"light":"github-light","dark":"github-dark-default"}} receivers: otlp: protocols: http: endpoint: 0.0.0.0:4318 exporters: prometheus: endpoint: 0.0.0.0:8889 debug: {} service: pipelines: metrics: { receivers: [otlp], exporters: [prometheus] } logs: { receivers: [otlp], exporters: [debug] } ``` Prometheus turns `boat.sandbox.cpu.utilization` into `boat_sandbox_cpu_utilization`, with `boat_sandbox_id` and `boat_sandbox_name` labels. ## Metrics * All metrics are gauges. * Every point has `boat.sandbox.id` and `boat.sandbox.name`. So each sandbox is its own series in every vendor. * A sandbox with [monitoring off](/data-retention/snapshots-and-monitoring-off#monitoring-off) sends no sandbox metrics. boat still sends its lifecycle events. | Metric | Unit | Meaning | | - | - | - | | `boat.sandbox.cpu.utilization` | `1` | Share of CPU time busy, 0 to 1 | | `boat.sandbox.memory.utilization` | `1` | Share of memory in use, 0 to 1 | | `boat.sandbox.memory.usage` | `By` | Memory in use | | `boat.sandbox.filesystem.utilization` | `1` | Share of the disk in use, 0 to 1 | | `boat.sandbox.filesystem.usage` | `By` | Disk space in use | | `boat.sandbox.io.pressure` | `1` | Share of time stalled on disk I/O, 0 to 1 | | `boat.account.sandboxes.active` | `{sandbox}` | Sandboxes running now | | `boat.account.sandboxes.limit` | `{sandbox}` | Sandboxes your plan lets run at once. Not sent on unlimited plans. | | `boat.account.credit.balance` | `s` | Machine time left on the account. Not sent on unlimited plans. | Each sandbox is one resource: | Resource attribute | Value | | - | - | | `service.name` | `boat` | | `service.instance.id`, `boat.sandbox.id` | The sandbox id | | `boat.sandbox.name` | The sandbox name | | `boat.sandbox.size` | The machine size | | `boat.sandbox.memory.size`, `boat.sandbox.disk.size` | Total memory and disk, in bytes | | `boat.account.id` | Your account id | A sandbox sends points only while it runs. Each export holds the samples taken since the previous one. ## Events Each [lifecycle event](/webhooks#events) is one OTLP log record. boat puts the event name in two places: the event name field of the record, and the `event.name` attribute. | Event name | Severity | | - | - | | `sandbox.ready` | `INFO` | | `sandbox.hydrated` | `INFO` | | `sandbox.error` | `ERROR` | | `sandbox.archived` | `INFO` | | `sandbox.degraded` | `WARN` | | `sandbox.recovered` | `INFO` | Each record has these attributes: | Attribute | Value | | - | - | | `boat.sandbox.id`, `boat.sandbox.name` | The sandbox | | `boat.sandbox.state`, `boat.sandbox.previous_state` | The new and the old state, when the event has them | | `boat.sandbox.reason` | Why, for `sandbox.degraded` and `sandbox.recovered` | | `boat.event.id` | The same id as the webhook event. Use it to remove duplicates. | ## Delivery and errors | Collector answer | What boat does | | - | - | | `2xx` | Done. A partial-success answer shows its message in `lastError`. | | `429`, `502`, `503`, `504`, or no answer | Sends the same data again later. boat waits for `Retry-After` when the collector sends it. | | Any other `4xx` or `5xx` | Drops that data and shows the error in `lastError`. Fix the key or the endpoint. boat sends the next window as usual. | * boat sends metrics in time order. * After an outage, boat sends at most the last 10 minutes of metrics. * boat retries an event like a [webhook delivery](/webhooks#delivery-and-retries), up to 8 attempts. To read the status, run: ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat telemetry # https://otlp.datadoghq.com # headers dd-api-key # last export 2026-10-09T12:00:10.000Z ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/telemetry" \ -H "Authorization: Bearer $BOAT_API_KEY" # {"type":"telemetry.info","telemetry":{"endpoint":"...","headers":["dd-api-key"],"lastExportAt":"...","lastError":null,...}} ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { telemetry } = await sandbox.getTelemetry(); console.log(telemetry?.lastExportAt, telemetry?.lastError); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} status = sandbox.get_telemetry() print(status.telemetry.last_export_at if status.telemetry else None) ``` ## Remove the endpoint ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat telemetry unset ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X DELETE "$BOAT_API_BASE/telemetry" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.deleteTelemetry(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.delete_telemetry() ``` boat stops the export. boat deletes the queued data immediately. ## Related * [Webhooks](/webhooks): the same lifecycle events, signed, to your own HTTPS endpoint. * [Command history and logs](/long-running-tasks/command-history): the output of the processes in a sandbox. # Teams and organizations Source: https://docs.boat.dev/organizations One shared plan and wallet for a team: members and invites, seat price, which wallet a sandbox bills, shared sandboxes, per-member caps, and moving a plan between personal and organization. To work as a team on boat, create an **organization**. It has one plan, one wallet, and members who run sandboxes on it. * The organization pays the plan price once per seat. A 5-seat organization on the \$20 plan pays \$100 a month. * Each seat adds the plan's included time. It adds the full limits on the \$2000 plan, and 20% of them below. Read [Seats, limits and caps](/organizations/seats-and-limits). * Organizations get no free trial. * The API and the CLI also call an organization `org`, and some fields call it `team` (`teamId`, `team_…` ids). All three name the same thing. | What | Who sees or uses it | | - | - | | Sandboxes the organization pays for | Every member sees them all. | | Shared sandboxes | Every member can use them. A sandbox is shared when it holds no personal logins and its creator did not make it private. | | Snapshots and personal environments | Only the person who made them. | | Organization environments and credential profiles | Every member uses them, unless an owner or admin [limits who can use them](#limit-who-can-use-an-environment-or-profile). Owners change them. See [Shared sandboxes](/organizations/shared-sandboxes#shared-environments-and-ai-credentials). | For everyone who can reach a sandbox, in and out of the team, read [Security and isolation](/security#who-can-reach-a-sandbox). ## Members and invites The owner invites people by email. 1. The person opens the link in the email. 2. The person signs in with any sign-in method. 3. The organization shows in their `boat org list` and in the **Viewing** dropdown of the dashboard. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat org create acme # you become its owner boat org switch acme boat org invite dana@example.com # owner only boat org members # members and pending invites boat org transfer dana # make dana the owner; you become a member ``` To remove a member, change roles or set per-member caps, use the [Organization](https://boat.dev/dashboard?tab=org) tab of the dashboard. When a member leaves, the sandboxes that they created go back to their personal billing. ## Rename an organization Only the owner can rename the organization. 1. Open the [Organization](https://boat.dev/dashboard?tab=org) tab and select the organization in the sidebar. 2. Select **Rename**, type the new name, and select **Save**. 3. Read the warning and select **Rename** to confirm. The id (`team_…`) does not change. After the rename, `--org`, `?org=` and `X-Boat-Org` accept the new name only. Update the scripts that use the old name, or use the id. New invoices show the new name when the billing name is still the organization name. A billing name that you entered at checkout does not change. Invoices that already exist keep their name. ## Limit who can use an environment or profile By default, every member can use each organization environment and each organization credential profile. An owner or admin can limit an environment to a list of members. An owner can do the same for a profile. | Setting | Who can use it | | - | - | | Everyone (default) | Every member of the organization | | Only listed members | Owners, admins and the listed members | A member who is not on the list: * Does not see the environment or the profile in lists. * Cannot create, resume or fork a sandbox in the environment. boat returns `403 environment_forbidden`. * Cannot pick the profile. When an environment that they can use names the profile, their sandboxes get their own default profile. Other rules: * An API key acts as the person who created it. It never reaches more than that person can. The environment scope of a key limits it more. * A change to the list does not change sandboxes that are already running. * Teammates already cannot use a sandbox that holds another person's secrets. Read [Shared sandboxes](/organizations/shared-sandboxes). ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env access agents --org acme # show the list boat env access agents --org acme --only a@x.com,b@y.com # only these members boat env access agents --org acme --add c@z.com boat env access agents --org acme --remove a@x.com boat env access agents --org acme --everyone # back to every member boat ai profile access team-claude --only a@x.com # same flags for a profile ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PUT "$BOAT_API_BASE/environments/$ENV_ID?org=acme" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"access":{"restricted":true,"members":["a@x.com","b@y.com"]}}' curl -sS -X PUT "$BOAT_API_BASE/credential-profiles/$PROFILE_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"access":{"restricted":false,"members":[]}}' ``` * `members` takes member ids or the emails of active members. It replaces the full list. * The environment and the profile objects return `access: { restricted, members }`, with member ids. * A bad list returns `400 invalid_access`. On the dashboard, open the environment page or the AI credentials page. The **Who can use this environment** or **Who can use this profile** panel has two choices: **Everyone in \<org>** or **Only the people ticked below**. ## Where to do what | | CLI | API | SDKs | Dashboard | | - | - | - | - | - | | See your organizations | `boat org list` | `GET /orgs` | `listOrganizations` | **Viewing** dropdown | | Set the active wallet | `boat org switch <org>` | `PATCH /orgs/active` | `setActiveOrganization` | sidebar **CLI and API keys bill … Change** | | Bill one sandbox elsewhere | `boat --org acme new` | `org` on `POST /sandboxes`, or `X-Boat-Org` | `org` on `create` | select the organization in the sidebar | | Create, transfer, delete | `boat org create` / `transfer` / `delete` | account API \* | not available | [Organization](https://boat.dev/dashboard?tab=org) | | Rename (owner) | not available | `PATCH /orgs/{org}` with `name` | `updateOrganization` | [Organization](https://boat.dev/dashboard?tab=org), **Rename** | | Members and invites | `boat org members` / `boat org invite` | account API \* | not available | [Organization](https://boat.dev/dashboard?tab=org) | | Remove members, caps | not available | account API \* | not available | [Organization](https://boat.dev/dashboard?tab=org) | | Seats | not available | account API \* | not available | [Billing](https://boat.dev/dashboard?tab=billing) viewing the org | | See, share and unshare team sandboxes | `boat list` / `boat share` / `boat unshare` | `GET /sandboxes` / `POST /sandboxes/{id}/share` / `POST /sandboxes/{id}/unshare` | `sandboxes` / `share` / `unshare` | [Sandboxes](https://boat.dev/dashboard?tab=sandboxes), row menu | | Start new sandboxes shared or private | `boat org default-visibility` | `PATCH /orgs/{org}` | `updateOrganization` | [Organization](https://boat.dev/dashboard?tab=team) | | Org plan, wallet, auto top-up | `boat --org acme billing …` / `boat --org acme wallet …` | account API \* | not available | [Billing](https://boat.dev/dashboard?tab=billing) viewing the org | \* The account API is the one that the dashboard uses. Its base is `https://boat.dev/api/boat`, not `$BOAT_API_BASE`. Organization routes are under `/teams/{org}/…` and billing routes under `/billing/…` with `teamId` in the body. These routes are not in the [v1 API reference](/api/v1) and can change. The plan, the wallet and running out work the same on an organization as on a personal account. Read [Plan, wallet and running out](/billing). ## Learn more > [card] [Which wallet a sandbox bills](/organizations/active-wallet) > > Set the active wallet, or bill one sandbox to another wallet. > [card] [Shared sandboxes](/organizations/shared-sandboxes) > > What each member can do with a sandbox. Share a sandbox or make it private. > [card] [Seats, limits and caps](/organizations/seats-and-limits) > > Buy seats, share start and concurrency limits, and cap each member. > [card] [Move a personal plan in](/organizations/move-personal-plan) > > Move your personal sandboxes and plan to the organization. > [card] [Card, invoices and plan changes](/billing/plan-changes) > > Cancel, downgrade, refunds, and move an organization plan back to personal. # Which wallet a sandbox bills Source: https://docs.boat.dev/organizations/active-wallet Who pays for a sandbox: your personal account or an organization. Switch the active organization, or bill one sandbox to an organization without switching. The **wallet** of a sandbox is the account that pays for it: your personal account or an organization. Each wallet has its own plan and its own dollar balance for overage. Read [Plan, wallet and running out](/billing). Every account has one **active wallet**. It is your personal account until you change it. * A new sandbox bills the wallet that the request names. * A request that names no wallet bills the active wallet. * The active wallet is one setting on the account. The CLI and account API keys use it. * The dashboard does not use it. The dashboard bills the organization selected in the sidebar. * An organization API key always bills its own organization. * `GET /limits` reads the wallet that a create would bill. * boat fixes the wallet of a sandbox when it creates the sandbox. ## Name an organization | Value | Means | | - | - | | The id (`team_…`) | That organization. | | The name, as `GET /orgs` / `boat org list` show it | That organization. Case does not matter. | | `personal` | Your own account. | You need the id only when two organizations have the same name. Then a name gives `409 ambiguous_org`. ## Set or override the wallet ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat org # the wallet in effect right now boat org list # organizations you belong to, ids and names boat org switch acme # active wallet = acme, for the CLI and account API keys boat org switch personal # back to your own account boat --org acme new # bill one create to acme without switching ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/orgs" -H "Authorization: Bearer $BOAT_API_KEY" # -> orgs: [{ id, name, type, role, active }, ...] curl -sS -X PATCH "$BOAT_API_BASE/orgs/active" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{ "org": "acme" }' # or the team_… id, or "personal" # one call elsewhere: header, query, or body curl -sS -X POST "$BOAT_API_BASE/sandboxes" -H "X-Boat-Org: acme" ... curl -sS "$BOAT_API_BASE/limits?org=acme" ... curl -sS -X POST "$BOAT_API_BASE/sandboxes" -d '{ "org": "acme" }' ... ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { orgs } = await boat.listOrganizations(); // ids, names, active await boat.setActiveOrganization({ org: "acme" }); await boat.create({ org: "acme" }); // one sandbox elsewhere ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.active_org_update_request import ActiveOrgUpdateRequest from boat_sdk.models.create_sandbox_request import CreateSandboxRequest orgs = boat.list_organizations().orgs # ids, names, active boat.set_active_organization(ActiveOrgUpdateRequest(org="acme")) boat.create(create_sandbox_request=CreateSandboxRequest(org="acme")) # one sandbox elsewhere ``` ## In the dashboard | Control | What it does | | - | - | | **Organization** select in the sidebar | Picks the organization of every page: the sandboxes, snapshots, keys and billing shown, and the wallet of the sandboxes and keys you create. The browser remembers it. | | Sidebar, **CLI and API keys bill … Change** | Sets the active wallet: the default of the CLI and account API keys. Picking an organization in the select above never changes it. | Webhooks, Alerts and Account settings belong to your account. They are the same in every organization. The page header says so. ## A teammate cannot see or use my sandbox | Cause | Fix | | - | - | | The sandbox bills your personal account. Teammates see only sandboxes that the organization pays for. | Move all your personal sandboxes and your plan: `boat --org acme org migrate` (organization owner only). Or create a new sandbox for the team: `boat --org acme new`. | | The teammate looks at their personal scope. | The teammate runs `boat org switch acme`, or picks the organization in the sidebar. | | The teammate sees it as `view` only. The sandbox is private. | Run `boat share <id>`. If it holds your logins and runs, stop and resume it after. Read [Shared sandboxes](/organizations/shared-sandboxes). | boat fixes the wallet of a sandbox when it creates it. A fork keeps the wallet of its source. # Move a personal plan in Source: https://docs.boat.dev/organizations/move-personal-plan Move the sandboxes and plan you paid for personally to your organization, without stopping them. The unused share of the month is refunded. Did you pay personally before the organization existed? Then do not cancel the personal plan by hand. The sandboxes that bill your personal account would stop with it. Move the plan instead. When you move: * Every sandbox billed to your personal account bills the organization from that moment. * Your personal plan ends the same day. * boat refunds the unused share of the month to your card. * The money in your personal wallet stays on your personal account. * Only the owner of the organization can move a plan in. * The organization must have its own plan first. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat --org acme billing plan 20 --move-personal # first org plan, move included once it is paid boat --org acme org migrate # org already on a plan ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} # Account API: not under $BOAT_API_BASE and not in the v1 API reference curl -sS -X POST "https://boat.dev/api/boat/billing/move-to-org" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"teamId": "team_..."}' ``` The dashboard offers the same move in two places: * The Billing tab of the organization. * The cancel-plan dialog of your personal plan. To move from an organization back to a personal plan, read [Card, invoices and plan changes](/billing/plan-changes#move-a-plan-between-personal-and-organization). # Seats, limits and caps Source: https://docs.boat.dev/organizations/seats-and-limits Seat price (one plan price per seat), what a seat adds, buying seats, the shared start and concurrency limits, the shared wallet, and per-member caps. ## Seats **One seat costs the plan price.** A 5-seat organization on the \$20 plan pays \$100 a month. Each seat adds the plan's included time. So a 5-seat organization on the \$20 plan also gets \$100 of included time each month. Seats add limits (sandboxes at once and starts) as follows: | Plan | What one more seat adds to the limits | | - | - | | \$2000 | The full plan limits | | \$20, \$100, \$500 | 20% of the plan limits. The total never goes above the limits of the next plan. | To get higher limits, move to a bigger plan first. A bigger plan always gives more limits than the same money in seats. Organizations that had more than one seat on 28 October 2026 keep the full limits for those seats. An organization pays for the larger of two numbers: * Its members. * The seats that the owner bought. You do not need one person or one email for each seat. To pay for more seats than people, set the seat count. Use the [Billing](https://boat.dev/dashboard?tab=billing) tab with the organization selected, or call the account API. This route is not under `$BOAT_API_BASE` and is not in the v1 API reference: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -X PUT https://boat.dev/api/boat/teams/acme/seats \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"seats": 5}' ``` | Change | Result | | - | - | | Raise the count | The organization card pays the prorated difference at once. If the card fails, the seat count does not change. | | A member joins | The member takes an empty seat at no extra cost. | | A member joins and no seat is empty | Accepting the invite adds a seat. The organization card pays for it at once. If the card fails, the accept fails with "could not add the paid seat" and the invite stays unused. | | Lower the count | You get credit on the next invoice, not a card refund. You cannot go below the number of members. | * A seat counts accounts, not email addresses. Invites to email aliases such as `name+1@example.com`, accepted by the same account, add no seat. To get more seats, set the seat count. * To add members, the organization needs an active plan. ## Shared limits The included time, start-rate and concurrency numbers of the plan are **one shared pool for the whole organization**. The seats set the size of the pool, as in [Seats](#seats). For every limit, read [Limits and errors](/limits). Example: 5 seats of \$20 against the \$100 plan, for the same \$100 a month: | Limit | 5 seats of \$20 | \$100 plan, 1 seat | | - | - | - | | Included time per month | \$100 (2,777 h of `default`) | \$100 | | Concurrent sandboxes | 180 | 300 | | Starts per minute | 21 | 30 | | Starts per hour | 108 | 210 | | Starts per day | 360 | 840 | * If one member uses all of the hourly start budget, boat refuses every other member's `new`, `fork` and `resume` billed to the organization. This lasts until the window rolls. * Personal sandboxes use the member's own personal limits. * The seat limits apply only while the organization's plan is active. Without a plan, money in the wallet still runs sandboxes, at the limits of a single seat. * [Extra starts](/limits#extra-starts) use these shared limits as their included numbers. ## Per-member caps One shared plan and one shared wallet mean one member can spend all of it. So the owner can cap each member on the [Organization](https://boat.dev/dashboard?tab=org) tab. Both caps are unlimited by default. These caps are the only spend caps in boat. A personal account has none: read [Control your spend](/billing#control-your-spend). | Cap | Limits | | - | - | | Usage cap | That member's organization-billed machine time per billing window | | Concurrent sandboxes | How many organization-billed sandboxes that member can run at once | * The owner and admins set caps. Only the owner sets the owner's caps. * Caps apply only to organization-billed sandboxes. * A sandbox counts against the caps of its **creator**. This is also true when a teammate resumes it. | Over the cap | `new`, `fork` and `resume` answer | | - | - | | Usage cap | `402 team_member_cap_reached` | | Concurrent-sandbox cap | `429 member_limit_reached` | In both cases, boat snapshots and stops the member's organization sandboxes within about a minute. Nothing is lost. The sandboxes can resume again when the owner raises the cap or the billing window renews. # Shared sandboxes Source: https://docs.boat.dev/organizations/shared-sandboxes Every member sees the sandboxes the organization pays for. What each member can do with them, how to share a sandbox or make it private, and the default for new sandboxes. For everyone who can reach a sandbox, in and out of the team, read [Security and isolation](/security#who-can-reach-a-sandbox). In the scope of an organization, `boat list`, `GET /sandboxes` and the dashboard show two sets of sandboxes: * Your own sandboxes. * **Every sandbox the organization pays for**, whoever created it. Each sandbox shows who created it (`createdBy`), whether it is `shared` or `private` (`visibility`), and what you can do with it (`access`). ## Shared or private | `visibility` | When | Teammates | | - | - | - | | `shared` | It holds none of its creator's personal logins, and its creator did not make it private | Use it | | `private` | It holds its creator's personal logins, or its creator made it private | See it. Stop it, unless its creator made it private | | `access` | Who | What you can do | | - | - | - | | `owner` | You created it | Everything | | `use` | A teammate's `shared` sandbox | Open it, SSH, run commands, read and write files, prompt its agent, open ports, resume and stop it | | `view` | A teammate's `private` sandbox | See it and its usage. Stop it, unless its creator made it private | ## Make a sandbox private or shared The creator runs `unshare` or `share`. A sandbox that holds none of the creator's logins changes at once, both ways. Nothing on the sandbox changes. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat unshare bx_4tr8wz3c # only you can use it; teammates still see it boat share bx_4tr8wz3c # every member can use it again ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_4tr8wz3c/unshare" -H "Authorization: Bearer $BOAT_API_KEY" # -> { sandbox: { ..., visibility: "private" } } ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await boat.unshare({ sandboxId: "bx_4tr8wz3c" }); // creator only await boat.share({ sandboxId: "bx_4tr8wz3c" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat.unshare(sandbox_id="bx_4tr8wz3c") # creator only boat.share(sandbox_id="bx_4tr8wz3c") ``` * `unshare` removes teammates' SSH keys from the running sandbox. A terminal a teammate already has open stays open until it closes. * Teammates never read history recorded while the sandbox was private. * In the dashboard, pick **Make private** or **Share with org** in the row menu. ## New sandboxes: shared or private by default New sandboxes of an organization start `shared`. Owners and admins can make them start `private`. Existing sandboxes keep their setting. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat org default-visibility # shows the current value boat org default-visibility private # new sandboxes start private ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PATCH "$BOAT_API_BASE/orgs/acme" -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" -d '{"newSandboxesPrivate":true}' ``` In the dashboard, the setting is on the **Organization** page. The default applies to sandboxes created, deployed from a saved snapshot, forked, or moved in with `boat org migrate`. A fork of a private sandbox is private. ## Why a sandbox with your logins is private A sandbox can get these from its creator, when its environment passes them: * GitHub token. * Claude and Codex logins. * Environment secrets. Anyone with a shell in that sandbox could act as that person. So a teammate gets a shell only when none of these are on the sandbox. A sandbox created with `--no-env` is `shared` from the start, unless the organization default is `private`. So is a sandbox created on an environment that passes nothing: marked [safe for third parties](/environments/access#safe-for-third-parties) without the AI credentials proxy, or with every section turned off. Such a sandbox never receives personal logins later: an environment upgrade skips it, and a resume or fork onto an environment that passes logins returns `409 environment_passes_logins`. Pick this setup for agents that the whole team runs. Give these agents the team's own model keys with `--env`. Do not give them the logins of one person. ## Share a sandbox that holds your logins The creator of the sandbox runs `share`. Then: * boat never sends the creator's GitHub token, model logins, secret files or the sandbox's own CLI key to it again. The sandbox becomes `noEnv`. * boat deletes these from its disk when the sandbox next starts. * Files and installs stay. * You cannot undo the removal of the logins. You can still make the sandbox private again with `unshare`. A sandbox that runs when you share it still has your logins in the memory of its programs. It stays `view` for your team until you stop it and resume it. The response then shows `restartRequired: true`. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat org switch acme # the org's scope: boat list shows its sandboxes too boat list # bx_7k2m9qpd running 2h 10m research-agent [org: acme] by alex view only: holds alex's logins # bx_4tr8wz3c running - support-agent [org: acme] by alex boat stop bx_7k2m9qpd # alex, the creator boat share bx_7k2m9qpd boat resume bx_7k2m9qpd # comes back without alex's logins: every member can use it ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/sandboxes" -H "Authorization: Bearer $BOAT_API_KEY" -H "X-Boat-Org: acme" # -> sandboxes: [{ id, name, state, createdBy, access, visibility, holdsCreatorLogins, team, ... }] curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_7k2m9qpd/share" -H "Authorization: Bearer $BOAT_API_KEY" # -> { sandbox: { ... }, restartRequired: true } when it was running: stop + resume it ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { sandboxes } = await boat.sandboxes({ org: "acme" }); for (const s of sandboxes) console.log(s.name, s.createdBy, s.access); await boat.share({ sandboxId: "bx_7k2m9qpd" }); // creator only ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} page = boat.sandboxes(org="acme") for s in page.sandboxes: print(s.name, s.created_by, s.access) boat.share(sandbox_id="bx_7k2m9qpd") # creator only ``` ## In the dashboard | Row label | Means | | - | - | | **by alex** | A teammate, alex, created this sandbox. | | **view only** | alex's sandbox is private: it holds alex's logins, or alex made it private. | | **private** | Your own sandbox that your teammates see as **view only**. To share it, pick **Share with org** in the row menu. "Private" does not mean billed to your personal account. | | **shared** | Your own sandbox that every member can use. To stop that, pick **Make private** in the row menu. | A sandbox that bills your personal account does not show to your teammates at all. Read [A teammate cannot see or use my sandbox](/organizations/active-wallet#a-teammate-cannot-see-or-use-my-sandbox). ## Errors | Error | When | | - | - | | `403 sandbox_private` | A teammate tries to use a `view` sandbox. The error says whose logins the sandbox holds, or who made it private. | | `403 owner_only` | A teammate tries an action that stays with the creator. | These actions stay with the creator: * Fork. * Delete. * Change its settings: name, subdomain, auto-stop. * Any stop that deletes data: `--force`, or any stop of a sandbox with snapshots off. The organization owner can also do this. * Any stop of a sandbox that its creator made private (`unshare`, or the `private` default). Owners and admins of the organization can also do this. So with `boat org default-visibility private`, each member stops only their own sandboxes. ## Shared environments and AI credentials Give the team's sandboxes the team's own model keys, not a person's logins. Members use these unless an owner [limits them to a list of members](/organizations#limit-who-can-use-an-environment-or-profile). | | Members | Owners | | - | - | - | | [Organization environments](/environments/manage#organization-environments) (`?org=` on environment routes, `boat env --org`) | Read and use | Owners and admins change them | | [Organization credential profiles](/ai-credentials#organization-profiles) | Use | Create and change | | [AI credentials proxy](/ai-credentials#the-ai-credentials-proxy) switch of the organization | See | Turn on or off | ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat --org acme ai profile new team-claude echo "$ANTHROPIC_API_KEY" | boat ai profile set-key team-claude anthropic-api-key boat --org acme ai proxy on boat env new agents --org acme boat env set agents --org acme --credential-profile team-claude boat --org acme new --environment agents ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/credential-profiles" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"name":"team-claude","org":"acme"}' curl -sS -X PUT "$BOAT_API_BASE/environments/$ENV_ID?org=acme" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"credentialProfileId":"team-claude"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await boat.createCredentialProfile({ name: "team-claude", org: "acme" }); await boat.updateEnvironment({ environmentId: envId, org: "acme", credentialProfileId: "team-claude" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.create_credential_profile_request import CreateCredentialProfileRequest from boat_sdk.models.update_sandbox_environment_request import UpdateSandboxEnvironmentRequest boat.create_credential_profile(CreateCredentialProfileRequest(name="team-claude", org="acme")) boat.update_environment(env_id, UpdateSandboxEnvironmentRequest(credential_profile_id="team-claude"), org="acme") ``` A sandbox billed to the organization can name an organization environment. When the creator has an environment of the same name, the creator's own environment wins. # Sandbox per user: build a platform Source: https://docs.boat.dev/platform-guide Give each of your users a sandbox: run their agents, previews, and workspaces on boat. Architectures, costs, and provisioning patterns. This guide is for builders of products like Lovable, Devin, or agent platforms. In these products, your product makes a sandbox for each of your own users. The [Terms of Service](https://boat.dev/terms#tos-8) allow this, and you do not need our approval. You are responsible for what your users do in their sandboxes. Such a platform needs: * Persistent files and context for each user or project. * An agent that works inside the workspace and can debug anything. Each sandbox has seven coding agents. See [Integrated agents](/integrated-agents). * A private preview URL of what the user builds. * A controlled sandbox cost for each user. In all cases, you run your own backend and database. You control boat through the [API](/api/v1) or the [SDKs](/sdks/overview). ## The two rules 1. **Always create user sandboxes with `--no-env`** (`noEnv: true`). A no-env sandbox gets none of the secrets or credentials of your account. It cannot act on your account or on other sandboxes. Give the sandbox what it needs explicitly with `--env`. See [No-env sandboxes](/environments#safe-for-third-parties). 2. **Tag each sandbox** with per-sandbox environment variables. Your backend then knows which sandbox is which. > [!TIP] > > You do not have to remember `--no-env` on every call. Mark an environment as safe for third parties once, and use it for your user sandboxes. Every sandbox that uses it then gets the same protection. The protection stays after forks and resumes, and your backend does not pass a flag. > > ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} > boat env new users > boat env set users --safe-for-third-parties true > boat new --environment users --env TENANT_ID=acme > ``` > > See [Environments](/environments). ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --no-env --no-auto-stop --env TENANT_ID=acme ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"ttlSeconds":null,"noEnv":true,"env":{"TENANT_ID":"acme"}}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.create({ ttlSeconds: null, noEnv: true, env: { TENANT_ID: "acme" } }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.create(create_sandbox_request=CreateSandboxRequest(ttl_seconds=None, no_env=True, env={"TENANT_ID": "acme"})) ``` Wait for the sandbox to reach `ready` or `idle` before you run commands in it. boat enforces this: | When you send a command | boat answers | | - | - | | While the sandbox provisions | A retryable 409 `sandbox_starting` error | | Earlier in provisioning | 409 `machine_not_running` | Do not race the start. A command sent too early also runs before boat applies your `env`. ## Choose a pattern | Pattern | Isolation | Cost | Use it when | | - | - | - | - | | [1. One always-on sandbox per project](/platform-guide/patterns#pattern-1-one-always-on-sandbox-per-project) | Full | About \$26/month per project on `default` | The project has real traffic, or the user pays enough to cover it. | | [2. One always-on sandbox per user](/platform-guide/patterns#pattern-2-one-always-on-sandbox-per-user) | Projects of one user share a machine | About \$26/month per user | A user has up to 5 to 10 fullstack projects. | | [3. Stop and resume around usage](/platform-guide/patterns#pattern-3-stop-and-resume-around-usage) | Full | \$1 to \$5 per month for a typical user | Most platforms end up here. | ## Learn more > [card] [Sandbox-per-user patterns](/platform-guide/patterns) > > Three ways to run sandboxes for your users, with costs, delete and refused stops. > [card] [Agents in your product](/platform-guide/agents) > > Use the integrated agents, or bring your own harness with a daemon. > [card] [Templates and sizing](/platform-guide/templates-and-sizing) > > Use a saved snapshot as a template for each user. Plan concurrency and start limits. ## Related * [Integrated agents](/integrated-agents) * [Run many agents in parallel](/recipes/parallel-agents) * [Environments](/environments) * [Pricing](/pricing) * [Billing](/billing) * [Snapshots](/snapshots) * [Public URLs](/hosting) * [FAQ](/faq) # Agents in your product Source: https://docs.boat.dev/platform-guide/agents Use the integrated agents in your product with your users' keys, or drive the sandbox from your own agent (LangChain, your daemon) over the API. ## Use the integrated agents Before you write an agent loop, look at what the sandbox already runs. * `boat prompt` drives seven coding agents: Claude Code, Codex, pi, OpenCode, Prime Agent, Kimi Code and Mistral Vibe. See [harnesses and models](/integrated-agents/harnesses-and-models). * It has memory, parallel conversations, streaming events and a model choice for each prompt. * For most platforms, it replaces the [daemon](#bring-your-own-harness-the-daemon-pattern). [Integrated agents](/integrated-agents) explains how it works and every way to customize it. These tips matter when you build a product on it: * **Use your user's key, not yours.** Create the sandbox with `--no-env`. Pass the user's key as a per-sandbox variable: `-e ANTHROPIC_API_KEY=…`, `-e OPENAI_API_KEY=…`. Every harness reads it. The full list of variables is in [Keys and subscriptions](/integrated-agents/keys#use-the-keys-of-your-users). Nothing of your account is on the sandbox. Keys are per sandbox. So users whose keys must stay apart get their own sandbox ([patterns 1 and 3](/platform-guide/patterns)). A sandbox that you pay for can serve many users through conversations ([pattern 2](/platform-guide/patterns#pattern-2-one-always-on-sandbox-per-user)). * **Use one conversation for each user session.** `POST /prompt` with `new: true` returns a `conversationId`. Store it with the session. Send it back as `conversationId` with each later message. Conversations run in parallel on one sandbox, and each one has its own memory. They stay after a stop and resume. So pattern 3 works without changes: resume the sandbox, then prompt the same conversation. * **Add an agent and model picker.** A selector in your UI maps directly to the `provider` and `model` fields of `POST /prompt`. A switch in the middle of a conversation keeps the history. Users can change their choice for each message. * **Stream to your UI.** `GET /events` with a cursor gives structured events for prompts, responses and tool calls. Each event has its `conversationId`. Filter with `conversation` to show each user only their own session. There is no SSE: poll about once per second. See [Stream events](/integrated-agents/conversations#stream-events). * **Add a stop button.** `POST /interrupt` with `conversation` stops the turn of one user. The other conversations keep running. To change the task without a stop, use [`POST /steer`](/integrated-agents/steering). * **Add house rules, tools and MCP servers.** The agents read usual config files from the sandbox home: `AGENTS.md`, `CLAUDE.md`, MCP registrations and skills. Put yours in a [saved snapshot](/snapshots/templates) once, and every sandbox that starts from it has them. Put per-user rules in the prompt or in per-user sandboxes. See [Customize the harness](/integrated-agents/customize). * **Send attachments.** `boat prompt --attach` puts the user's files under `~/attachments` on the sandbox. It sends images inline to vision models. From a backend, write the file with the [file endpoint](/api/reference/agent/write-sandbox-file), and give its path in the prompt. ## Bring your own harness: the daemon pattern You do not have to use the integrated agents. Your harness can run in your own infrastructure, or you can want full control of the agent loop. Then put a small HTTP daemon in the sandbox and talk to it directly: 1. **Install it.** Copy the binary in with `boat scp`, or put it in a [saved snapshot](/snapshots/templates). 2. **Keep it alive.** Run it as an [always-on systemd service](/long-running-tasks/always-on-services#run-an-always-on-service). It then survives stop, resume and fork. 3. **Expose it.** `host <port> --private` gives it a stable HTTPS URL that a `_token` protects. Use that token as the credential of the daemon. Store it in your backend. 4. **Drive it** from your backend over plain HTTPS. Your harness sends work. The daemon runs it with full access to the machine and streams the results back. ### Without a daemon Your own agent can drive the sandbox directly over the API. Examples are a LangChain agent or an agent on your laptop. Give it one tool that runs a command: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "https://boat.dev/api/v1/sandboxes/$BOAT_ID/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"npm test","cwd":"my-app","timeoutSeconds":300}' # {"exitCode":0,"stdout":"...","stderr":"...","timedOut":false,...} ``` A command stops after 30 seconds by default and 600 seconds at most. For a longer command, pass `"detached": true` and read [Background commands](/long-running-tasks/background-commands). The endpoints: | Task | Endpoint | | - | - | | Run any command in the sandbox | [`POST /sandboxes/{sandboxId}/commands`](/api/reference/agent/execute-sandbox-command) | | Read and write data | File endpoints: [read](/api/reference/agent/read-sandbox-file), [write](/api/reference/agent/write-sandbox-file) | | Lifecycle, prompts, events, desktop, snapshots | Dedicated endpoints | | In-sandbox tools such as `host` | Run their commands through the commands endpoint | A daemon is useful when you need streaming, concurrency, or less latency than one-shot commands give. # Sandbox-per-user patterns Source: https://docs.boat.dev/platform-guide/patterns Three ways to run sandboxes for your users: always on per project, always on per user, or stop and resume around usage. Costs included. ## Pattern 1: one always-on sandbox per project This pattern is the simplest, and each project is fully isolated. 1. Make a sandbox for each user project with `--no-auto-stop`. 2. Clone or copy the user's code into it. 3. Run the user's dev server. 4. Expose the dev server. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec <id> --cwd project --detach "npm run dev -- --host 0.0.0.0 --port 3000" boat ssh <id> "host 3000 --private" # prints https://<subdomain>-3000.on.boat.dev?_token=... ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/$BOAT_ID/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"npm run dev -- --host 0.0.0.0 --port 3000","cwd":"project","detached":true}' curl -sS -X POST "$BOAT_API_BASE/sandboxes/$BOAT_ID/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"host 3000 --private"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.command({ sandboxId, command: "npm run dev -- --host 0.0.0.0 --port 3000", cwd: "project", detached: true, }); const hosted = await sandbox.command({ sandboxId, command: "host 3000 --private" }); console.log(hosted.stdout); // https://<subdomain>-3000.on.boat.dev?_token=... ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.command(sandbox_id, CommandRequest( command="npm run dev -- --host 0.0.0.0 --port 3000", cwd="project", detached=True, )) hosted = sandbox.command(sandbox_id, CommandRequest(command="host 3000 --private")) print(hosted.stdout) # https://<subdomain>-3000.on.boat.dev?_token=... ``` * Anyone who has the full `_token` URL can open it. boat does not check who signs in. Treat the URL like a password. * The preview stays up while the sandbox runs. * A detached dev server does not come back after a stop or resume. To make it come back, [run it as an always-on service](/long-running-tasks/always-on-services#run-an-always-on-service). | Size | Cost when it runs 24/7 | | - | - | | `default` | About \$26/month (\$0.00001 per second) | | `large` | Two times the `default` cost | Use this pattern when the project has real traffic, or when the user pays you enough to cover the cost. ## Pattern 2: one always-on sandbox per user This pattern is like pattern 1. The difference is that one sandbox holds all the projects of one user. * Each project has its own folder and its own port. * You install a small daemon in the sandbox. It multiplexes the agent sessions. * This works well for up to 5 to 10 fullstack projects per user. The cost is about \$26/month for each user, not for each project. Be careful with isolation: the projects of one user share a machine. ## Pattern 3: stop and resume around usage This pattern is the cheapest, and each sandbox is isolated. Most platforms end up with it. The sandbox runs only while the user works. 1. The user sends a message. 2. If the sandbox of the user is stopped, run `boat resume` on it. This takes a few seconds. 3. At the same time, start your daemon and the preview again. 4. Send the message to the agent. 5. When the agent finishes, wait a short countdown. 6. Run `boat stop`. The stop makes a snapshot of the file system and stops the billing of machine time. | After a stop and resume | Comes back? | | - | - | | Files | Yes | | Installed packages | Yes | | Enabled systemd services | Yes | | Processes you started by hand | No. Your daemon starts them again, or [run it as an always-on service](/long-running-tasks/always-on-services#run-an-always-on-service). | See [Snapshots](/snapshots). ### When the user is away for more than 14 days boat keeps the disk of a stopped sandbox for at least 14 days. After that, automated retention cleanup can delete it once enabled. The job currently reports candidates without deleting them in production. Save a saved snapshot before day 14 to keep logins, browser sessions and files. 1. Record the stop time of each sandbox in your app. 2. Each day, find the sandboxes that are still stopped after 13 days. 3. Save a saved snapshot of each one: `boat snapshot <id> user-<userId>`. This works on a stopped sandbox. 4. When the user comes back, start from it: `boat new --from user-<userId>`. Then delete the saved snapshot. You pay only for users who stay away more than 13 days. 10 saved snapshots are free. Each one after that costs \$0.056 a day from the wallet. Read [Keep a stopped sandbox longer than 14 days](/snapshots/stop#keep-a-stopped-sandbox-longer-than-14-days). To never lose a disk, keep the sandbox running instead. This costs machine time for every hour. ### When the user is done for good You can resume a stopped sandbox. A **delete** is the end. * To delete, use `DELETE /sandboxes/{sandboxId}`, `boat delete`, or **Delete permanently…** in the `⋯` menu of the dashboard. * You cannot undo a delete. You cannot resume the sandbox after it. Connect delete to an explicit "delete my project" action. Never connect it to an idle timeout. If the user can come back, stop the sandbox instead. For what a delete removes and what it keeps, read [Delete a sandbox or snapshot](/data-retention/delete). ### When a stop is refused A stop saves the disk of the sandbox first. If that save fails, boat **refuses the stop**. The sandbox keeps running, so the user does not lose work. **You do not pay for that time.** The meter pauses by itself from the first failed attempt. A stuck sandbox never shows on your invoice, and you have nothing to claim back. See [When a stop is refused](/snapshots/stop#when-a-stop-is-refused). What your backend sees: 1. Treat a refused stop as retryable, not as fatal. 2. The stop stays pending. boat retries it until a save succeeds. 3. Then the sandbox stops by itself. 4. boat also sends an email to the sandbox owner. To stop the sandbox now, pass `force`. * The sandbox stops with its last successful snapshot. * Everything written after that snapshot is lost. * You cannot undo it. Offer it only after a stop has already failed. * Without `force`, the sandbox stops this way by itself after 3 days of failed saves. boat sends an email to the owner before that. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat stop bx_23456789 --force ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "https://boat.dev/api/v1/sandboxes/bx_23456789/stop" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"force":true}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.stop({ sandboxId: "bx_23456789", force: true }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.stop(sandbox_id="bx_23456789", stop_request=StopRequest(force=True)) ``` ### Cost | | Cost | | - | - | | \$1 buys | About 27 hours of `default` machine time, or half that on `large` | | Typical user | \$1 to \$5 per month | | Power user | \$10 to \$20 per month | To charge this cost to your users, read the meter of each sandbox for the billing period. * Use `GET /sandboxes/{sandboxId}/usage`, or `boat usage <id>`. * It works on running and stopped sandboxes. * It counts exactly what boat charged for that sandbox. See [Per-sandbox usage](/billing#per-sandbox-usage). ### Two improvements * **No preview downtime.** Publish successful builds to a static host or a CDN. The sandbox is only for the agent and the dev preview. Production traffic never depends on a running sandbox. * **No agent latency.** Run a copy of the agent without tools on your own server. It answers immediately and stalls while the sandbox resumes. For a working implementation, see [optibox](https://github.com/ariana-dot-dev/optibox). # Templates and sizing Source: https://docs.boat.dev/platform-guide/templates-and-sizing Use a saved snapshot as a template: build your stack once and start a sandbox from it for each user. Plan concurrent sandboxes and start limits. ## Use a saved snapshot as a template Do not install your stack on a new sandbox for each user. Build it once, save it as a saved snapshot, then start each user sandbox from it: 1. Create a sandbox. Install the runtimes, the dependencies and your daemon. 2. Save it: `boat snapshot <id> <name>`. The name keeps this exact disk, also when the source sandbox changes or is deleted. 3. Start a sandbox for each user with `boat new --from <name>`. This takes a few seconds. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new # install runtimes, deps, your daemon boat snapshot <id> web-stack # save the disk under a name boat new --from web-stack --no-env -e TENANT_ID=acme # per user, a few seconds ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/saved-snapshots" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"sandboxId":"bx_23456789","name":"web-stack"}' curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"from":"web-stack","noEnv":true,"env":{"TENANT_ID":"acme"}}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.saveSavedSnapshot({ sandboxId: "bx_23456789", name: "web-stack" }); // poll getSavedSnapshot({ name: "web-stack" }) until its status is "ready" const created = await sandbox.create({ from: "web-stack", noEnv: true, env: { TENANT_ID: "acme" } }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.saved_snapshot_save_request import SavedSnapshotSaveRequest sandbox.save_saved_snapshot(SavedSnapshotSaveRequest(sandbox_id="bx_23456789", name="web-stack")) # poll get_saved_snapshot("web-stack") until its status is "ready" created = sandbox.create(create_sandbox_request=CreateSandboxRequest.from_dict({ "from": "web-stack", "noEnv": True, "env": {"TENANT_ID": "acme"}, })) ``` * A sandbox from a saved snapshot gets the whole file system that you saved. * It is usable in seconds, at an almost constant cost, whatever the snapshot holds. * It does not get the environment of the source sandbox. Pass `--environment` or `--no-env`. * 10 saved snapshots are free. Read [Saved snapshots](/snapshots/templates) for the price of more. Do not use a stopped sandbox and `boat fork` as the template. A fork uses the newest snapshot of its source, so any later change to the source goes into the next fork. To update the template: 1. Start a sandbox from it, or resume the source sandbox. 2. Change it. 3. Run `boat snapshot <id> web-stack` again. Sandboxes that you already started do not change. ## Sizing The number of concurrent sandboxes follows your daily active users, not your signups. A rough rule from platforms on boat: | Signups | Active users on an average day | Concurrent sandboxes | | - | - | - | | 10,000 | About 100 | 10 to 100 | On a launch day, the peak is several times higher. Plan against two different limits: | Limit | What it controls | | - | - | | Concurrent-sandbox cap of your plan | How many sandboxes exist at the same time | | Machine start limits | How fast you can start them | Create, fork and resume each count as one start. So pattern 3 uses starts each time a user comes back, not only at signup. | Plan | Starts per minute / hour / day | Sandboxes at once | | - | - | - | | \$20 | 12 / 60 / 200 | 100 | | \$100 | 30 / 210 / 840 | 300 | | \$500 | 65 / 420 / 1,680 | 1,000 | | \$2000 | 90 / 600 / 2,400 | 2,000 | | [Free trial](/free-trial) | 5 / 25 / 75 | 2 | An organization on the \$2000 plan gets these limits times its number of seats. Below it, each extra seat adds 20%. Above a limit, a start fails with `429 rate_limited`. The answer names the `window` that you hit. See [Limits and errors](/limits). # Pricing Source: https://docs.boat.dev/pricing Cost per hour of each sandbox size, what a plan includes, what the wallet pays, and prices compared to E2B, Modal and Daytona. ## Cost per hour You pay per second, only while a sandbox runs. A stopped sandbox costs no machine time. > [!WARNING] > > **A stopped sandbox keeps its disk for at least 14 days.** After that, automated retention cleanup can delete the data once enabled. It currently runs in report-only mode in production. Once deleted, the sandbox cannot resume. Save a [saved snapshot](/snapshots/templates) before day 14 if you need the disk longer. Read [Keep a stopped sandbox longer than 14 days](/snapshots/stop#keep-a-stopped-sandbox-longer-than-14-days). | Size | Per hour | CPU | RAM | Disk | | - | - | - | - | - | | `small` | **\$0.018** | 2 vCPU | 4 GB | 51 GB | | `default` | **\$0.036** | 4 vCPU | 8 GB | 51 GB | | `large` | **\$0.072** | 8 vCPU | 16 GB | 111 GB | | `xlarge` \* | **\$0.200** | 16 vCPU | 32 GB | 251 GB | \* `xlarge` needs the \$100 plan or higher. Subscribe from [Dashboard > Billing](https://boat.dev/dashboard?tab=billing), then pass `--type xlarge`. You do not need to contact us. * `default` is the size that other providers call medium. * Start with `default`. Use `small` for light scripts. Use `large` or `xlarge` for big builds or many containers. * No size has a GPU. * "Disk" is the space for your own files. The OS and the pre-installed tools are not in it. * One `default` sandbox that runs a full month (730 h) costs \$26. * Every size is a full Linux virtual machine with the same tools, snapshots, hosting and desktop. Only the machine changes. `default` costs \$0.036 an hour. E2B and Daytona charge \$0.331 an hour for the same machine (9x). Modal charges \$0.760 (21x). Read [Compared to others](#compared-to-others). Pick the size when you create a sandbox. To change it, stop the sandbox, then resume it with a new size. A fork can also take a new size. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --type small boat stop bx_23456789 until [ "$(boat info bx_23456789 --json | jq -r .sandbox.state)" = "stopped" ]; do sleep 2; done boat resume bx_23456789 --type large ``` ## Included at no cost * Automatic snapshots of your sandboxes, with no count limit. boat keeps the newest snapshot for **at least 14 days after a stop**. Automated retention cleanup can delete it later once enabled. * [Saved snapshots](/snapshots/templates#automatic-and-saved-snapshots) included with your plan: **10 for every \$20 of plan per seat**, never fewer than 10. A saved snapshot has no auto-deletion date. You cannot save one during the free trial. * Network traffic. boat does not bill egress. * A public IPv6 address on every sandbox, and outbound IPv4. The IP address can change when a sandbox resumes. * [Public URLs](/hosting) for the ports of a sandbox. ## Plans A plan is a monthly price that your card pays. **It is not a fee.** Every dollar comes back as VM time at the rates above. Example: the \$20 plan includes 555 hours of `default` and lets you run 100 sandboxes at the same time. Your first plan starts with a 7-day [free trial](/free-trial). A card is required. ### Plan limits and included | Plan | Run at once | Included starts per min / hour / day | VM time included | Saved snapshots included | | - | - | - | - | - | | \$20/mo | 100 | 12 / 60 / 200 | 555 h of `default` (\$20) | 10 | | \$100/mo | 300 | 30 / 210 / 840 | 2,777 h of `default` (\$100) | 50 | | \$500/mo | 1,000 | 65 / 420 / 1,680 | 13,888 h of `default` (\$500) | 250 | | \$2000/mo | 2,000 | 90 / 600 / 2,400 | 55,555 h of `default` (\$2000) | 1,000 | * Create, fork and resume each count as one start. Above your included starts, a start costs \$0.03 to \$0.07. Read [Extra starts](/limits#extra-starts). * Included VM time expires at the end of the billing period. boat does not carry it over. * **Seats**: an organization pays the plan price once per seat. A 5-seat organization on the \$20 plan pays \$100 a month. Each seat adds the plan's included amounts. It adds the full limits on the \$2000 plan, and 20% of them below. Read [Seats, limits and caps](/organizations/seats-and-limits). * boat raises limits only on custom plans above \$2000 a month. [Contact us](/support) for a custom plan. ### Overage, paid from the wallet boat uses the included amounts first. Then the wallet pays. | Overage | Price, paid from the wallet | | - | - | | VM time past the included time | \$0.036 per hour of `default`. `small` \$0.018, `large` \$0.072, `xlarge` \$0.200 | | Saved snapshots past the included count | \$0.056 per snapshot per day (\$1.68 for 30 days) | | [Extra starts](/limits#extra-starts) | \$0.03 to \$0.07 per start | | [AI credentials proxy](/ai-credentials#pricing) | \$1 for each day it is on, plus \$1 per 1,000 requests | * Add money with **Pay** or **auto top-up**. A payment of \$200 or more gets a bonus of 2% to 25%. Read [Wallet](/billing#wallet). * Saved snapshots and the AI proxy also charge while your sandboxes are stopped. Delete a saved snapshot to stop its charge. * For an empty wallet, read [Running out](/billing#running-out). All limits, their error codes and how to raise them are on [Limits and errors](/limits). Change plans from [Dashboard > Billing](https://boat.dev/dashboard?tab=billing) or with `boat billing plan 100`. A change applies at once. Read [Card, invoices and plan changes](/billing/plan-changes). ## Compared to others ![One default sandbox per hour, boat versus other sandbox providers](https://mintcdn.com/ariana-1e97e6c3/WPFOsWKHVWBxanI5/images/pricing-vs-others.svg?fit=max\&auto=format\&n=WPFOsWKHVWBxanI5\&q=85\&s=ea082451e7fa91ca84bf5ac0629e8132) This table prices the same machine on E2B, Modal, Daytona and other sandbox providers, at full use and their public list prices, checked on 2026-11-08. The sizes are the ones in the table above. boat's rates apply from the \$20 plan. Free credits and \$0 plans of other providers are not counted. | \$/hour | `small` | `default` | `large` | `xlarge` | | - | - | - | - | - | | **boat** | **\$0.018** | **\$0.036** | **\$0.072** | **\$0.200** | | exe.dev † | \$0.105 (6x) | \$0.210 (6x) | \$0.420 (6x) | \$0.840 (4x) | | Novita | \$0.117 (6x) | \$0.233 (6x) | \$0.467 (6x) | \$0.933 (5x) | | Freestyle | \$0.132 (7x) | \$0.264 (7x) | \$0.529 (7x) | \$1.06 (5x) | | Fly.io Sprites † | \$0.164 (9x) | \$0.329 (9x) | \$0.658 (9x) | \$1.32 (7x) | | E2B | \$0.166 (9x) | \$0.331 (9x) | \$0.662 (9x) | \$1.32 (7x) | | Daytona | \$0.166 (9x) | \$0.331 (9x) | \$0.662 (9x) | \$1.32 (7x) | | Blaxel † | \$0.166 (9x) | \$0.331 (9x) | \$0.662 (9x) | \$1.32 (7x) | | Cloudflare † | \$0.180 (10x) | \$0.360 (10x) | \$0.720 (10x) | \$1.44 (7x) | | AWS AgentCore † | \$0.217 (12x) | \$0.434 (12x) | \$0.867 (12x) | \$1.73 (9x) | | Modal † | \$0.238 (13x) | \$0.476 (13x) | \$0.952 (13x) | \$1.90 (10x) | | Islo | \$0.300 (17x) | \$0.600 (17x) | \$1.20 (17x) | \$2.40 (12x) | | Runloop | \$0.317 (18x) | \$0.634 (18x) | \$1.27 (18x) | \$2.53 (13x) | | Vercel Sandbox † | \$0.341 (19x) | \$0.682 (19x) | \$1.36 (19x) | \$2.73 (14x) | | Railway † | \$0.417 (23x) | \$0.833 (23x) | \$1.67 (23x) | \$3.33 (17x) | † exe.dev: standalone VM rate, RAM included; Cloudflare: active CPU only; Modal: 1 core = 2 vCPU (Modal pricing); Vercel Sandbox: active CPU only; Blaxel: CPU included in the RAM price; billed only while active; Railway: active CPU and used RAM only; Fly.io Sprites: active CPU and used RAM only; AWS AgentCore: active CPU and used RAM only. ### "Active CPU" billing Some providers bill only the CPU time that your code uses. They bill RAM in addition. Some bill the RAM that you reserve. Others (‡) bill the RAM in use. Their claim is "you will rarely max the box". This is what it means for you: * **You cannot know the price before you run.** The same job costs a different amount each time. Builds, test suites, browsers and agents use mostly CPU. * **RAM bills while you are idle.** Reserved or in use, you pay for it every second that the sandbox runs. * **They do not publish what their users use.** So you cannot check what "rarely max the box" saves you. The table above prices them at full use. That is the only rate they publish. boat has one price per size, per hour. You know it before you run anything. We publish our usage. This table shows how much CPU and RAM boat sandboxes used over the last 30 days. Each column prices that usage at the list rates of one provider. ![One default sandbox per hour at real boat usage, boat versus active-CPU providers](https://mintcdn.com/ariana-1e97e6c3/WPFOsWKHVWBxanI5/images/active-cpu-vs-others.svg?fit=max\&auto=format\&n=WPFOsWKHVWBxanI5\&q=85\&s=2a94fad5eebe3202d27af0bfb3a6937b) | Sandbox | **boat** | AWS AgentCore ‡ | Fly.io Sprites ‡ | Cloudflare | Railway ‡ | Vercel Sandbox | | - | - | - | - | - | - | - | | quietest 1%: CPU 0.37% busy, RAM 14.77% used | **\$0.036** | \$0.012 (0.3x) | \$0.026 (0.7x) | \$0.073 (2.0x) | \$0.083 (2.3x) | \$0.171 (5x) | | median: CPU 8.79% busy, RAM 18.89% used | **\$0.036** | \$0.046 (1.3x) | \$0.047 (1.3x) | \$0.097 (2.7x) | \$0.129 (4x) | \$0.215 (6x) | | average: CPU 11.11% busy, RAM 22.97% used | **\$0.036** | \$0.057 (1.6x) | \$0.057 (1.6x) | \$0.104 (2.9x) | \$0.158 (4x) | \$0.226 (6x) | | busiest 1%: CPU 92.06% busy, RAM 36.1% used | **\$0.036** | \$0.357 (10x) | \$0.205 (6x) | \$0.337 (9x) | \$0.456 (13x) | \$0.641 (18x) | ‡ bills RAM used, not RAM reserved. A sandbox that is almost idle can cost less with a provider that bills only busy CPU and used RAM. From the median sandbox up, boat has the lowest price in this table. Below about \$20 of use a month, providers with a \$0 plan or free credits cost less. Are your sandboxes idle most of the time? Then stop them, and resume them when work arrives. Use `boat stop` / `boat resume`, or the API. A stopped sandbox has no compute charge and keeps its disk for at least 14 days. Saved snapshots above the included count and the AI credentials proxy still charge while sandboxes are stopped. ## Performance StarSling's hpc-sandbox-benchmarks ran the V8 Web Tooling Benchmark on the 4 vCPU / 8 GB machine of every provider. This is our `default` size. Every row below comes from StarSling's run of 3 October 2026 (run 37073680030). StarSling marks that run partial: 800 of 840 cells. For the full results, read the [leaderboard](https://github.com/starslingdev/hpc-sandbox-benchmarks/blob/297198a96ee827df5edcd918bd37b949526cfe20/LEADERBOARD.md). ![The V8 Web Tooling Benchmark, 1,000 runs, time it takes per provider](https://mintcdn.com/ariana-1e97e6c3/WPFOsWKHVWBxanI5/images/perf-vs-others.svg?fit=max\&auto=format\&n=WPFOsWKHVWBxanI5\&q=85\&s=21a1d5396390b0a50c02c806490cc75b) | 4 vCPU / 8 GB | Runs per second | Seconds per 1,000 runs | \$/hour | \$ per million runs | | - | - | - | - | - | | Brezel † | 30.06 | 33 s (0.9x) | – | – | | **boat †** | **28.06** | **36** s | **\$0.036** | **\$0.36** | | Namespace † | 24.90 | 40 s (1.1x) | – | – | | Daytona † | 21.52 | 46 s (1.3x) | \$0.331 | \$4.28 (12x) | | microsandbox † | 21.34 | 47 s (1.3x) | – | – | | Novita | 20.16 | 50 s (1.4x) | \$0.233 | \$3.21 (9x) | | Blaxel † | 18.03 | 55 s (1.6x) | \$0.331 | \$5.10 (14x) | | Modal (VM runtime) † | 15.48 | 65 s (1.8x) | \$0.760 | \$13.63 (38x) | | Vercel Sandbox † | 12.66 | 79 s (2.2x) | \$0.682 | \$14.96 (42x) | | Modal (gVisor) † | 12.60 | 79 s (2.2x) | \$0.760 | \$16.75 (47x) | | E2B | 11.08 | 90 s (2.5x) | \$0.331 | \$8.30 (23x) | | Freestyle | 10.22 | 98 s (2.7x) | \$0.264 | \$7.19 (20x) | | Runloop | 8.93 | 112 s (3x) | \$0.634 | \$19.71 (55x) | † Brezel: Firecracker microVM; no list price checked. † boat: every boat sandbox in this run ran on an AMD Ryzen 9 9950X host. boat also places some sandboxes on AMD Ryzen 7 9700X hosts, which this run did not measure. † Namespace: container on Firecracker; no list price checked here. † Daytona: VM class. The default container class has no result in this run. † microsandbox: Microsandbox Cloud, libkrun microVM; no list price checked here. † Blaxel: Firecracker microVM. Blaxel bills active time only. † Modal (VM runtime): runtime="vm", priced as the measured sandbox: StarSling ran Modal with cpu=4 and the sandbox saw 4 CPUs (PR #121), which bills 4 Modal cores, \$0.76/h. At Modal's own 1 core = 2 vCPU, a 4 vCPU size is 2 cores, \$0.48/h, and shows 2 CPUs. † Vercel Sandbox: Firecracker microVM. Vercel bills busy CPU only. † Modal (gVisor): default gVisor runtime, priced as the measured sandbox: StarSling ran Modal with cpu=4 and the sandbox saw 4 CPUs (PR #121), which bills 4 Modal cores, \$0.76/h. At Modal's own 1 core = 2 vCPU, a 4 vCPU size is 2 cores, \$0.48/h, and shows 2 CPUs. StarSling's run of 2026-10-03, one run for every row. Providers ran on different hardware in different regions. Multiples are against boat. * boat did 28.06 runs per second, second of 15 in that run. StarSling ranks boat, Namespace, Daytona VM, microsandbox and Novita together: the run cannot separate them. Brezel scored highest. * The measured sandbox ran on an AMD Ryzen 9 9950X host. The fleet also has AMD Ryzen 7 9700X hosts. boat does not promise a CPU model. Sandboxes are full virtual machines with shared vCPUs. * Values are medians of 5 sandboxes per provider, each asked for 4 vCPU / 8 GB. ## Worked examples | You run | Per month | | - | - | | One `default` sandbox, 8 hours a day, 22 days | 176 h × \$0.036 = **\$6.34**, covered by the \$20 plan | | One `default` sandbox 24/7 | 730 h × \$0.036 = **\$26**: the \$20 plan plus \$6 from the wallet | | 50 `default` sandboxes, 4 hours a day, 22 days | 4,400 h × \$0.036 = **\$158**: the \$100 plan (300 at once) plus \$58 from the wallet | | 200 `small` sandboxes, 1 hour each, once | 200 h × \$0.018 = **\$3.60**, covered by any plan | ## For the API `GET /limits` gives the plan and the wallet: | Field | Means | | - | - | | `wallet.balanceDollars` | Money in the wallet. Below zero when you owe. | | `planIncluded.vmHours`, `planIncluded.vmHoursRemaining` | Included VM time of this billing period, in hours of `default`. `periodEnd` is when it resets. | | `overagePrices` | The overage prices above. | Each size uses VM time at its own rate: | Size | Hours of `default` per hour of run time | | - | - | | `small` | 0.5 | | `default` | 1 | | `large` | 2 | | `xlarge` | 5.56 | * `boat usage <id>` and `GET /sandboxes/{id}/usage` give the bill of one sandbox. The size is already applied. * `creditBalanceHours`, `packBalanceDollars` and the other `pack…` fields are deprecated. Read `wallet` and `planIncluded`. For what happens when the wallet is empty, read [Plan, wallet and running out](/billing). For team plans and caps, read [Organizations](/organizations). # Quickstart Source: https://docs.boat.dev/quickstart Install the boat CLI on macOS, Linux or Windows, start a cloud sandbox, and run a command in it. Or do the same from Python, TypeScript or curl. boat gives you full Ubuntu virtual machines (sandboxes) for AI agents and code, billed per second. Start one in two minutes. ## 1. Install the CLI ```bash macOS theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -fsSL https://boat.dev/install | sh ``` ```bash Linux theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -fsSL https://boat.dev/install | sh ``` ```powershell Windows theme={"theme":{"light":"github-light","dark":"github-dark-default"}} irm https://boat.dev/install.ps1 | iex ``` The installer does these steps: 1. It opens your browser to sign you in. Use GitHub, Google, or a code that boat sends by email. 2. It asks if the sandboxes are for you or for your users. 3. It opens checkout for a plan. Your first plan starts with a 7-day [free trial](/free-trial). A card is required. Then **open a new terminal**. The installer adds a shell function, and only a new terminal loads it. ## 2. Start a sandbox ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new ``` `boat new` prints the id of the sandbox, for example `bx_23456789`. | Property | Value | | - | - | | Type | Full Linux virtual machine (Ubuntu) | | Size | `default`: 4 vCPU, 8 GB. Read [Pricing](/pricing) for the other sizes. | | Installed | Docker, Node, Python, Go, Rust and the usual coding agents | | Auto-stop | After one hour, unless you set a different time | ## 3. Use it ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_23456789 "echo hello" # run a command, get its output boat ssh bx_23456789 # open a shell inside boat stop bx_23456789 # take a snapshot and stop billing boat resume bx_23456789 # bring it back ``` * Instead of the id, you can type `current`. It means the last sandbox that you created or forked in this terminal. * Without an id, `boat ssh` and `boat exec` also use `current`. ### Run a coding agent `boat prompt` runs Claude Code, Codex or another [integrated agent](/integrated-agents) inside the sandbox. **Connect an AI key or subscription first.** Read [Keys and subscriptions](/integrated-agents/keys). Without one, the prompt fails with `provider_not_configured`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt bx_23456789 "add tests" ``` > [card] [Integrated agents](/integrated-agents) > > Claude Code, Codex and the other agents you can prompt in a sandbox. > [card] [Connect a key or subscription first](/integrated-agents/keys) > > Add an AI key, or sign in with a subscription, before your first prompt. > [card] [Run an agent on your repo](/recipes/agent-on-repo) > > Clone a repository and let an agent work on it. > [card] [Run agents in parallel](/recipes/parallel-agents) > > Fork one sandbox into many and prompt each one. ## From code 1. Install the SDK, or use curl: ```bash Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} python -m pip install boat-sdk ``` ```bash TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} npm install @boatdev/sdk ``` 2. Create an [API key](/api-keys). The `ci` preset can create, use and delete sandboxes: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat api-key create my-app --preset ci export BOAT_API_KEY=boat_... # the secret that the command prints once export BOAT_API_BASE=https://boat.dev/api/v1 ``` 3. Create a sandbox and run a command in it: ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} id=$(curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"ttlSeconds":3600}' | jq -r .sandbox.id) curl -sS -X POST "$BOAT_API_BASE/sandboxes/$id/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"echo hello"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { BoatApi, Configuration, waitUntilReady, execCommand } from "@boatdev/sdk"; const boat = new BoatApi(new Configuration({ basePath: "https://boat.dev/api/v1", accessToken: process.env.BOAT_API_KEY!, })); const created = await boat.create({ ttlSeconds: 3600 }); const id = created.sandbox.id; await waitUntilReady(boat, id); const result = await execCommand(boat, id, "echo hello"); console.log(result.stdout); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import os from boat_sdk import ApiClient, Configuration, wait_until_ready, exec_command from boat_sdk.api.boat_api import BoatApi from boat_sdk.models.create_sandbox_request import CreateSandboxRequest config = Configuration(host="https://boat.dev/api/v1", access_token=os.environ["BOAT_API_KEY"]) with ApiClient(config) as client: boat = BoatApi(client) created = boat.create(create_sandbox_request=CreateSandboxRequest(ttl_seconds=3600)) sandbox_id = created.sandbox.id wait_until_ready(boat, sandbox_id) result = exec_command(boat, sandbox_id, "echo hello") print(result.actual_instance.stdout) ``` `boat` in the code is the API client, not a sandbox. A command that waits for its result stops after 30 seconds by default. For longer work, read [Background commands](/long-running-tasks/background-commands). ## Next > [card] [Pricing](/pricing) > > The cost per hour of each size, and what a plan gives you. > [card] [Integrated agents](/integrated-agents) > > Run Claude Code, Codex and other agents in a sandbox. > [card] [Environments](/environments) > > The repositories, secrets and credentials that each new sandbox starts with. > [card] [Keep a sandbox running](/long-running-tasks) > > Keep a sandbox up for days. Resume and fork it. > [card] [Sandbox per user](/platform-guide) > > Give each user or agent a sandbox of their own. > [card] [API and SDKs](/api/v1) > > Auth, envelopes, errors, and the typed Python and TypeScript clients. > [card] [Docs for AI agents](/ai-tools) > > Give your coding agent these docs: llms.txt, Markdown pages and skills. > [card] [Limits and errors](/limits) > > Every limit per plan, the error codes, and how to raise a limit. # Readiness and resume speed Source: https://docs.boat.dev/readiness What ready means, what already works at ready, what comes a few seconds later (Docker, services, system files), and how to wait for each in a script. A sandbox is **ready** when the API reports its state as `ready`, `idle` or `running`. From then on, commands, SSH and prompts work at once. `boat new`, `boat fork` and `boat resume` return when the sandbox is ready and a first command works. In a script, you can run your next command right after them. ## Ready, in one table | State (API) | CLI and dashboard show | Commands | Billed | | - | - | - | - | | `provisioning` | `provisioning` | Wait (see below) | No | | `provisioned` | `starting` | Wait (see below) | Yes | | `cloning` | `cloning` | Wait (see below) | Yes | | `ready`, `idle`, `running` | same | **Run at once** | Yes | | `archiving` | `stopping` | Refused | No | | `archived` | `stopped` | Refused | No | | `error` | `error` | Refused | No | > [!NOTE] > > The CLI and the dashboard show `provisioned` as `starting`. At `provisioned`, the machine is up, but boat still applies your environment, secrets and repositories. A command that you send while the sandbox starts does not fail. The API holds it for up to 60 seconds and runs it when the sandbox is ready. After 60 seconds, it answers `409 sandbox_starting`. Send it again. A command sent to a stopped sandbox, or to one in `error`, fails with `409 sandbox_not_ready`. Resume the sandbox first. ## What works at ready | Part | At `ready` | | - | - | | Commands, SSH, prompts | Work | | Environment variables and secret files | Set | | Files in `/home/user` | All visible. Content downloads in the background. A read of a file waits for that file only | | Repositories of the environment | Cloned | | Public URLs | Normally open. A port can answer a moment later | | The IP address | New. It changes at every resume and fork | ## What comes a few seconds after ready On a resume, a fork or a deploy from a saved snapshot, boat restores in the background. These parts come after `ready`: | Part | When | How to wait for it | | - | - | - | | Your changes in `/usr`, `/etc`, `/opt`, `/var`, `/srv`, `/root` | Visible at `ready`, like `/home/user`. A read of a file waits for that file only. The content is on the local disk a few seconds later. Files that a program opened before then keep working | Nothing to do. To wait for all of it, wait for Docker or your service, below | | Docker and your containers | A few seconds after `ready`. The containers you had come back, and the ones that ran start again. Boat does not run `docker compose up`, build images or wait for health checks | `docker info` answers | | Docker images | Loaded in the background after `ready`. They usually appear in `docker images` about 2 seconds later. No docker command waits for them. An image you build, pull or tag before they load stays yours | Nothing to do | | Systemd services that you enabled | After the system files | `systemctl is-active <service>` | | Repository setup scripts | They start at `ready`, at every start | Wait for what the script makes, for example a file or a port. Read [Setup scripts](/setup) | | Per-sandbox setup script (`--setup-file`) | It starts after `ready`, one time | `setupStatus` in `boat info` is `done` or `failed` | | The rest of the file content | In the background | `hydrated` is `true`, or the `sandbox.hydrated` webhook | A new sandbox, made with `boat new` and no `--from`, restores nothing. Docker and services start with the machine. Some users see the first outbound connection fail in the first second after `ready`. Retry a failed first connection. ## Wait in a script The common case needs no wait. Run your command after `boat new` or `boat resume`: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} ID=$(boat new --json | jq -r 'select(.event == "ready") | .id') boat exec "$ID" "cd my-repo && npm test" ``` Wait for Docker: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec "$ID" --timeout 120 "until docker info >/dev/null 2>&1; do sleep 1; done" ``` Wait for a systemd service: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec "$ID" --timeout 120 "until systemctl is-active --quiet my-app; do sleep 1; done" ``` Wait until every file is downloaded: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} until [ "$(boat info "$ID" --json | jq -r .sandbox.hydrated)" = "true" ]; do sleep 2; done ``` With the API, poll `GET /sandboxes/{sandboxId}` and read `sandbox.state` and `sandbox.hydrated`. Or subscribe to the `sandbox.ready` and `sandbox.hydrated` [webhooks](/webhooks). Wait for a stop: `boat stop` returns at `stopping`. Poll `boat info` until the state is `stopped`. Read [Wait for the stop in a script](/snapshots/stop#wait-for-the-stop-in-a-script). ## How fast a sandbox comes back A resume, a fork or a deploy is ready in **a few seconds, whatever the size of the disk**. You see all your files at once. boat downloads their content in the background. | What | What happens | | - | - | | Every resume, fork and deploy | It runs on a new machine. boat downloads your files again in the background, even if the sandbox had all its files before the stop. `hydrated` is `false` until the download ends. | | During the download | `GET /v1/sandboxes/{id}` returns `hydration`: the step, `entriesDone` of `entriesTotal` (files, folders and links) and a `percent`. Use `hydrated` as the end signal, not `percent`. | | A file that is not downloaded yet | When you open or read it, boat gets that file first. Then you get the right bytes. | | End of the download | `hydrated` becomes `true`, `hydratedAt` is set, and the `sandbox.hydrated` webhook fires. Docker volumes move to the local disk at this point. | | Files of the base image | They are already on every machine. boat downloads only the files that differ from the image. | | Paths in `.boatignore` | boat does not save them, so it does not download them. Read [Leave files out](/snapshots/whats-saved#leave-files-out-with-boatignore). | | A resume during `stopping` | boat takes back the same machine. Nothing is downloaded. | A restore does not need space for a second copy of your disk. boat removes each downloaded part when it has used it. The [restore limits of each machine](/machines) count the size of your files, not the smaller download size. Permissions, owners, times and extended attributes come back with your files and folders. Two of them come back later: * **Extended attributes of a file** come back when the content of that file arrives. Folders have theirs from the start. * **Folder modification times** come back when the download ends. Each new file in a folder changes the time of that folder, so boat sets the time last. Inode numbers and change times (`ctime`) are new on the new machine. Git keeps them in its index, so boat updates the Git index of each repository under `/home/user` (up to 4 folders deep) when the sandbox starts. Your first `git status` or `git switch` then does not read every file again. boat also downloads each `.git` folder first. If a Git command already runs, boat leaves that repository alone. The time to a working app depends on what your app reads first. Large first reads, Docker images and services that start late add seconds. The next section makes the first start faster. ## Make the first start faster When a sandbox starts from a snapshot, it records which files open first. It keeps this list in `~/.ascii/playbook.json`. At the next start, boat downloads these files first. Your app then works before the rest of the disk arrives. `ready` does not wait for these files. The list is a normal file. It goes into the snapshot, so forks and deploys get it too. **A saved snapshot learns from its deploys.** Each sandbox that you create `from` a saved snapshot of your account or org records the files it opens while it starts. When its download ends, boat keeps that list with the saved snapshot. The next sandboxes that you create from the same name download these files first. You do nothing for this: the list follows what your sandboxes really open, and it stays when you save the name again. Sandboxes that another account creates with a share code use the list, but they do not change it. To give a brand-new saved snapshot a list before its first deploy, record it yourself. The list is recorded **only while a sandbox starts from a snapshot**. Do these steps in this order: **1. Start the sandbox from a snapshot** Resume a stopped sandbox, or deploy one from the saved snapshot that you want to update. A new, empty sandbox has nothing to record. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat resume bx_f7k2q9hd ``` **2. Start your app at once** Run your normal start command at once, while files still download. boat records each file that your app opens, in order. boat does not record files that open after the download ends. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_f7k2q9hd --detach "cd my-repo && npm run dev" ``` **3. Wait for the download to end, then save** boat writes the list when the download ends. Save after that. If you save too early, the saved snapshot does not have this run. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} until [ "$(boat info bx_f7k2q9hd --json | jq -r .sandbox.hydrated)" = "true" ]; do sleep 2; done boat snapshot bx_f7k2q9hd web-stack ``` Each run adds to the list. It does not replace it. The newest run counts most. Each time you repeat these steps, the saved snapshot starts a little faster. The list holds the first 20,000 paths. # Run a coding agent on your repo Source: https://docs.boat.dev/recipes/agent-on-repo Step by step: connect GitHub and an AI key, clone your repository into a sandbox, and let Claude Code or Codex work on it. You get a sandbox with your repository cloned in it, and an agent that works on it. It takes five steps. ## Before you start * The `boat` CLI is installed and signed in. Read [Quickstart](/quickstart). * Your account has GitHub connected. If you signed in with Google or an email code, open [Dashboard > Environment](https://boat.dev/dashboard?tab=environment) and click **Connect GitHub**. ## 1. Connect an AI key or subscription Open [Agents & Proxying](https://boat.dev/dashboard?tab=agents). Sign in to Claude (Pro or Max) or ChatGPT, or paste an API key. Do this one time. Without this step, the first prompt fails with `409 provider_not_configured`. For all options, read [Keys and subscriptions](/integrated-agents/keys). ## 2. Add the repository to your environment ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env add-repo base acme/web-app --branch main ``` `base` is your default environment. Every new sandbox on it clones `acme/web-app` into `/home/user/web-app`. Private repositories work. ## 3. Let the environment pass your GitHub access and AI keys ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env set base --safe-for-third-parties false --github true --agents-credentials true ``` * `--github true` lets the sandbox clone and push with your GitHub access. * `--agents-credentials true` gives the agents the keys from step 1. * **Safe for third parties** withholds all your secrets: variables, secret files, GitHub access and AI credentials. Turn it on only for sandboxes that other people use. ## 4. Start a sandbox ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new ``` The command prints the sandbox id, for example `bx_f7k2q9hd`. Check that the repository is there: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_f7k2q9hd 'ls /home/user/web-app && git -C /home/user/web-app status' ``` The repository setup script, if you set one, runs at each start. Setup scripts are set on the dashboard only. Read [Setup scripts](/setup). ## 5. Give the agent a task ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt bx_f7k2q9hd --provider claude "Fix the failing tests, then commit on a new branch fix/tests and push it" ``` * The command prints what the agent does, and exits when the turn ends. * Use `--provider codex` for Codex. Omit `--provider` to use your default harness. * With one repository, the agent starts inside the repository folder. * To send more work in the same thread, run `boat prompt bx_f7k2q9hd "…"` again. The agent keeps its memory. * To change the task while it works, run `boat steer bx_f7k2q9hd "…"`. Read [Steer a running turn](/integrated-agents/steering). ## After the task | You want | Command | | - | - | | Watch the work from another terminal | `boat events bx_f7k2q9hd --follow` | | Look at the changes yourself | `boat ssh bx_f7k2q9hd` | | More time than the 1-hour auto-stop | `boat extend bx_f7k2q9hd --hours 6`. A running prompt also moves the deadline by itself | | Stop and keep the disk | `boat stop bx_f7k2q9hd`. `boat resume` brings back the files and the conversation | ## Next * [Run many agents in parallel](/recipes/parallel-agents) * [Customize the harness: rules, MCP, skills](/integrated-agents/customize) * [Repositories](/environments/repositories) # Run many agents in parallel Source: https://docs.boat.dev/recipes/parallel-agents Fork one prepared sandbox into N copies and give each copy its own agent task, from the CLI or Python. Stay under the start limits. Prepare one sandbox, fork it N times, and prompt each fork. Each agent gets its own disk, processes and IP address. They do not interfere. To run a few tasks on one sandbox instead, use [parallel conversations](/integrated-agents/conversations#parallel-conversations). They share one disk and one desktop. ## Watch the start limits Each fork counts as one start. Above a limit, boat refuses the fork with `429 rate_limited`. The answer names the `window` that you hit. | Plan | Starts per minute / hour / day | Sandboxes at once | | - | - | - | | \$20 | 12 / 60 / 200 | 100 | | \$100 | 30 / 210 / 840 | 300 | | \$500 | 65 / 420 / 1,680 | 1,000 | | \$2000 | 90 / 600 / 2,400 | 2,000 | | [Free trial](/free-trial) | 5 / 25 / 75 | 2 | * An organization on the \$2000 plan gets these limits times its number of seats. Below it, each extra seat adds 20%. * Pace your forks below the per-minute limit. The examples below wait 6 seconds between forks, which fits the \$20 plan. Read [Limits and errors](/limits) for every limit and how to raise it. ## 1. Prepare the source sandbox ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new boat exec bx_f7k2q9hd --cwd web-app --timeout 600 "npm ci" boat stop bx_f7k2q9hd ``` A fork copies the newest snapshot of its source. Stop the source first, so that its snapshot has your last change. A fork of a running sandbox can miss the writes of the last minute. The source needs your AI keys. Read [Run a coding agent on your repo](/recipes/agent-on-repo) for the environment settings. ## 2. Fork N copies and prompt each one ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} source=bx_f7k2q9hd tasks=("Fix issue 101" "Fix issue 102" "Fix issue 103" "Fix issue 104") for task in "${tasks[@]}"; do id=$(boat fork "$source" --ttl 7200 --json | jq -r .id) echo "$id" >> forks.txt boat prompt "$id" "$task" > "$id.log" 2>&1 & # runs in the background sleep 6 # stay under the start limit done wait # every agent is done ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import os, time, uuid from boat_sdk import ApiClient, Configuration, wait_until_ready, wait_for_prompt from boat_sdk.api.boat_api import BoatApi from boat_sdk.exceptions import ApiException from boat_sdk.models.fork_request import ForkRequest from boat_sdk.models.prompt_request import PromptRequest config = Configuration(host="https://boat.dev/api/v1", access_token=os.environ["BOAT_API_KEY"]) source = "bx_f7k2q9hd" tasks = ["Fix issue 101", "Fix issue 102", "Fix issue 103", "Fix issue 104"] with ApiClient(config) as client: sandbox = BoatApi(client) runs = [] for task in tasks: key = str(uuid.uuid4()) # the same key on a retry never makes a second fork while True: try: forked = sandbox.fork( sandbox_id=source, fork_request=ForkRequest(ttl_seconds=7200), idempotency_key=key, ) break except ApiException as exc: if exc.status != 429: raise time.sleep(10) # start limit hit: wait, then retry with the same key wait_until_ready(sandbox, forked.id) queued = sandbox.prompt(forked.id, PromptRequest(prompt=task)) runs.append((forked.id, queued.prompt_id)) time.sleep(6) # stay under the start limit for sandbox_id, prompt_id in runs: run = wait_for_prompt(sandbox, sandbox_id, prompt_id) print(sandbox_id, run.status) ``` * `--ttl 7200` gives each fork a 2-hour auto-stop. A fork never copies the auto-stop setting of its source. A running prompt moves the deadline by itself. * `Idempotency-Key` makes a retry safe. Without it, a retry after a lost answer can make a second fork that you pay for. * Prompts queue while a fork starts. You do not have to wait for `ready` before a prompt. The Python example waits only to fail early on a bad fork. ## 3. Collect the results and clean up Each `<id>.log` file holds the work of one agent. Then read the result in each fork and stop or delete it: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} while read -r id; do boat exec "$id" --cwd web-app "git log --oneline -1" done < forks.txt boat stop bx_k3v9x2mq # keep the disk of a fork; boat resume brings it back boat delete bx_p8w4z7nc --yes # erase a fork that you do not need ``` A fork that you do not stop stops by itself at its auto-stop deadline. ## Related * [Resume and fork](/snapshots/resume-and-fork) * [Use a saved snapshot as a template](/platform-guide/templates-and-sizing) * [Stream events](/integrated-agents/conversations#stream-events) # SDKs Source: https://docs.boat.dev/sdks/overview Use boat from Python or TypeScript: install, configure, and a complete create, run, stop example. Other languages: generate a client from the OpenAPI file. | SDK | Package | Method names | | - | - | - | | [Python](/sdks/python) | `boat-sdk` on PyPI | snake_case, synchronous | | [TypeScript / JavaScript](/sdks/typescript) | `@boatdev/sdk` on npm | camelCase, `async` | Each SDK covers the full [HTTP API](/api/v1): sandboxes, commands, files, public URLs, snapshots, saved snapshots, environments, integrated agents, webhooks and API keys. > [!NOTE] > > Used the `box` SDKs before? Read [Migrating from Box](/migrating-from-box). ## Install ```bash Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} python -m pip install boat-sdk ``` ```bash TypeScript / JavaScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} npm install @boatdev/sdk ``` ## Configure 1. Create an API key: `boat api-key create my-app --preset ci`, or use the [dashboard](https://boat.dev/dashboard?tab=api-keys). The key starts with `boat_`. 2. Store it as `BOAT_API_KEY`. 3. Give it to the `Configuration` object. The base URL is `https://boat.dev/api/v1`. ## Create, run a command, stop ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import os from boat_sdk import ApiClient, Configuration, wait_until_ready from boat_sdk.api.boat_api import BoatApi from boat_sdk.models import CommandRequest, CreateSandboxRequest config = Configuration(host="https://boat.dev/api/v1", access_token=os.environ["BOAT_API_KEY"]) with ApiClient(config) as client: boat = BoatApi(client) sandbox_id = boat.create(create_sandbox_request=CreateSandboxRequest(ttl_seconds=1800)).sandbox.id try: wait_until_ready(boat, sandbox_id) out = boat.command(sandbox_id, CommandRequest(command="echo hi")).actual_instance print(out.exit_code, out.stdout) finally: boat.stop(sandbox_id) ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { BoatApi, Configuration, waitUntilReady } from "@boatdev/sdk"; import type { CommandResponse } from "@boatdev/sdk"; const boat = new BoatApi(new Configuration({ basePath: "https://boat.dev/api/v1", accessToken: process.env.BOAT_API_KEY!, })); const sandboxId = (await boat.create({ ttlSeconds: 1800 })).sandbox.id; try { await waitUntilReady(boat, sandboxId); const out = (await boat.command({ sandboxId, command: "echo hi" })) as CommandResponse; console.log(out.exitCode, out.stdout); } finally { await boat.stop({ sandboxId }); } ``` Next: stream output, commands with no time limit, one job with its cost, folder copies, files, public URLs, forks and prompts are on the [Python](/sdks/python) and [TypeScript](/sdks/typescript) pages. ## Other languages boat publishes SDKs for Python and TypeScript only. For another language, generate a client from the OpenAPI file with [OpenAPI Generator](https://openapi-generator.tech): ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} npx @openapitools/openapi-generator-cli generate \ -i https://docs.boat.dev/openapi/boat-v1.yaml -g go -o ./boat-go ``` > [!WARNING] > > Keep these values secret: API keys, environment secrets, SSH keys, and the desktop, VNC and signed file URLs that boat returns. Do not log them without redaction. # Python SDK Source: https://docs.boat.dev/sdks/python Install boat-sdk, create a sandbox, run a command and read stdout and the exit code, stream output, run background jobs, move files, prompt agents. Every method, by group. Install the package. It needs Python 3.9 or later: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} python -m pip install boat-sdk ``` On Windows, `python` can open the Microsoft Store. Use `py -m pip install boat-sdk` there. ## Create, run a command, stop This script creates a sandbox, runs a command, prints the output and the exit code, and stops the sandbox. Set `BOAT_API_KEY` first. See [API keys](/api-keys). ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import os from boat_sdk import ApiClient, Configuration, wait_until_ready from boat_sdk.api.boat_api import BoatApi from boat_sdk.models import CommandRequest, CreateSandboxRequest config = Configuration( host="https://boat.dev/api/v1", access_token=os.environ["BOAT_API_KEY"], ) with ApiClient(config) as client: boat = BoatApi(client) created = boat.create(create_sandbox_request=CreateSandboxRequest(ttl_seconds=1800)) sandbox_id = created.sandbox.id try: wait_until_ready(boat, sandbox_id) result = boat.command(sandbox_id, CommandRequest(command="echo hi && uname -a")) out = result.actual_instance print(out.exit_code) print(out.stdout) finally: boat.stop(sandbox_id) ``` Three rules make this work: * Pass the request body by keyword: `create(create_sandbox_request=...)`. The first positional argument of `create` is the idempotency key. * `command()` returns a wrapper. Read the result from `.actual_instance`. It is a `CommandResponse` for a normal command, and a `CommandStartedResponse` for `detached=True`. * `wait_until_ready` is a module function. It is not a method of `boat`. To delete the sandbox and its snapshots instead of a stop, call `boat.delete_sandbox(sandbox_id=sandbox_id, x_ascii_confirm_delete=sandbox_id)`. ## Configure ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import os from boat_sdk import ApiClient, Configuration from boat_sdk.api.boat_api import BoatApi config = Configuration( host=os.getenv("BOAT_API_BASE", "https://boat.dev/api/v1"), access_token=os.environ["BOAT_API_KEY"], # boat_... ) with ApiClient(config) as client: boat = BoatApi(client) ``` * Call every API method on `boat`. Method names are snake_case. * Request models are in `boat_sdk.models`. Import them from there: ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models import ( CommandRequest, CreateSandboxRequest, FileUrlRequest, ForkRequest, HostPortRequest, SavedSnapshotSaveRequest, PromptRequest, ResumeRequest, SteerRequest, StopRequest, UpdateSandboxRequest, ) ``` * Helper functions are in `boat_sdk`: `wait_until_ready`, `wait_until_idle`, `wait_for_desktop`, `wait_for_prompt`, `wait_for_prompt_done`, `stream_events`, `stream_prompt`, `stop_and_remove`, `read_text`, `write_text`, `exec_command`, `stream_command`, `run_command`, `follow_command`. Each takes `boat` as its first argument. ### asyncio The client is synchronous. In asyncio code, run each call in a thread with `asyncio.to_thread`: ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import asyncio from boat_sdk import exec_command async def run(boat, sandbox_id: str, command: str): result = await asyncio.to_thread(exec_command, boat, sandbox_id, command) return result.actual_instance async def run_many(boat, sandbox_ids: list[str]): return await asyncio.gather(*(run(boat, sid, "pytest -q") for sid in sandbox_ids)) ``` ## Run commands A synchronous command times out after 30 seconds by default. Set `timeout_seconds` up to 600. For a longer command, use [`run_command`](#run-a-command-with-no-time-limit). A command sent while the sandbox starts waits up to 60 seconds. ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk import exec_command from boat_sdk.models import CommandRequest result = boat.command(sandbox_id, CommandRequest(command="npm test", cwd="my-repo", timeout_seconds=600)) out = result.actual_instance print(out.exit_code, out.timed_out) print(out.stdout, out.stderr) # Same call. It also resends a command that the sandbox refused while it restored its disk. out = exec_command(boat, sandbox_id, "python3 -c 'print(6*7)'").actual_instance ``` ### Stream the output `stream_command` yields the output as the command writes it. Each frame is a dict. ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk import stream_command for frame in stream_command(boat, sandbox_id, "npm test", cwd="my-repo", timeout_seconds=600): if frame["type"] in ("stdout", "stderr"): print(frame["data"], end="") elif frame["type"] == "exit": print("exit code:", frame["exitCode"]) elif frame["type"] == "error": print("error:", frame["message"]) ``` ### Run a command with no time limit `run_command` has no 600-second limit. It starts the command in the background, then yields its output until the command ends. It reconnects by itself, with no gap and no repeat. ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk import run_command for frame in run_command(boat, sandbox_id, "npm run test:e2e", cwd="my-repo"): if frame["type"] in ("stdout", "stderr"): print(frame["data"], end="") elif frame["type"] == "exit": print("exit code:", frame["exitCode"]) elif frame["type"] == "error": print("error:", frame["message"]) ``` * The first frame is `{"type": "started", "processId": ...}`. * A loop that stops early leaves the command running. Stop it with `boat.stop_command(sandbox_id, process_id)`. * `follow_command(boat, sandbox_id, process_id)` follows a command that you started with `detached=True`. ### Run a server in the background A detached command returns at once with a process id. It keeps running after the call. Use it for servers, and to poll a job yourself. ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import time from boat_sdk.models import CommandRequest started = boat.command(sandbox_id, CommandRequest(command="npm run build", detached=True)) process_id = started.actual_instance.process_id while True: status = boat.command_status(sandbox_id, process_id) if not status.running: break time.sleep(2) print(status.status, status.exit_code) print(status.stdout) ``` * `attach_command(sandbox_id, process_id)` streams the output of a detached command. * `stop_command(sandbox_id, process_id)` stops it and every process that it started. * `command_history(sandbox_id)` and `command_logs(sandbox_id, command_id)` read past commands, also while the sandbox is stopped. See [Command history](/long-running-tasks/command-history). ## Files Small text files: ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk import read_text, write_text write_text(boat, sandbox_id, "notes/result.txt", "done\n") print(read_text(boat, sandbox_id, "notes/result.txt")) ``` Paths are relative to `/home/user`. `read_file` and `write_file` also accept `encoding="base64"` for binary content. For a file of any size, get a signed URL. Then send the bytes with any HTTP client: ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import urllib.request from boat_sdk.models import FileUrlRequest up = boat.create_upload_url(sandbox_id, FileUrlRequest(path="data/input.csv")) with open("input.csv", "rb") as f: urllib.request.urlopen(urllib.request.Request(up.url, data=f.read(), method=up.method)) down = boat.create_download_url(sandbox_id, FileUrlRequest(path="data/input.csv")) with urllib.request.urlopen(down.url) as resp: data = resp.read() ``` The URLs expire. Treat them as secrets. ### Copy a local folder in Pack the folder, upload it, unpack it on the sandbox. In a git checkout, send the files that git tracks and the new files that `.gitignore` does not exclude. `node_modules` and build output stay out. ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import io import os import subprocess import tarfile import urllib.request from boat_sdk import exec_command from boat_sdk.models import FileUrlRequest def push(boat, sandbox_id: str, folder: str, remote: str = "repo"): listed = subprocess.run( ["git", "ls-files", "-z", "--cached", "--others", "--exclude-standard"], cwd=folder, capture_output=True, check=True, ).stdout.decode().split("\0") packed = io.BytesIO() with tarfile.open(fileobj=packed, mode="w:gz") as tar: for name in listed: path = os.path.join(folder, name) # Skip a file that git tracks but that you deleted, and a submodule (a directory entry). if name and os.path.lexists(path) and (os.path.islink(path) or not os.path.isdir(path)): tar.add(path, arcname=name, recursive=False) up = boat.create_upload_url(sandbox_id, FileUrlRequest(path="push.tgz")) urllib.request.urlopen(urllib.request.Request(up.url, data=packed.getvalue(), method=up.method)) command = f"mkdir -p {remote} && tar xzf push.tgz -C {remote} && rm push.tgz" exec_command(boat, sandbox_id, command, timeout_seconds=600) ``` The archive keeps the exec bit and keeps links as links. It skips submodules. `boat push <id> <dir>` in the CLI also copies submodules. ## Run one job and delete the sandbox Create a sandbox, copy the code in, run one command, read the cost, delete the sandbox. This is what `boat run` does in the CLI. ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk import run_command, wait_until_ready from boat_sdk.models import CreateSandboxRequest created = boat.create(create_sandbox_request=CreateSandboxRequest(var_from="ci-base", type="large", ttl_seconds=3600)) sandbox_id = created.sandbox.id code = None try: wait_until_ready(boat, sandbox_id) push(boat, sandbox_id, ".") for frame in run_command(boat, sandbox_id, "npm ci && npm test", cwd="repo"): if frame["type"] in ("stdout", "stderr"): print(frame["data"], end="") elif frame["type"] == "exit": code = frame["exitCode"] usage = boat.usage(sandbox_id) print(f"exit {code} · {usage.seconds}s · {usage.sandbox_type} · ${usage.dollars:.4f}") finally: boat.delete_sandbox(sandbox_id=sandbox_id, x_ascii_confirm_delete=sandbox_id) raise SystemExit(code if isinstance(code, int) else 1) ``` * The script exits with the exit code of the command, so a failed test fails the CI job. * `ttl_seconds` stops the sandbox if your script dies before the delete. Set it above your longest job. * `usage()` gives the machine time and the cost of one sandbox. It also works after a stop. ## Public URL for a port Start the server detached, then expose its port: ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models import CommandRequest, HostPortRequest boat.command(sandbox_id, CommandRequest(command="python3 -m http.server 8000", detached=True)) hosted = boat.host_port(sandbox_id, HostPortRequest(port=8000, public=True)) print(hosted.url) # https://<sandbox>-8000.on.boat.dev ``` Without `public=True`, the URL is private and carries a `_token`. See [Public URLs](/hosting). ## Machine size Pass `type`: `small`, `default` (the medium size), `large` or `xlarge`. `xlarge` needs the \$100 plan or higher. The [free trial](/free-trial) allows only `small` and `default`. ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} created = boat.create(create_sandbox_request=CreateSandboxRequest(type="large", ttl_seconds=3600)) info = boat.get(created.sandbox.id) print(info.sandbox.type, info.sandbox.vcpu, info.sandbox.memory_gb) ``` A fork gets the size of its source. To change the size of a sandbox, stop it, then resume it with `ResumeRequest(type=...)`. See [Sandbox sizes](/machines) and [Pricing](/pricing). To know which types your account can create now, read `limits()`. A blocked type carries the reason: ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} for t in boat.limits().machine_types: print(t.type, "ok" if t.available else t.reason) ``` ## Per-sandbox environment variables Pass `env`. The values come on top of the [environment](/environments) of the sandbox. A per-sandbox value wins over a variable with the same name. The maximum is 100 variables and 64 KB in total. ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} created = boat.create(create_sandbox_request=CreateSandboxRequest( ttl_seconds=3600, env={"DATABASE_URL": "postgres://user:pass@host:5432/app", "FEATURE_FLAG": "1"}, )) ``` A fork gets the `env` of its source, unless you give the fork its own `env`. ## No-env sandboxes For a sandbox that you give to your own users, set `no_env=True`. boat then gives it none of your secrets: model keys, GitHub token, environment variables, secret files and SSH identity. SSH, desktop, snapshots, public URLs and forks still work. A fork of a no-env sandbox is always no-env. ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} created = boat.create(create_sandbox_request=CreateSandboxRequest(ttl_seconds=1800, no_env=True)) boat.resume(sandbox_id, ResumeRequest(no_env=True)) forked = boat.fork(sandbox_id, fork_request=ForkRequest(no_env=True)) ``` ## Saved snapshots and forks Save a sandbox under a name. Then start new sandboxes from it. Use a saved snapshot as a template for many sandboxes: ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import time import uuid from boat_sdk.models import CreateSandboxRequest, ForkRequest, SavedSnapshotSaveRequest boat.save_saved_snapshot(SavedSnapshotSaveRequest(sandbox_id=sandbox_id, name="web-stack")) while boat.get_saved_snapshot("web-stack").snapshot.status not in ("ready", "failed"): time.sleep(5) created = boat.create( idempotency_key=str(uuid.uuid4()), create_sandbox_request=CreateSandboxRequest(var_from="web-stack", ttl_seconds=900), ) ``` * The Python field for `from` is `var_from`, because `from` is a Python keyword. * Send `idempotency_key` to make a create or a fork safe to retry. See [Idempotent sandbox creation](/api/v1#idempotent-sandbox-creation). A fork copies the newest snapshot of a sandbox into a new sandbox: ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} forked = boat.fork(sandbox_id, fork_request=ForkRequest(ttl_seconds=900)) fork_id = forked.sandbox.id ``` A fork of a running sandbox uses its last background snapshot. Files written after that snapshot can be missing. See [Saved snapshots](/snapshots/templates) and [Resume and fork](/snapshots/resume-and-fork). ## Prompt an integrated agent Connect a key or a subscription on the dashboard (Agents & Proxying) first. Without it, `prompt` raises `ApiException` with status 409 and code `provider_not_configured`. ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk import wait_for_prompt from boat_sdk.models import PromptRequest, SteerRequest queued = boat.prompt(sandbox_id, PromptRequest(provider="codex", prompt="Run the tests and fix the failures.")) # Add an instruction to the running turn without stopping it: boat.steer(sandbox_id, SteerRequest(message="Skip the integration tests.")) run = wait_for_prompt(boat, sandbox_id, queued.prompt_id) print(run.status) events = boat.events(sandbox_id, limit=50, type="prompt,response") for event in events.events: print(event.type, event.conversation_id) ``` * `provider` is one of 7 harnesses: `codex`, `claude-code` (alias `claude`), `pi`, `opencode`, `prime-agent` (alias `prime`), `kimi` and `mistral`. Omit it to use the default from the dashboard. * A sandbox runs [many conversations in parallel](/integrated-agents). Pass `new=True` for a new one, or `conversation_id` to continue one. * To know when a prompt is done, use `wait_for_prompt`. Do not guess from the sandbox state. * `interrupt(sandbox_id)` discards the running turn. `steer` keeps it running. ### Stream the agent's work `stream_prompt` queues a prompt and yields its events. `stream_events` follows all the events of a sandbox. ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk import stream_prompt from boat_sdk.models import PromptRequest for event in stream_prompt(boat, sandbox_id, PromptRequest(provider="codex", prompt="Run pwd and ls.")): if event.type != "response": continue data = event.data content = data.get("content") if isinstance(data, dict) else getattr(data, "content", "") if content: print(content, end="") ``` ## Browse a stopped sandbox Snapshot reads do not need the machine. They work while the sandbox is stopped: ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} latest = boat.get_latest_sandbox_snapshot(sandbox_id) tree = boat.get_snapshot_tree(latest.snapshot.id) data = boat.get_snapshot_file(latest.snapshot.id, path="projects/app/.env") ``` ## Errors Methods raise `ApiException` for a non-2xx response. Log the status and the body. Redact API keys, secrets, SSH keys and desktop URLs. ```python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import json from boat_sdk.exceptions import ApiException try: boat.get("bx_missing") except ApiException as exc: print(exc.status) print(json.loads(exc.body)["code"]) ``` The codes and the retry rules are on [API overview](/api/v1#error-model) and [Limits](/limits). ## Methods Pass path parameters by position or keyword. Pass request bodies and optional parameters by keyword. The list comes from the [OpenAPI file](/openapi/boat-v1.yaml). ### Sandboxes | Method | Endpoint | Does | | - | - | - | | `sandboxes(org=None, x_boat_org=None, limit=None, cursor=None, sort=None, state=None)` | `GET /sandboxes` | List sandboxes | | `create(idempotency_key=None, org=None, x_boat_org=None, create_sandbox_request=None)` | `POST /sandboxes` | Create sandbox | | `get(sandbox_id)` | `GET /sandboxes/{sandboxId}` | Get sandbox | | `update(sandbox_id, update_sandbox_request)` | `PATCH /sandboxes/{sandboxId}` | Update sandbox | | `delete_sandbox(x_ascii_confirm_delete, sandbox_id)` | `DELETE /sandboxes/{sandboxId}` | Delete sandbox | | `stop(sandbox_id, stop_request=None)` | `POST /sandboxes/{sandboxId}/stop` | Stop sandbox | | `share(sandbox_id)` | `POST /sandboxes/{sandboxId}/share` | Share sandbox with the organization | | `recover(sandbox_id)` | `POST /sandboxes/{sandboxId}/recover` | Deprecated. Recover a sandbox that stopped responding | | `resume(sandbox_id, resume_request=None)` | `POST /sandboxes/{sandboxId}/resume` | Resume sandbox | | `fork(sandbox_id, idempotency_key=None, fork_request=None)` | `POST /sandboxes/{sandboxId}/fork` | Fork sandbox | | `get_stop(sandbox_id, stop_id)` | `GET /sandboxes/{sandboxId}/stops/{stopId}` | Get a stop | | `usage(sandbox_id, since=None, until=None)` | `GET /sandboxes/{sandboxId}/usage` | Get sandbox usage | ### Commands | Method | Endpoint | Does | | - | - | - | | `command(sandbox_id, command_request)` | `POST /sandboxes/{sandboxId}/commands` | Run a command | | `command_status(sandbox_id, process_id, tail_bytes=None, stdout_offset=None, stderr_offset=None)` | `GET /sandboxes/{sandboxId}/commands/{processId}` | Get command status | | `stop_command(sandbox_id, process_id)` | `DELETE /sandboxes/{sandboxId}/commands/{processId}` | Stop a detached command | | `attach_command(sandbox_id, process_id, stdout_offset=None, stderr_offset=None)` | `GET /sandboxes/{sandboxId}/commands/{processId}/stream` | Attach to a detached command | | `command_history(sandbox_id, mode=None, q=None, limit=None, cursor=None)` | `GET /sandboxes/{sandboxId}/command-history` | List the command and process history | | `get_command(sandbox_id, command_id)` | `GET /sandboxes/{sandboxId}/command-history/{commandId}` | Get one command from the history | | `command_logs(sandbox_id, command_id, stream=None, offset=None, limit=None, encoding=None)` | `GET /sandboxes/{sandboxId}/command-history/{commandId}/logs` | Read command logs | | `processes(sandbox_id)` | `GET /sandboxes/{sandboxId}/processes` | List the processes in a sandbox | ### Files and access | Method | Endpoint | Does | | - | - | - | | `read_file(sandbox_id, path, encoding=None)` | `GET /sandboxes/{sandboxId}/files` | Read a file | | `write_file(sandbox_id, file_write_request)` | `PUT /sandboxes/{sandboxId}/files` | Write a file | | `create_download_url(sandbox_id, file_url_request)` | `POST /sandboxes/{sandboxId}/files/download-url` | Get a download URL for a sandbox file | | `create_upload_url(sandbox_id, file_url_request)` | `POST /sandboxes/{sandboxId}/files/upload-url` | Get an upload URL for a sandbox file | | `artifact(sandbox_id, path)` | `GET /sandboxes/{sandboxId}/artifacts` | Download a file | | `desktop(sandbox_id, vnc=None, theme=None, desktop_request=None)` | `POST /sandboxes/{sandboxId}/desktop` | Get the desktop URL | | `host_port(sandbox_id, host_port_request)` | `POST /sandboxes/{sandboxId}/host` | Expose a port on a public URL | | `ssh_key(sandbox_id, ssh_key_request)` | `POST /sandboxes/{sandboxId}/sshkey` | Add an SSH key | ### Integrated agents | Method | Endpoint | Does | | - | - | - | | `prompt(sandbox_id, prompt_request)` | `POST /sandboxes/{sandboxId}/prompt` | Prompt the agent | | `events(sandbox_id, limit=None, cursor=None, sort=None, type=None, conversation=None)` | `GET /sandboxes/{sandboxId}/events` | List sandbox events | | `conversations(sandbox_id)` | `GET /sandboxes/{sandboxId}/conversations` | List conversations | | `prompt_run_status(sandbox_id, prompt_id)` | `GET /sandboxes/{sandboxId}/prompts/{promptId}` | Get prompt run status | | `steer(sandbox_id, steer_request, conversation=None)` | `POST /sandboxes/{sandboxId}/steer` | Steer a running turn (API) | | `interrupt(sandbox_id, conversation=None)` | `POST /sandboxes/{sandboxId}/interrupt` | Interrupt running work | ### Snapshots | Method | Endpoint | Does | | - | - | - | | `list_snapshots(limit=None, cursor=None, sort=None)` | `GET /snapshots` | List snapshots | | `list_sandbox_snapshots(sandbox_id, limit=None, cursor=None, sort=None)` | `GET /sandboxes/{sandboxId}/snapshots` | List snapshots of a sandbox | | `delete_sandbox_snapshots(sandbox_id, x_ascii_confirm_delete)` | `DELETE /sandboxes/{sandboxId}/snapshots` | Delete all snapshots of a sandbox | | `get_latest_sandbox_snapshot(sandbox_id)` | `GET /sandboxes/{sandboxId}/snapshots/latest` | Get the latest snapshot of a sandbox | | `delete_snapshot(snapshot_id, x_ascii_confirm_delete)` | `DELETE /snapshots/{snapshotId}` | Delete snapshot | | `get_snapshot_tree(snapshot_id)` | `GET /snapshots/{snapshotId}/tree` | Get snapshot file tree | | `get_snapshot_file(snapshot_id, path=None)` | `GET /snapshots/{snapshotId}/files` | Download a file or folder from a snapshot | | `get_snapshot_download(snapshot_id)` | `GET /snapshots/{snapshotId}/download` | Get snapshot download | ### Saved snapshots | Method | Endpoint | Does | | - | - | - | | `list_saved_snapshots()` | `GET /saved-snapshots` | List saved snapshots | | `save_saved_snapshot(saved_snapshot_save_request)` | `POST /saved-snapshots` | Save a saved snapshot | | `get_saved_snapshot(name)` | `GET /saved-snapshots/{name}` | Get a saved snapshot | | `delete_saved_snapshot(name)` | `DELETE /saved-snapshots/{name}` | Delete a saved snapshot | | `list_snapshot_shares(name)` | `GET /saved-snapshots/{name}/shares` | List share codes of a saved snapshot | | `create_snapshot_share(name)` | `POST /saved-snapshots/{name}/shares` | Share a saved snapshot | | `revoke_snapshot_share(name, share_id)` | `DELETE /saved-snapshots/{name}/shares/{shareId}` | Revoke a share code | ### Environments and repositories | Method | Endpoint | Does | | - | - | - | | `repos(sync=None, limit=None, cursor=None, sort=None, q=None, selected=None)` | `GET /repos` | List GitHub repositories | | `select_repo(repo_selection_request)` | `POST /repos` | Select a repository | | `secrets()` | `GET /secrets` | Get account secrets (legacy) | | `update_secrets(secrets_update_request)` | `POST /secrets` | Update account secrets (legacy) | | `environments(org=None)` | `GET /environments` | List environments | | `create_environment(create_sandbox_environment_request, org=None)` | `POST /environments` | Create an environment | | `update_environment(environment_id, update_sandbox_environment_request, org=None)` | `PUT /environments/{environmentId}` | Update an environment | | `delete_environment(environment_id, org=None)` | `DELETE /environments/{environmentId}` | Delete an environment | | `upgrade_environment(environment_id, org=None, upgrade_sandbox_environment_request=None)` | `POST /environments/{environmentId}/upgrade` | Upgrade sandboxes to the latest environment version | | `set_environment_var(environment_id, key, set_environment_var_request, org=None)` | `PUT /environments/{environmentId}/vars/{key}` | Set one environment variable | | `delete_environment_var(environment_id, key, org=None)` | `DELETE /environments/{environmentId}/vars/{key}` | Remove one environment variable | | `set_environment_secret_file(environment_id, set_environment_secret_file_request, org=None)` | `PUT /environments/{environmentId}/secret-files` | Write one secret file | | `delete_environment_secret_file(path, environment_id, org=None)` | `DELETE /environments/{environmentId}/secret-files` | Remove one secret file | | `add_environment_repo(environment_id, add_environment_repo_request, org=None)` | `POST /environments/{environmentId}/repos` | Add a repository to an environment | | `delete_environment_repo(environment_id, repository_id, org=None)` | `DELETE /environments/{environmentId}/repos/{repositoryId}` | Remove a repository from an environment | ### AI credentials | Method | Endpoint | Does | | - | - | - | | `list_credential_profiles()` | `GET /credential-profiles` | List credential profiles | | `create_credential_profile(create_credential_profile_request)` | `POST /credential-profiles` | Create a credential profile | | `update_credential_profile(profile, update_credential_profile_request)` | `PUT /credential-profiles/{profile}` | Update a credential profile | | `delete_credential_profile(profile)` | `DELETE /credential-profiles/{profile}` | Delete a credential profile | | `set_credential_profile_key(profile, credential, set_credential_key_request)` | `PUT /credential-profiles/{profile}/keys/{credential}` | Set a credential profile API key | | `delete_credential_profile_key(profile, credential)` | `DELETE /credential-profiles/{profile}/keys/{credential}` | Remove a credential profile credential | | `list_credential_accounts(profile, credential)` | `GET /credential-profiles/{profile}/accounts/{credential}` | List the accounts of a credential | | `add_credential_account(profile, credential, set_credential_key_request)` | `POST /credential-profiles/{profile}/accounts/{credential}` | Add another API key to a credential | | `switch_credential_account(profile, credential, account)` | `PUT /credential-profiles/{profile}/accounts/{credential}/{account}/active` | Switch a credential to another account | | `delete_credential_account(profile, credential, account)` | `DELETE /credential-profiles/{profile}/accounts/{credential}/{account}` | Forget an account of a credential | | `set_credential_profile_custom_api(profile, name, set_custom_api_request)` | `PUT /credential-profiles/{profile}/custom-apis/{name}` | Set a custom API | | `delete_credential_profile_custom_api(profile, name)` | `DELETE /credential-profiles/{profile}/custom-apis/{name}` | Remove a custom API | | `get_ai_proxy(org=None, x_boat_org=None)` | `GET /ai-proxy` | Get AI credentials proxy | | `update_ai_proxy(update_ai_proxy_request, org=None, x_boat_org=None)` | `PUT /ai-proxy` | Turn the AI credentials proxy on or off | | `get_ai_usage(days=None, profile=None, org=None, x_boat_org=None)` | `GET /ai-usage` | Get AI usage | | `get_sandbox_ai_usage(sandbox_id, days=None)` | `GET /sandboxes/{sandboxId}/ai-usage` | Get sandbox AI usage | | `set_sandbox_ai_access(sandbox_id, set_sandbox_ai_access_request)` | `PUT /sandboxes/{sandboxId}/ai-access` | Block or unblock sandbox AI access | ### Account, organizations and API keys | Method | Endpoint | Does | | - | - | - | | `me()` | `GET /me` | Get current user | | `list_organizations()` | `GET /orgs` | List organizations | | `set_active_organization(active_org_update_request)` | `PATCH /orgs/active` | Set the active organization | | `limits(org=None, x_boat_org=None, team_id=None)` | `GET /limits` | Get account limits | | `api_keys()` | `GET /api-keys` | List API keys | | `create_scoped_api_key(create_scoped_api_key_request)` | `POST /api-keys/scoped` | Create a scoped API key | | `revoke_api_key(api_key_id)` | `DELETE /api-keys/{apiKeyId}` | Revoke an API key | | `rotate_api_key(api_key_id)` | `POST /api-keys/{apiKeyId}/rotate` | Rotate an API key | | `api_key_usage(api_key_id)` | `GET /api-keys/{apiKeyId}/usage` | Get API key usage | ### Webhooks and OpenTelemetry | Method | Endpoint | Does | | - | - | - | | `list_webhooks()` | `GET /webhooks` | List webhooks | | `create_webhook(webhook_create_request)` | `POST /webhooks` | Create webhook | | `get_webhook(webhook_id)` | `GET /webhooks/{webhookId}` | Get webhook | | `update_webhook(webhook_id, webhook_update_request)` | `PATCH /webhooks/{webhookId}` | Update webhook | | `delete_webhook(webhook_id)` | `DELETE /webhooks/{webhookId}` | Delete webhook | | `rotate_webhook_signing_secret(webhook_id)` | `POST /webhooks/{webhookId}/rotate` | Rotate webhook signing secret | | `get_telemetry()` | `GET /telemetry` | Get OpenTelemetry export | | `set_telemetry(telemetry_set_request)` | `PUT /telemetry` | Set OpenTelemetry export | | `delete_telemetry()` | `DELETE /telemetry` | Remove OpenTelemetry export | | `get_ci_overview(account=, repo=, state=, limit=)` | `GET /ci` | Get CI overview | | `connect_ci_github(ci_connect_request)` | `POST /ci/connect` | Connect GitHub for CI | | `get_ci_job(job_id)` | `GET /ci/jobs/{jobId}` | Get CI job | | `get_ci_job_log(job_id)` | `GET /ci/jobs/{jobId}/logs` | Get CI job log | ### Data retention | Method | Endpoint | Does | | - | - | - | | `get_data_retention()` | `GET /account/data-retention` | Get account data-retention policy | | `update_data_retention(data_retention_update_request)` | `PATCH /account/data-retention` | Update account data-retention policy | | `get_deletion_operation(operation_id)` | `GET /deletion-operations/{operationId}` | Get deletion operation | # TypeScript SDK Source: https://docs.boat.dev/sdks/typescript Install @boatdev/sdk, create a sandbox, run a command and read stdout and the exit code, stream output, run background jobs, move files, prompt agents. Every method, by group. Install the package. It needs Node 18 or later (for `fetch`): ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} npm install @boatdev/sdk ``` ## Create, run a command, stop This script creates a sandbox, runs a command, prints the output and the exit code, and stops the sandbox. Set `BOAT_API_KEY` first. See [API keys](/api-keys). ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { BoatApi, Configuration, waitUntilReady } from "@boatdev/sdk"; import type { CommandResponse } from "@boatdev/sdk"; const boat = new BoatApi(new Configuration({ basePath: "https://boat.dev/api/v1", accessToken: process.env.BOAT_API_KEY!, })); const created = await boat.create({ ttlSeconds: 1800 }); const sandboxId = created.sandbox.id; try { await waitUntilReady(boat, sandboxId); const result = (await boat.command({ sandboxId, command: "echo hi && uname -a" })) as CommandResponse; console.log(result.exitCode); console.log(result.stdout); } finally { await boat.stop({ sandboxId }); } ``` * `command()` returns `CommandResponse | CommandStartedResponse`. A normal command gives a `CommandResponse`. A command with `detached: true` gives a `CommandStartedResponse`. * To delete the sandbox and its snapshots instead of a stop, call `boat.deleteSandbox({ sandboxId, xAsciiConfirmDelete: sandboxId })`. ## Configure ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { BoatApi, Configuration } from "@boatdev/sdk"; const boat = new BoatApi(new Configuration({ basePath: process.env.BOAT_API_BASE ?? "https://boat.dev/api/v1", accessToken: process.env.BOAT_API_KEY!, // boat_... })); ``` * Call every API method on `boat` with one object. Method names are camelCase. * Put the fields of a request body directly in that object, next to the path and query parameters: `boat.fork({ sandboxId, type: "small" })`. The wrapped form also works: `boat.fork({ sandboxId, forkRequest: { type: "small" } })`. The flat form needs 1.1.0 or later. * Helper functions take `boat` as their first argument: `waitUntilReady`, `waitUntilIdle`, `waitForDesktop`, `waitForPrompt`, `waitForPromptDone`, `streamEvents`, `streamPrompt`, `stopAndRemove`, `readText`, `writeText`, `execCommand`, `streamCommand`, `runCommand`, `followCommand`. Use these compiler options for the ESM examples, and set `"type": "module"` in `package.json`: ```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}} { "compilerOptions": { "target": "ES2022", "module": "NodeNext", "moduleResolution": "NodeNext", "lib": ["ES2022", "DOM"], "types": ["node"], "strict": true } } ``` In CommonJS, use `require`: ```js theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { BoatApi, Configuration } = require("@boatdev/sdk"); const boat = new BoatApi(new Configuration({ basePath: "https://boat.dev/api/v1", accessToken: process.env.BOAT_API_KEY, })); ``` ## Run commands A synchronous command times out after 30 seconds by default. Set `timeoutSeconds` up to 600. For a longer command, use [`runCommand`](#run-a-command-with-no-time-limit). A command sent while the sandbox starts waits up to 60 seconds. ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { execCommand } from "@boatdev/sdk"; import type { CommandResponse } from "@boatdev/sdk"; const result = (await boat.command({ sandboxId, command: "npm test", cwd: "my-repo", timeoutSeconds: 600, })) as CommandResponse; console.log(result.exitCode, result.timedOut, result.stdout, result.stderr); // Same call. It also resends a command that the sandbox refused while it restored its disk. const again = (await execCommand(boat, sandboxId, "node -v")) as CommandResponse; ``` ### Stream the output ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { streamCommand } from "@boatdev/sdk"; for await (const frame of streamCommand(boat, sandboxId, "npm test", { cwd: "my-repo", timeoutSeconds: 600 })) { if (frame.type === "stdout" || frame.type === "stderr") process.stdout.write(String(frame.data)); if (frame.type === "exit") console.log("exit code:", frame.exitCode); if (frame.type === "error") console.error(frame.message); } ``` Pass `signal` (an `AbortSignal`) in the options to stop reading early. ### Run a command with no time limit `runCommand` has no 600-second limit. It starts the command in the background, then yields its output until the command ends. It reconnects by itself, with no gap and no repeat. ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { runCommand } from "@boatdev/sdk"; for await (const frame of runCommand(boat, sandboxId, "npm run test:e2e", { cwd: "my-repo" })) { if (frame.type === "stdout" || frame.type === "stderr") process.stdout.write(String(frame.data)); if (frame.type === "exit") console.log("exit code:", frame.exitCode); if (frame.type === "error") console.error(frame.message); } ``` * The first frame is `{ type: "started", processId }`. * A loop that stops early leaves the command running. Stop it with `boat.stopCommand({ sandboxId, processId })`. * `followCommand(boat, sandboxId, processId)` follows a command that you started with `detached: true`. ### Run a server in the background ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import type { CommandStartedResponse } from "@boatdev/sdk"; const started = (await boat.command({ sandboxId, command: "npm run build", detached: true })) as CommandStartedResponse; let status = await boat.commandStatus({ sandboxId, processId: started.processId }); while (status.running) { await new Promise((r) => setTimeout(r, 2000)); status = await boat.commandStatus({ sandboxId, processId: started.processId }); } console.log(status.status, status.exitCode, status.stdout); ``` * `attachCommand({ sandboxId, processId })` streams the output of a detached command. * `stopCommand({ sandboxId, processId })` stops it and every process that it started. * `commandHistory` and `commandLogs` read past commands, also while the sandbox is stopped. See [Command history](/long-running-tasks/command-history). ## Files Small text files: ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { readText, writeText } from "@boatdev/sdk"; await writeText(boat, sandboxId, "notes/result.txt", "done\n"); console.log(await readText(boat, sandboxId, "notes/result.txt")); ``` Paths are relative to `/home/user`. `readFile` and `writeFile` also accept `encoding: "base64"`. For a file of any size, get a signed URL. Then send the bytes with `fetch`: ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { readFile } from "node:fs/promises"; const up = await boat.createUploadUrl({ sandboxId, path: "data/input.csv" }); await fetch(up.url, { method: up.method, body: await readFile("input.csv") }); const down = await boat.createDownloadUrl({ sandboxId, path: "data/input.csv" }); const bytes = await (await fetch(down.url)).arrayBuffer(); ``` The URLs expire. Treat them as secrets. ### Copy a local folder in Pack the folder, upload it, unpack it on the sandbox. In a git checkout, send the files that git tracks and the new files that `.gitignore` does not exclude. `node_modules` and build output stay out. This uses the `git` and `tar` commands of your machine: ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { execFileSync } from "node:child_process"; import { lstatSync } from "node:fs"; import { join } from "node:path"; import { execCommand } from "@boatdev/sdk"; import type { BoatApi } from "@boatdev/sdk"; // Skip a file that git tracks but that you deleted, and a submodule (a directory entry). function isFileOrLink(path: string): boolean { try { return !lstatSync(path).isDirectory(); } catch { return false; } } async function push(boat: BoatApi, sandboxId: string, folder: string, remote = "repo") { const listed = execFileSync("git", ["ls-files", "-z", "--cached", "--others", "--exclude-standard"], { cwd: folder }) .toString().split("\0").filter((name) => name && isFileOrLink(join(folder, name))); const packed = execFileSync("tar", ["--null", "--no-recursion", "-czf", "-", "-T", "-"], { cwd: folder, input: listed.join("\0"), maxBuffer: 4 * 1024 ** 3, }); const up = await boat.createUploadUrl({ sandboxId, path: "push.tgz" }); await fetch(up.url, { method: up.method, body: packed }); await execCommand(boat, sandboxId, `mkdir -p ${remote} && tar xzf push.tgz -C ${remote} && rm push.tgz`, undefined, 600); } ``` The archive keeps the exec bit and keeps links as links. It skips submodules. `boat push <id> <dir>` in the CLI also copies submodules. ## Run one job and delete the sandbox Create a sandbox, copy the code in, run one command, read the cost, delete the sandbox. This is what `boat run` does in the CLI. ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { runCommand, waitUntilReady } from "@boatdev/sdk"; const created = await boat.create({ from: "ci-base", type: "large", ttlSeconds: 3600 }); const sandboxId = created.sandbox.id; let code: unknown; try { await waitUntilReady(boat, sandboxId); await push(boat, sandboxId, "."); for await (const frame of runCommand(boat, sandboxId, "npm ci && npm test", { cwd: "repo" })) { if (frame.type === "stdout" || frame.type === "stderr") process.stdout.write(String(frame.data)); if (frame.type === "exit") code = frame.exitCode; } const usage = await boat.usage({ sandboxId }); console.log(`exit ${code} · ${usage.seconds}s · ${usage.sandboxType} · $${usage.dollars.toFixed(4)}`); } finally { await boat.deleteSandbox({ sandboxId, xAsciiConfirmDelete: sandboxId }); } process.exitCode = typeof code === "number" ? code : 1; ``` * The script exits with the exit code of the command, so a failed test fails the CI job. * `ttlSeconds` stops the sandbox if your script dies before the delete. Set it above your longest job. * `usage()` gives the machine time and the cost of one sandbox. It also works after a stop. ## Public URL for a port The TypeScript field for `public` is `_public`, because `public` is a reserved word: ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await boat.command({ sandboxId, command: "python3 -m http.server 8000", detached: true }); const hosted = await boat.hostPort({ sandboxId, port: 8000, _public: true }); console.log(hosted.url); // https://<sandbox>-8000.on.boat.dev ``` Without `_public: true`, the URL is private and carries a `_token`. See [Public URLs](/hosting). ## Machine size Pass `type`: `small`, `default` (the medium size), `large` or `xlarge`. `xlarge` needs the \$100 plan or higher. The [free trial](/free-trial) allows only `small` and `default`. ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const created = await boat.create({ type: "large", ttlSeconds: 3600 }); const info = await boat.get({ sandboxId: created.sandbox.id }); console.log(info.sandbox.type, info.sandbox.vcpu, info.sandbox.memoryGB); ``` A fork gets the size of its source. To change the size of a sandbox, stop it, then `resume({ sandboxId, type: "large" })`. See [Sandbox sizes](/machines). To know which types your account can create now, read `limits()`. A blocked type carries the reason: ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} for (const t of (await boat.limits({})).machineTypes ?? []) { console.log(t.type, t.available ? "ok" : t.reason); } ``` ## Per-sandbox environment variables ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const created = await boat.create({ ttlSeconds: 3600, env: { DATABASE_URL: "postgres://user:pass@host:5432/app", FEATURE_FLAG: "1" }, }); ``` The values come on top of the [environment](/environments) of the sandbox. A per-sandbox value wins. The maximum is 100 variables and 64 KB in total. A fork gets the `env` of its source, unless you give the fork its own `env`. ## No-env sandboxes For a sandbox that you give to your own users, set `noEnv: true`. boat then gives it none of your secrets: model keys, GitHub token, environment variables, secret files and SSH identity. SSH, desktop, snapshots, public URLs and forks still work. A fork of a no-env sandbox is always no-env. ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const created = await boat.create({ ttlSeconds: 1800, noEnv: true }); await boat.resume({ sandboxId, noEnv: true }); const forked = await boat.fork({ sandboxId, noEnv: true }); ``` ## Saved snapshots and forks Save a sandbox under a name. Then start new sandboxes from it: ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { randomUUID } from "node:crypto"; await boat.saveSavedSnapshot({ sandboxId, name: "web-stack" }); let snap = (await boat.getSavedSnapshot({ name: "web-stack" })).snapshot; while (snap.status !== "ready" && snap.status !== "failed") { await new Promise((r) => setTimeout(r, 5000)); snap = (await boat.getSavedSnapshot({ name: "web-stack" })).snapshot; } const fromTemplate = await boat.create({ idempotencyKey: randomUUID(), from: "web-stack", ttlSeconds: 900 }); const forked = await boat.fork({ sandboxId, idempotencyKey: randomUUID(), ttlSeconds: 900 }); console.log(fromTemplate.sandbox.id, forked.sandbox?.id); ``` * `idempotencyKey` makes a create or a fork safe to retry. See [Idempotent sandbox creation](/api/v1#idempotent-sandbox-creation). * A fork of a running sandbox uses its last background snapshot. Files written after it can be missing. ## Prompt an integrated agent Connect a key or a subscription on the dashboard (Agents & Proxying) first. Without it, `prompt` rejects with status 409 and code `provider_not_configured`. ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { waitForPrompt } from "@boatdev/sdk"; const queued = await boat.prompt({ sandboxId, provider: "codex", prompt: "Run the tests and fix the failures." }); // Add an instruction to the running turn without stopping it: await boat.steer({ sandboxId, message: "Skip the integration tests." }); const run = await waitForPrompt(boat, sandboxId, queued.promptId); console.log(run.status); const events = await boat.events({ sandboxId, limit: 50, type: "prompt,response" }); for (const event of events.events) console.log(event.type); ``` * `provider` is one of 7 harnesses: `codex`, `claude-code` (alias `claude`), `pi`, `opencode`, `prime-agent` (alias `prime`), `kimi` and `mistral`. Omit it to use the default from the dashboard. * A sandbox runs [many conversations in parallel](/integrated-agents). Pass `new: true` for a new one, or `conversationId` to continue one. * `interrupt({ sandboxId, conversation })` discards the running turn. `steer` keeps it running. ### Stream the agent's work ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { streamPrompt } from "@boatdev/sdk"; for await (const event of streamPrompt(boat, sandboxId, { provider: "codex", prompt: "Run pwd and ls." })) { if (event.type !== "response") continue; const data = (event as any).data; if (data?.tools?.length) console.log("tools", data.tools); if (data?.content) process.stdout.write(data.content); } ``` For all events of a sandbox, use `streamEvents(boat, sandboxId, { type: "prompt,response", signal })`. Stop it with an `AbortController`. ## Browse a stopped sandbox ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const latest = await boat.getLatestSandboxSnapshot({ sandboxId }); const tree = await boat.getSnapshotTree({ snapshotId: latest.snapshot!.id }); const blob = await boat.getSnapshotFile({ snapshotId: latest.snapshot!.id, path: "projects/app/.env" }); ``` ## Errors A non-2xx response rejects with a `ResponseError`. Read the status and parse the JSON body. Redact API keys, secrets, SSH keys and desktop URLs. ```ts theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { ResponseError } from "@boatdev/sdk"; try { await boat.get({ sandboxId: "bx_missing" }); } catch (error) { if (error instanceof ResponseError) { console.error(error.response.status); console.error((await error.response.json()).code); } } ``` The codes and the retry rules are on [API overview](/api/v1#error-model) and [Limits](/limits). ## Methods Each method takes one object. `...body` means the fields of the request body. The list comes from the [OpenAPI file](/openapi/boat-v1.yaml). ### Sandboxes | Method | Endpoint | Does | | - | - | - | | `sandboxes({ org, xBoatOrg, limit, cursor, sort, state })` | `GET /sandboxes` | List sandboxes | | `create({ idempotencyKey, org, xBoatOrg, ...body })` | `POST /sandboxes` | Create sandbox | | `get({ sandboxId })` | `GET /sandboxes/{sandboxId}` | Get sandbox | | `update({ sandboxId, ...body })` | `PATCH /sandboxes/{sandboxId}` | Update sandbox | | `deleteSandbox({ sandboxId, xAsciiConfirmDelete })` | `DELETE /sandboxes/{sandboxId}` | Delete sandbox | | `stop({ sandboxId, ...body })` | `POST /sandboxes/{sandboxId}/stop` | Stop sandbox | | `share({ sandboxId })` | `POST /sandboxes/{sandboxId}/share` | Share sandbox with the organization | | `recover({ sandboxId })` | `POST /sandboxes/{sandboxId}/recover` | Deprecated. Recover a sandbox that stopped responding | | `resume({ sandboxId, ...body })` | `POST /sandboxes/{sandboxId}/resume` | Resume sandbox | | `fork({ sandboxId, idempotencyKey, ...body })` | `POST /sandboxes/{sandboxId}/fork` | Fork sandbox | | `getStop({ sandboxId, stopId })` | `GET /sandboxes/{sandboxId}/stops/{stopId}` | Get a stop | | `usage({ sandboxId, since, until })` | `GET /sandboxes/{sandboxId}/usage` | Get sandbox usage | ### Commands | Method | Endpoint | Does | | - | - | - | | `command({ sandboxId, ...body })` | `POST /sandboxes/{sandboxId}/commands` | Run a command | | `commandStatus({ sandboxId, processId, tailBytes, stdoutOffset, stderrOffset })` | `GET /sandboxes/{sandboxId}/commands/{processId}` | Get command status | | `stopCommand({ sandboxId, processId })` | `DELETE /sandboxes/{sandboxId}/commands/{processId}` | Stop a detached command | | `attachCommand({ sandboxId, processId, stdoutOffset, stderrOffset })` | `GET /sandboxes/{sandboxId}/commands/{processId}/stream` | Attach to a detached command | | `commandHistory({ sandboxId, mode, q, limit, cursor })` | `GET /sandboxes/{sandboxId}/command-history` | List the command and process history | | `getCommand({ sandboxId, commandId })` | `GET /sandboxes/{sandboxId}/command-history/{commandId}` | Get one command from the history | | `commandLogs({ sandboxId, commandId, stream, offset, limit, encoding })` | `GET /sandboxes/{sandboxId}/command-history/{commandId}/logs` | Read command logs | | `processes({ sandboxId })` | `GET /sandboxes/{sandboxId}/processes` | List the processes in a sandbox | ### Files and access | Method | Endpoint | Does | | - | - | - | | `readFile({ sandboxId, path, encoding })` | `GET /sandboxes/{sandboxId}/files` | Read a file | | `writeFile({ sandboxId, ...body })` | `PUT /sandboxes/{sandboxId}/files` | Write a file | | `createDownloadUrl({ sandboxId, ...body })` | `POST /sandboxes/{sandboxId}/files/download-url` | Get a download URL for a sandbox file | | `createUploadUrl({ sandboxId, ...body })` | `POST /sandboxes/{sandboxId}/files/upload-url` | Get an upload URL for a sandbox file | | `artifact({ sandboxId, path })` | `GET /sandboxes/{sandboxId}/artifacts` | Download a file | | `desktop({ sandboxId, vnc, theme, ...body })` | `POST /sandboxes/{sandboxId}/desktop` | Get the desktop URL | | `hostPort({ sandboxId, ...body })` | `POST /sandboxes/{sandboxId}/host` | Expose a port on a public URL | | `sshKey({ sandboxId, ...body })` | `POST /sandboxes/{sandboxId}/sshkey` | Add an SSH key | ### Integrated agents | Method | Endpoint | Does | | - | - | - | | `prompt({ sandboxId, ...body })` | `POST /sandboxes/{sandboxId}/prompt` | Prompt the agent | | `events({ sandboxId, limit, cursor, sort, type, conversation })` | `GET /sandboxes/{sandboxId}/events` | List sandbox events | | `conversations({ sandboxId })` | `GET /sandboxes/{sandboxId}/conversations` | List conversations | | `promptRunStatus({ sandboxId, promptId })` | `GET /sandboxes/{sandboxId}/prompts/{promptId}` | Get prompt run status | | `steer({ sandboxId, conversation, ...body })` | `POST /sandboxes/{sandboxId}/steer` | Steer a running turn (API) | | `interrupt({ sandboxId, conversation })` | `POST /sandboxes/{sandboxId}/interrupt` | Interrupt running work | ### Snapshots | Method | Endpoint | Does | | - | - | - | | `listSnapshots({ limit, cursor, sort })` | `GET /snapshots` | List snapshots | | `listSandboxSnapshots({ sandboxId, limit, cursor, sort })` | `GET /sandboxes/{sandboxId}/snapshots` | List snapshots of a sandbox | | `deleteSandboxSnapshots({ sandboxId, xAsciiConfirmDelete })` | `DELETE /sandboxes/{sandboxId}/snapshots` | Delete all snapshots of a sandbox | | `getLatestSandboxSnapshot({ sandboxId })` | `GET /sandboxes/{sandboxId}/snapshots/latest` | Get the latest snapshot of a sandbox | | `deleteSnapshot({ snapshotId, xAsciiConfirmDelete })` | `DELETE /snapshots/{snapshotId}` | Delete snapshot | | `getSnapshotTree({ snapshotId })` | `GET /snapshots/{snapshotId}/tree` | Get snapshot file tree | | `getSnapshotFile({ snapshotId, path })` | `GET /snapshots/{snapshotId}/files` | Download a file or folder from a snapshot | | `getSnapshotDownload({ snapshotId })` | `GET /snapshots/{snapshotId}/download` | Get snapshot download | ### Saved snapshots | Method | Endpoint | Does | | - | - | - | | `listSavedSnapshots()` | `GET /saved-snapshots` | List saved snapshots | | `saveSavedSnapshot({ ...body })` | `POST /saved-snapshots` | Save a saved snapshot | | `getSavedSnapshot({ name })` | `GET /saved-snapshots/{name}` | Get a saved snapshot | | `deleteSavedSnapshot({ name })` | `DELETE /saved-snapshots/{name}` | Delete a saved snapshot | | `listSnapshotShares({ name })` | `GET /saved-snapshots/{name}/shares` | List share codes of a saved snapshot | | `createSnapshotShare({ name })` | `POST /saved-snapshots/{name}/shares` | Share a saved snapshot | | `revokeSnapshotShare({ name, shareId })` | `DELETE /saved-snapshots/{name}/shares/{shareId}` | Revoke a share code | ### Environments and repositories | Method | Endpoint | Does | | - | - | - | | `repos({ sync, limit, cursor, sort, q, selected })` | `GET /repos` | List GitHub repositories | | `selectRepo({ ...body })` | `POST /repos` | Select a repository | | `secrets()` | `GET /secrets` | Get account secrets (legacy) | | `updateSecrets({ ...body })` | `POST /secrets` | Update account secrets (legacy) | | `environments({ org })` | `GET /environments` | List environments | | `createEnvironment({ org, ...body })` | `POST /environments` | Create an environment | | `updateEnvironment({ environmentId, org, ...body })` | `PUT /environments/{environmentId}` | Update an environment | | `deleteEnvironment({ environmentId, org })` | `DELETE /environments/{environmentId}` | Delete an environment | | `upgradeEnvironment({ environmentId, org, ...body })` | `POST /environments/{environmentId}/upgrade` | Upgrade sandboxes to the latest environment version | | `setEnvironmentVar({ environmentId, key, org, ...body })` | `PUT /environments/{environmentId}/vars/{key}` | Set one environment variable | | `deleteEnvironmentVar({ environmentId, key, org })` | `DELETE /environments/{environmentId}/vars/{key}` | Remove one environment variable | | `setEnvironmentSecretFile({ environmentId, org, ...body })` | `PUT /environments/{environmentId}/secret-files` | Write one secret file | | `deleteEnvironmentSecretFile({ environmentId, org, path })` | `DELETE /environments/{environmentId}/secret-files` | Remove one secret file | | `addEnvironmentRepo({ environmentId, org, ...body })` | `POST /environments/{environmentId}/repos` | Add a repository to an environment | | `deleteEnvironmentRepo({ environmentId, repositoryId, org })` | `DELETE /environments/{environmentId}/repos/{repositoryId}` | Remove a repository from an environment | ### AI credentials | Method | Endpoint | Does | | - | - | - | | `listCredentialProfiles()` | `GET /credential-profiles` | List credential profiles | | `createCredentialProfile({ ...body })` | `POST /credential-profiles` | Create a credential profile | | `updateCredentialProfile({ profile, ...body })` | `PUT /credential-profiles/{profile}` | Update a credential profile | | `deleteCredentialProfile({ profile })` | `DELETE /credential-profiles/{profile}` | Delete a credential profile | | `setCredentialProfileKey({ profile, credential, ...body })` | `PUT /credential-profiles/{profile}/keys/{credential}` | Set a credential profile API key | | `deleteCredentialProfileKey({ profile, credential })` | `DELETE /credential-profiles/{profile}/keys/{credential}` | Remove a credential profile credential | | `listCredentialAccounts({ profile, credential })` | `GET /credential-profiles/{profile}/accounts/{credential}` | List the accounts of a credential | | `addCredentialAccount({ profile, credential, ...body })` | `POST /credential-profiles/{profile}/accounts/{credential}` | Add another API key to a credential | | `switchCredentialAccount({ profile, credential, account })` | `PUT /credential-profiles/{profile}/accounts/{credential}/{account}/active` | Switch a credential to another account | | `deleteCredentialAccount({ profile, credential, account })` | `DELETE /credential-profiles/{profile}/accounts/{credential}/{account}` | Forget an account of a credential | | `setCredentialProfileCustomApi({ profile, name, ...body })` | `PUT /credential-profiles/{profile}/custom-apis/{name}` | Set a custom API | | `deleteCredentialProfileCustomApi({ profile, name })` | `DELETE /credential-profiles/{profile}/custom-apis/{name}` | Remove a custom API | | `getAiProxy({ org, xBoatOrg })` | `GET /ai-proxy` | Get AI credentials proxy | | `updateAiProxy({ org, xBoatOrg, ...body })` | `PUT /ai-proxy` | Turn the AI credentials proxy on or off | | `getAiUsage({ days, profile, org, xBoatOrg })` | `GET /ai-usage` | Get AI usage | | `getSandboxAiUsage({ sandboxId, days })` | `GET /sandboxes/{sandboxId}/ai-usage` | Get sandbox AI usage | | `setSandboxAiAccess({ sandboxId, ...body })` | `PUT /sandboxes/{sandboxId}/ai-access` | Block or unblock sandbox AI access | ### Account, organizations and API keys | Method | Endpoint | Does | | - | - | - | | `me()` | `GET /me` | Get current user | | `listOrganizations()` | `GET /orgs` | List organizations | | `setActiveOrganization({ ...body })` | `PATCH /orgs/active` | Set the active organization | | `limits({ org, xBoatOrg, teamId })` | `GET /limits` | Get account limits | | `apiKeys()` | `GET /api-keys` | List API keys | | `createScopedApiKey({ ...body })` | `POST /api-keys/scoped` | Create a scoped API key | | `revokeApiKey({ apiKeyId })` | `DELETE /api-keys/{apiKeyId}` | Revoke an API key | | `rotateApiKey({ apiKeyId })` | `POST /api-keys/{apiKeyId}/rotate` | Rotate an API key | | `apiKeyUsage({ apiKeyId })` | `GET /api-keys/{apiKeyId}/usage` | Get API key usage | ### Webhooks and OpenTelemetry | Method | Endpoint | Does | | - | - | - | | `listWebhooks()` | `GET /webhooks` | List webhooks | | `createWebhook({ ...body })` | `POST /webhooks` | Create webhook | | `getWebhook({ webhookId })` | `GET /webhooks/{webhookId}` | Get webhook | | `updateWebhook({ webhookId, ...body })` | `PATCH /webhooks/{webhookId}` | Update webhook | | `deleteWebhook({ webhookId })` | `DELETE /webhooks/{webhookId}` | Delete webhook | | `rotateWebhookSigningSecret({ webhookId })` | `POST /webhooks/{webhookId}/rotate` | Rotate webhook signing secret | | `getTelemetry()` | `GET /telemetry` | Get OpenTelemetry export | | `setTelemetry({ ...body })` | `PUT /telemetry` | Set OpenTelemetry export | | `deleteTelemetry()` | `DELETE /telemetry` | Remove OpenTelemetry export | | `getCiOverview({ account?, repo?, state?, limit? })` | `GET /ci` | Get CI overview | | `connectCiGithub({ ...body })` | `POST /ci/connect` | Connect GitHub for CI | | `getCiJob({ jobId })` | `GET /ci/jobs/{jobId}` | Get CI job | | `getCiJobLog({ jobId })` | `GET /ci/jobs/{jobId}/logs` | Get CI job log | ### Data retention | Method | Endpoint | Does | | - | - | - | | `getDataRetention()` | `GET /account/data-retention` | Get account data-retention policy | | `updateDataRetention({ ...body })` | `PATCH /account/data-retention` | Update account data-retention policy | | `getDeletionOperation({ operationId })` | `GET /deletion-operations/{operationId}` | Get deletion operation | # Security and isolation Source: https://docs.boat.dev/security How boat isolates sandboxes, who can reach a sandbox, which credentials it holds, network rules, URLs with tokens, team access, data retention, compliance and uptime. Each topic links to its detail page. This page is the map of boat security. Each section is short and links to the page that has the details. | Question | Short answer | Details | | - | - | - | | Can one sandbox see another? | No. Each sandbox is its own virtual machine. | [Isolation](#isolation-between-sandboxes) | | Who can open my sandbox? | You. Members of your organization, for sandboxes it pays for. People you share it with. | [Who can reach a sandbox](#who-can-reach-a-sandbox) | | Which of my secrets are inside? | What your environment gives. None with **Safe for third parties**. | [Credentials](#boat-credentials-inside-a-sandbox) | | Can it reach the internet? | Outbound yes. Inbound only SSH and the ports you publish. | [Network](#network) | | Who can open a public URL? | Anyone with the full URL. | [URLs that carry a token](#urls-that-carry-a-token) | | How long is my data kept? Can I erase it? | At least 14 days after a stop. Delete erases it. | [Data](#data) | | SOC 2? Uptime? | SOC 2 in progress. 99.95% measured sandbox uptime. Platform status on [status.ascii.dev](https://status.ascii.dev). | [Compliance and uptime](/compliance) | ## Give sandboxes to end users To give an end user a sandbox, do these three things: 1. Start the sandbox in an environment with **Safe for third parties** on, or with `boat new --no-env`. No secret of yours goes in. 2. Give the user an API key limited to that one sandbox, if they need the API. 3. Treat every URL with a token as a password. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat env new customers boat env set customers --safe-for-third-parties true boat new --environment customers --json boat api-key create tenant-42 --preset full-sandbox --sandbox bx_123 --ttl 30d ``` ## Isolation between sandboxes * Each sandbox is its own virtual machine, with its own kernel, disk and IP address. * Sandboxes share no disk and no processes. They reach each other only over the network. * The `user` account has passwordless `sudo`. Anyone with a shell in a sandbox is root in that sandbox. * So treat everything inside a sandbox as readable and changeable by its user. This includes files, environment variables and the browser profile. * The security boundary is between sandboxes and between accounts. Inside a sandbox, use normal Linux tools (users, file permissions, firewall rules) as on any server. ### One sandbox per end user Give each end user their own sandbox. Containers inside one sandbox share its kernel, so boat does not isolate them from each other. boat also does not clean a sandbox between your users. * To start fast, save a [saved snapshot](/snapshots/templates) and start each user's sandbox with `boat new --from <name>`. * If you must reuse one sandbox for many users, assume each user looks for traces of the user before. Run each job as a new Linux user, delete its files after the job, and keep no keys in the sandbox. ## Who can reach a sandbox | Who | What they can do | Details | | - | - | - | | You, the creator | Everything | | | Members of your organization | See every sandbox the organization pays for. Use it if it is shared: it holds no personal logins and its creator did not make it private. | [Shared sandboxes](/organizations/shared-sandboxes) | | People you share a sandbox with | What the share allows | [Shared sandboxes](/organizations/shared-sandboxes) | | An API key | What its scopes allow. A key limited with `--sandbox` reaches one sandbox only. | [Scopes](/api-keys/scopes) | | An SSH key you added | A shell as `user` | [SSH access](/ssh-access) | | Anyone with a URL that carries a token | That one port or desktop | [URLs that carry a token](#urls-that-carry-a-token) | Snapshots and personal environments stay private to the person who made them. Read [Teams and organizations](/organizations). ## boat credentials inside a sandbox | Credential | Where | What it can do | Safe for third parties / `--no-env` | | - | - | - | - | | `ASCII_TOKEN` | Environment variable, `~/.bashrc` | Host ports of its own sandbox. Nothing else. | Stays | | In-sandbox API key | `~/.config/ascii/boat/config.json` | Read, stop, exec, files, SSH, desktop, host and snapshots, on its own sandbox only. Read [Scopes](/api-keys/scopes#in-sandbox-api-key). | Removed | | Your environment variables and secret files | Environment, files you configured | Whatever the secret allows | Removed | | GitHub token, `gh` login, git credentials | `~/.config/gh/hosts.yml`, `~/.git-credentials` | Your repositories | Removed | | AI logins and keys | `~/.claude/`, `~/.codex/` and others | Your AI provider accounts | Removed, or replaced by [proxy placeholders](/ai-credentials#the-ai-credentials-proxy) | `ASCII_TOKEN` lets the user publish any port of their sandbox on a public URL under that sandbox's subdomain. It cannot reach your account or other sandboxes. For the full list of what a protected sandbox does not receive, read [Access and credentials](/environments/access#what-a-normal-sandbox-receives). ### Check a sandbox ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_123 'echo "[$STRIPE_KEY]"; ls ~/.config/ascii/boat/config.json ~/.git-credentials 2>&1' ``` A protected sandbox prints `[]` and `No such file or directory` for each file. ### Sandboxes made from your own snapshots A snapshot of a normal sandbox can contain your secrets. Resume or fork it with `--no-env` before an end user gets it. boat removes the owner secrets before the sandbox becomes reachable. Read [Protect an existing sandbox](/environments/access#protect-an-existing-sandbox). ## API keys for end users | Need | Use | | - | - | | The user works in one sandbox | `--preset full-sandbox --sandbox <id>` | | The user only reads | `--preset read-only --sandbox <id>` | | Your backend creates sandboxes | `--preset ci`. Keep this key on your server. | * A key limited with `--sandbox` cannot see or touch other sandboxes. It cannot list keys or read billing. * `full-sandbox` cannot create, resume, fork or delete. Your backend does that. * Use a short `--ttl`. Revoke the key when the user leaves. * Never give an end user an `admin` key or a key with `account.admin`. These can create more keys. Read [Scopes](/api-keys/scopes). ## Network | Direction | Default | How to change it | | - | - | - | | Inbound | Refused, except SSH and the ports that boat uses | `host <port>` for a public URL. `ufw allow` for a raw port. Read [Public URLs](/hosting#raw-tcp-or-udp-ports). | | Outbound | Open to the internet | Firewall rules inside the sandbox. Read [Block outbound internet](/hosting/firewall#block-outbound-internet-for-untrusted-code). | * boat has no API setting for network rules. * The user is root, so the user can remove rules that you add as root. To keep a rule, run the untrusted code as a separate account without `sudo`. * Snapshots do not keep firewall rules. Apply them again after each resume and fork. ## URLs that carry a token | URL | Who can open it | How long | | - | - | - | | Protected public URL (`?_token=`) | Anyone with the full URL. No boat sign-in. | Until you replace the token. Read [Replace a leaked token](/hosting#replace-a-leaked-token). | | Public URL with `--public` | Anyone | Until `host hide` | | Desktop URL (Moonlight) | Anyone with the full URL | Open within 10 minutes. Read [Embed the desktop](/desktop-streaming/urls-and-security#how-long-a-desktop-url-works). | | VNC desktop URL | Anyone with the full URL | Until the port becomes public | | Signed file upload or download URL | Anyone with the URL | 15 minutes, up to 1 hour. Read [Large files](/ssh-access#large-files). | Create these URLs on your server. Send each one only to the user who needs it. Do not log them. ## Data | Topic | Short answer | Details | | - | - | - | | How long boat keeps data | While a sandbox runs, and at least 14 days after it stops. Saved snapshots have no scheduled expiry. | [Data retention](/data-retention#how-long-boat-keeps-data) | | Erase a sandbox | `boat delete <id>`. You cannot undo it. | [Delete](/data-retention/delete) | | Keep nothing after a stop | Zero data retention | [Zero data retention](/data-retention/zero-data-retention) | | No snapshots or no logs at all | Snapshots off, monitoring off | [Snapshots and monitoring off](/data-retention/snapshots-and-monitoring-off) | | Where data is stored | Machines in Germany, Finland and France. Snapshot copies can be stored outside the EU. | [Compliance and uptime](/compliance#data-location) | | AI keys | Keep real keys out of sandboxes with the AI credentials proxy | [AI credentials](/ai-credentials) | SOC 2, uptime, data location and security reports are on [Compliance and uptime](/compliance). # Setup scripts Source: https://docs.boat.dev/setup Run commands when a sandbox starts: repository setup scripts, a per-sandbox setup file, or commands from your own code. Includes how to fail when setup fails. There are three ways to run commands when a sandbox starts. You can use them together. | | Where you set it | Runs | Best for | | - | - | - | - | | [Repository setup script](#repository-setup-scripts) | Dashboard, or the environments API. No CLI command. | At **every** start: create, resume and fork | `npm install`, `git pull`, migrations | | [`--setup-file`](#per-sandbox-setup-file) | `boat new` or `POST /sandboxes` | **Once**, at create, in the background | A script that differs between sandboxes | | [Commands from your code](#driving-setup-from-your-code) | Your program | When you call | Setup that must succeed before you continue | Do not script slow installs. Put them in a [saved snapshot](/snapshots/templates). Then they are already installed when the sandbox starts. Read [Environment, setup script or saved snapshot?](/environments/choose). ## Repository setup scripts A repository setup script belongs to one repository of an [environment](/environments). * It runs at every start of the sandbox: create, resume and fork. Make it safe to run many times. * It runs inside the folder of that repository, in a login `bash` shell. * boat adds `set -e` at the top. The script stops at the first failed command. * Your environment variables and secret files are already in place. * It does not run when the environment is [safe for third parties](/environments/access#safe-for-third-parties), when you use `--no-env`, or when the **GitHub repositories** toggle is off. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} npm ci npm run db:migrate ``` Mark the script **blocking** if your agent must wait for it: | Mode | Effect | | - | - | | Blocking | boat holds prompts to the [integrated agent](/integrated-agents) until the script finishes. Commands and SSH work at once. | | Non-blocking | The script runs at the same time as everything else. | When a script fails, the sandbox writes its output to `/tmp/routine-logs/` inside the sandbox. ### Set a repository setup script In the dashboard: 1. Open [Dashboard > Environment](https://boat.dev/dashboard?tab=environment). 2. Under GitHub repositories, click **Setup** below the repository. 3. Write the script. Select **Blocking** if your agent must wait for it. 4. Save the environment. With the API, send the full repository list of the environment. This call **replaces** the list. Include every repository that you want to keep. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} # $BOAT_API_BASE is https://boat.dev/api/v1. Get $ENV_ID and $REPO_ID as in Repositories. curl -sS -X PUT "$BOAT_API_BASE/environments/$ENV_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"repositories\":[{\"repositoryId\":\"$REPO_ID\",\"baseBranch\":\"main\",\"setupScript\":\"npm ci\\n\",\"setupBlocking\":true}]}" ``` Read [Repositories](/environments/repositories) to get the ids. Running sandboxes keep the old script until you [upgrade](/environments/versions) them. ## Per-sandbox setup file Use this when the work is different for each sandbox. Pass a local script when you create the sandbox. The limit is 64KB, UTF-8. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --setup-file ./setup.sh ``` * The script runs in the background after the sandbox is ready. It never delays `ready`. * It runs as the user `user`, not as root. Use `sudo` for root commands. * It runs once. A resume does not run it again. A fork does not copy it. Watch it with `boat info <id>`: | Field | Values | | - | - | | `setupStatus` | `pending`, `running`, `done`, `failed` | | `setupError` | Exit code and the end of stderr, when it failed | ## Fail when setup fails boat does not delete a sandbox when its setup fails. Check the result yourself, then delete the sandbox. This is not the same as [fail fast](/machines/fail-fast), which is about machine availability. Run the setup with `boat exec`. `boat exec` exits with the exit code of the command. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} set -euo pipefail id=$(boat new --json | jq -r 'select(.event == "ready") | .id') if ! boat exec "$id" --cwd web-app --timeout 600 'bash ./setup.sh'; then echo "setup failed in $id" >&2 boat delete "$id" --yes exit 1 fi ``` For a setup longer than 600 seconds, run `boat exec <id> --timeout 0 'bash ./setup.sh'`. It waits with no limit and exits with the exit code of the setup. With `--setup-file`, poll `setupStatus` instead: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} id=$(boat new --setup-file ./setup.sh --json | jq -r 'select(.event == "ready") | .id') while :; do status=$(boat info "$id" --json | jq -r .sandbox.setupStatus) case "$status" in done) break ;; failed) boat info "$id" --json | jq -r .sandbox.setupError >&2; boat delete "$id" --yes; exit 1 ;; *) sleep 5 ;; esac done ``` ## Driving setup from your code 1. Configure your secrets in the environment. 2. Run the commands that you need. The script reads normal environment variables. It reads the secret files at their configured paths. No sensitive data goes through the command line. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox_id="$(boat new --json | jq -r 'select(.event == "ready") | .id')" boat exec "$sandbox_id" --cwd my-repo --timeout 300 "bash ./setup.sh" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/$SANDBOX_ID/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"bash -lc ./setup.sh","cwd":"my-repo","timeoutSeconds":300}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.command({ sandboxId, command: "bash -lc './setup.sh'", cwd: "my-repo", timeoutSeconds: 300, }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.command_request import CommandRequest sandbox.command( sandbox_id, CommandRequest(command="bash -lc './setup.sh'", cwd="my-repo", timeout_seconds=300), ) ``` * A command stops after 30 seconds by default. Set `timeoutSeconds` (`--timeout` in the CLI) up to 600. * For longer work, use `boat exec --timeout 0` or the SDK helper `run_command` / `runCommand`. They have no time limit. Read [Background commands](/long-running-tasks/background-commands). * Call when the sandbox is `ready`. A call made earlier waits for the start, or gets a retryable `sandbox_starting` error. To pipe a script that is not on the sandbox yet, use SSH. SSH streams stdin, stdout and stderr. You do not have to copy the script first. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ssh bx_f7k2q9hd -- bash -s < ./setup.sh ``` > [!NOTE] > > On Windows, run this from Node, Python, WSL, Git Bash or `cmd.exe`. Native PowerShell pipelines can keep stdin open for native executables. Then the command hangs. ## Related * [Environments](/environments) * [Saved snapshots](/snapshots/templates) * [Long-running tasks](/long-running-tasks) * [SSH access](/ssh-access) # Snapshots Source: https://docs.boat.dev/snapshots boat saves the disk of your sandbox all the time. Stop, resume, fork, save a saved snapshot or download your files. A snapshot is a saved copy of the disk of your sandbox. boat makes snapshots for you. You do not have to do anything. * boat saves the disk every minute while the sandbox runs. * boat saves it one more time when the sandbox stops. * Each save keeps only what changed, so saves are small and fast. Memory and running programs are not in a snapshot. A resume within 10 minutes of a stop usually gets the same machine back, with memory and programs. After that, a resume is like a reboot. Read [Resume within 10 minutes](/snapshots/stop#resume-within-10-minutes). ## What you can do with a snapshot | You want | Use | Command | | - | - | - | | Stop paying, keep the disk for at least 14 days | [Stop](/snapshots/stop) | `boat stop <id>` | | Your sandbox back after a stop | [Resume](/snapshots/resume-and-fork#resume) | `boat resume <id>` | | A second sandbox that copies this one | [Fork](/snapshots/resume-and-fork#fork) | `boat fork <id>` | | A fixed starting point for many sandboxes | [Saved snapshot](/snapshots/templates) | `boat snapshot <id> <name>`, then `boat new --from <name>` | | Files from a snapshot on your computer | [Download](/snapshots/download-and-delete) | `boat snapshot pull <snapshotId>` | Resume and fork always use the newest snapshot. You cannot go back to an older one. To keep a state that you can go back to, save a [saved snapshot](/snapshots/templates). Read [Restore an older snapshot](/snapshots/resume-and-fork#restore-an-older-snapshot-roll-back). ```mermaid theme={"theme":{"light":"github-light","dark":"github-dark-default"}} %%{init: {"theme": "base", "fontFamily": "IBM Plex Mono", "themeVariables": {"fontFamily": "IBM Plex Mono", "fontSize": "14px", "primaryColor": "#F1F3F9", "primaryBorderColor": "#263FA9", "primaryTextColor": "#060606", "secondaryColor": "#E0E3F2", "tertiaryColor": "#FEFEFE", "lineColor": "#060606", "textColor": "#060606", "mainBkg": "#F1F3F9", "nodeBorder": "#263FA9", "clusterBkg": "#FEFEFE", "clusterBorder": "#C4C4C4", "edgeLabelBackground": "#FEFEFE", "actorBkg": "#F1F3F9", "actorBorder": "#263FA9", "actorTextColor": "#060606", "actorLineColor": "#9E9E9E", "signalColor": "#060606", "signalTextColor": "#060606", "labelBoxBkgColor": "#F1F3F9", "labelBoxBorderColor": "#263FA9", "noteBkgColor": "#E0E3F2", "noteBorderColor": "#E0E3F2", "noteTextColor": "#060606", "sectionBkgColor": "#F1F3F9", "altSectionBkgColor": "#FEFEFE", "taskBkgColor": "#263FA9", "taskBorderColor": "#263FA9", "taskTextColor": "#FEFEFE", "gridColor": "#E0E0E0"}, "flowchart": {"padding": 16, "nodeSpacing": 48, "rankSpacing": 48, "curve": "linear"}, "sequence": {"boxMargin": 16, "actorMargin": 48, "noteMargin": 16, "messageMargin": 32, "mirrorActors": false}, "state": {"padding": 16}, "gantt": {"barHeight": 24, "barGap": 8, "fontSize": 14, "sectionFontSize": 14}}}%% flowchart LR A[Sandbox disk] -->|every minute, and on stop| B[(Newest snapshot)] B -->|boat resume| C[Same sandbox, new machine] B -->|boat fork| D[New sandbox, copy of the disk] B -->|boat snapshot id name| E[Saved snapshot] E -->|boat new --from name| F[New sandbox, copy of the saved snapshot] B -->|boat snapshot pull| G[Files on your computer] ``` For the words boat uses, and the words other providers use, read [Concepts](/concepts). ## What comes back * Your files, your installed packages and your system settings come back. * Your Docker volumes and containers come back. Containers that ran start again. * Services that you enabled with systemd start again by themselves. * Programs that you started by hand do not come back. Start them again. * Memory, open connections and `/tmp` do not come back. * The IP address changes. The list above is for a resume on a new machine. A resume within 10 minutes of the stop usually gets the same machine, and everything comes back. For the full list, read [What a snapshot saves](/snapshots/whats-saved). ## A stop saves first A stop saves the disk before boat removes the machine. If the save fails, boat keeps the sandbox running and tries again for up to 3 days. After 3 days, boat does a forced stop. Read [When a stop is refused](/snapshots/stop#when-a-stop-is-refused). Some apps keep recent changes in memory. Chrome is an example. To save these changes before a stop, use a pre-stop command. Read [Stop a sandbox](/snapshots/stop). ## Cost * Automatic snapshots are free, with no count limit. boat keeps the newest one for **at least 14 days after the stop**. Automated retention cleanup can delete it later once enabled. Read [Keep a stopped sandbox longer than 14 days](/snapshots/stop#keep-a-stopped-sandbox-longer-than-14-days). * Saved snapshots have no scheduled expiry. Your plan includes some. You cannot save one during the free trial. Each one above that costs \$0.056 a day from the wallet. Unpaid extras can be deleted after 7 days. Read [Saved snapshot pricing](/snapshots/templates#saved-snapshot-pricing). How long boat keeps each snapshot is in [Data retention](/data-retention#how-long-boat-keeps-data). ## Learn more > [card] [Stop a sandbox](/snapshots/stop) > > What a stop does, how to save app state first, and what happens when a stop is refused. > [card] [Resume, fork and restore](/snapshots/resume-and-fork) > > Get your sandbox back, make a copy, or get older files back. > [card] [Readiness and resume speed](/readiness) > > What works at `ready`, and how to wait for the rest in a script. > [card] [What a snapshot saves](/snapshots/whats-saved) > > Which folders come back, Docker, caches, and how to leave files out. > [card] [Saved snapshots](/snapshots/templates) > > Save a sandbox under a name. Deploy many sandboxes from it. Share it with another account. > [card] [Download a snapshot](/snapshots/download-and-delete) > > Look inside a snapshot and download its files. # Download a snapshot Source: https://docs.boat.dev/snapshots/download-and-delete Look inside a snapshot and download its files, also from a stopped sandbox. Get one file, one folder or the whole home folder. You can read the files of a snapshot without starting the sandbox. The sandbox can be stopped. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshot pull bx_f7k2q9hd -o ./restore # newest snapshot of this sandbox ``` ## Look inside and download ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshots # across your sandboxes boat snapshots bx_f7k2q9hd # one sandbox boat snapshot latest bx_f7k2q9hd boat snapshot tree <snapshotId> # files + sizes boat snapshot pull <snapshotId> -o ./restore # download and reassemble boat snapshot pull <snapshotId> -o ./restore --path /home/user/project/report # one folder only ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/snapshots" \ -H "Authorization: Bearer $BOAT_API_KEY" curl -sS "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/snapshots/latest" \ -H "Authorization: Bearer $BOAT_API_KEY" curl -sS "$BOAT_API_BASE/snapshots/<snapshotId>/tree" \ -H "Authorization: Bearer $BOAT_API_KEY" # one file, or a folder as .tar, straight from a snapshot curl -sS "$BOAT_API_BASE/snapshots/<snapshotId>/files?path=projects/app/.env" \ -H "Authorization: Bearer $BOAT_API_KEY" -o .env curl -sS "$BOAT_API_BASE/snapshots/<snapshotId>/files?path=projects/app" \ -H "Authorization: Bearer $BOAT_API_KEY" -o app.tar # a changed system file: use its absolute path curl -sS "$BOAT_API_BASE/snapshots/<snapshotId>/files?path=/etc/nginx/nginx.conf" \ -H "Authorization: Bearer $BOAT_API_KEY" -o nginx.conf ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.listSnapshots(); // across your sandboxes await sandbox.listSandboxSnapshots({ sandboxId: "bx_f7k2q9hd" }); // one sandbox await sandbox.getLatestSandboxSnapshot({ sandboxId: "bx_f7k2q9hd" }); await sandbox.getSnapshotTree({ snapshotId: "<snapshotId>" }); // files + sizes const file = await sandbox.getSnapshotFile({ snapshotId: "<snapshotId>", path: "projects/app/.env", }); const archive = await sandbox.getSnapshotDownload({ snapshotId: "<snapshotId>" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sandbox.list_snapshots() # across your sandboxes sandbox.list_sandbox_snapshots("bx_f7k2q9hd") # one sandbox sandbox.get_latest_sandbox_snapshot("bx_f7k2q9hd") sandbox.get_snapshot_tree("<snapshotId>") # files + sizes file = sandbox.get_snapshot_file("<snapshotId>", path="projects/app/.env") archive = sandbox.get_snapshot_download("<snapshotId>") ``` `$BOAT_API_BASE` is `https://boat.dev/api/v1`. ## What `pull` downloads `boat snapshot pull` writes two folders: | Folder | Holds | | - | - | | `home_user/` | Your `/home/user` | | `docker/` | Your Docker named volumes | They hold the files exactly as they were at that snapshot. `--path` extracts only the files under that path. It still downloads the whole snapshot. `pull` recreates symlinks that stay inside `home_user/` and `docker/`. On every platform it skips a link that points outside that tree, such as `/etc`, or one that resolves through another symlink. On Windows it also skips links unless Developer Mode is on or the shell runs as administrator. It prints how many entries it skipped. `pull` is for your home folder and your volumes. A snapshot also saves your changes in `/etc`, `/usr`, `/opt`, `/root`, `/srv` and `/var`, other home folders, and folders that you create at `/`. To get one of these files, ask the file endpoint for its absolute path, as in the curl example above. ## Download a saved snapshot A saved snapshot downloads the same way. Use its snapshot id, not its name. 1. Get the id: `GET $BOAT_API_BASE/saved-snapshots/<name>` returns it in `snapshot.snapshotId`. 2. Download: `boat snapshot pull <snapshotId> -o ./restore`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/saved-snapshots/web-stack" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` The SDKs have no `pull`. Use `getSnapshotDownload`, then put the files together on your computer. You can also see the files, and download them, in the [Snapshots](https://boat.dev/dashboard?tab=snapshots) tab of the dashboard. For all calls, read the [Snapshots API](/api/reference/snapshots/list-snapshots). ## Which snapshots you can download The newest snapshot of a sandbox stays while it runs and for at least 14 days after it stops. After that, automated retention cleanup can delete it once enabled ([details](/snapshots/stop#keep-a-stopped-sandbox-longer-than-14-days)). Older snapshots stay in the list only for a short time, usually less than a day. Resume and fork always use the newest one. Read [How long boat keeps data](/data-retention#how-long-boat-keeps-data) and [Restore an older snapshot](/snapshots/resume-and-fork#restore-an-older-snapshot-roll-back). * After the deletion, the sandbox stays in your list as expired. Resume and fork fail with `409 snapshot_data_expired`. * To keep the data longer, save a saved snapshot before the deletion: `boat snapshot <id> <name>`. This works on a stopped sandbox. A saved snapshot does not expire. If you need more time, write to [support](/support). ## Delete a sandbox A stop keeps the snapshots. A delete erases them for good. To delete a sandbox or one snapshot, read [Delete a sandbox or snapshot](/data-retention/delete). # Resume, fork and restore Source: https://docs.boat.dev/snapshots/resume-and-fork Get a stopped sandbox back, copy a sandbox, and get files from an older snapshot back. Resume and fork always use the newest snapshot. Resume and fork both start a machine from the **newest** snapshot of a sandbox. | | Resume | Fork | | - | - | - | | You get | The same sandbox, with the same id | A new sandbox, with a new id | | The source sandbox | Is the sandbox | Keeps running. boat does not change it | | Use it to | Continue your work after a stop | Try something risky, start a second branch of work, give one sandbox to each of your users | To deploy many sandboxes from one fixed state, use a [saved snapshot](/snapshots/templates) instead of forks. ## Resume A resume brings a stopped sandbox back on a new machine. The sandbox keeps its id and its disk. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat resume bx_f7k2q9hd boat resume bx_f7k2q9hd --type large # different size: small, default, large or xlarge boat resume bx_f7k2q9hd --ttl 7200 # new lifetime, in seconds boat resume bx_f7k2q9hd --no-auto-stop # runs until you stop it ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/resume" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"type":"large","ttlSeconds":7200}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.resume({ sandboxId: "bx_f7k2q9hd", type: "large", ttlSeconds: 7200, }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.resume_request import ResumeRequest sandbox.resume(sandbox_id="bx_f7k2q9hd", resume_request=ResumeRequest(type="large", ttl_seconds=7200)) ``` `$BOAT_API_BASE` is `https://boat.dev/api/v1`. * Every stop makes the snapshot that a resume needs: `boat stop`, auto-stop, and a stop for an empty wallet. Only `boat stop --force` and [snapshots off](/data-retention/snapshots-and-monitoring-off#snapshots-off) skip it. * boat keeps the snapshot of a stopped sandbox for at least 14 days. After that, automated retention cleanup can delete it once enabled. Resume and fork fail with `409 snapshot_data_expired` once deletion completes. Save a [saved snapshot](/snapshots/templates) before day 14 to keep the disk longer. Read [Keep a stopped sandbox longer than 14 days](/snapshots/stop#keep-a-stopped-sandbox-longer-than-14-days). * A sandbox in `error` can also resume. It comes back from its newest snapshot. Read [A sandbox is in error](/troubleshooting#a-sandbox-is-in-error). * To change the size, stop the sandbox first. Then resume with `--type`. A resume of a running sandbox with a new `--type` fails. * You can resume on a smaller size. If the sandbox has more data than the smaller size can hold, boat refuses the resume and does not change the sandbox. Read [Machines](/machines). * If you do not send `ttlSeconds`, the sandbox keeps its current lifetime. * To turn auto-stop off, send `null` (`--no-auto-stop`). * `boat resume` waits until the sandbox runs a command. Then it returns. To return at once, add `--no-wait`. * The IP address changes at every resume. What works at `ready`, and what comes a few seconds later, is in [Readiness and resume speed](/readiness). ## Fork A fork copies a sandbox into a new sandbox. The source keeps running, and boat does not change it. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat fork bx_f7k2q9hd boat fork bx_f7k2q9hd --type small boat fork bx_f7k2q9hd --ttl 600 # lifetime for the fork, in seconds boat fork bx_f7k2q9hd --no-auto-stop # runs until you stop it ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/fork" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"type":"small","ttlSeconds":600}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const forked = await sandbox.fork({ sandboxId: "bx_f7k2q9hd", type: "small", ttlSeconds: 600, }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.fork_request import ForkRequest forked = sandbox.fork(sandbox_id="bx_f7k2q9hd", fork_request=ForkRequest(type="small", ttl_seconds=600)) ``` > [!WARNING] > > A fork of a **running** sandbox uses its last background snapshot. boat takes one each minute. Writes from the last minute or so can be missing from the fork. > > For an exact copy, save a saved snapshot first: `boat snapshot <id> <name>`. A save of a running sandbox takes a new snapshot at that moment. Then run `boat new --from <name>`. A fork of a **stopped** sandbox has everything, because the stop took the last snapshot. What the fork gets from the source: * The whole disk, as it was at the newest snapshot. * The per-sandbox variables of the source. If you send your own `env`, the fork uses yours. * The exact environment version of the source. Read [Environments](/environments). What the fork does not get: * The lifetime of the source. A fork stops after 1 hour by default, even if the source has auto-stop turned off. To change this, send `ttlSeconds` or use `--no-auto-stop`. * A per-sandbox setup script (`--setup-file`) of the source. That script runs one time, on the sandbox that you created with it. To make many copies at once, read [Make many copies](/snapshots/templates#make-many-copies). ## Restore an older snapshot (roll back) Resume and fork always use the newest snapshot. **You cannot resume or fork an older snapshot.** There is no point-in-time restore. The snapshot list of a sandbox holds only recent snapshots. boat removes older ones, usually within a day. Read [How long boat keeps data](/data-retention#how-long-boat-keeps-data). To get files back from an older snapshot that is still in the list: 1. Find the snapshot: `boat snapshots <sandboxId>`. 2. Download its files: `boat snapshot pull <snapshotId> -o ./old`. Or download one path. Read [Download a snapshot](/snapshots/download-and-delete). 3. Copy the files into the sandbox: `boat scp`. To keep states that you can go back to, save a saved snapshot at each point. A saved snapshot has no scheduled expiry, but unpaid extras can be deleted. For example, save one each day from cron: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshot bx_f7k2q9hd "daily-$(date +%F)" ``` Then start a sandbox from any of them with `boat new --from daily-2026-10-12`. Your plan includes some saved snapshots at no cost. Read [Saved snapshot pricing](/snapshots/templates#saved-snapshot-pricing). ## How fast a sandbox comes back A resume, a fork or a deploy is ready in a few seconds, whatever the size of the disk. boat downloads your files in the background. What works at `ready`, how to wait for the rest, and how to make the first start faster are in [Readiness and resume speed](/readiness). ## No machine free A resume or a fork waits for a machine when none is free. To get an answer at once instead, read [Fail fast when no machine is free](/machines/fail-fast). # Stop a sandbox Source: https://docs.boat.dev/snapshots/stop What a stop does, how to wait for it in a script, how to save app state first, and what happens when a stop is refused. A stop saves the disk, then removes the machine. A stopped sandbox costs nothing. Run `boat resume` to get it back. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat stop bx_f7k2q9hd ``` > [!WARNING] > > **boat keeps the disk of a stopped sandbox for at least 14 days.** After that, an automated retention job can delete it when enabled. The job currently reports candidates without deleting them in production. Once deleted, the sandbox cannot resume or fork. Save a saved snapshot before day 14 if you need the disk longer. Read [Keep a stopped sandbox longer than 14 days](#keep-a-stopped-sandbox-longer-than-14-days). * There is no pause. A stop removes the virtual machine and keeps a copy of the disk. A resume starts a new machine with that disk. * A stop keeps the disk. A resume within 10 minutes usually gets the same machine back, with memory and running programs. Do not count on it. After 10 minutes, memory and running programs are gone. Read [Resume within 10 minutes](#resume-within-10-minutes). * Every stop saves the disk first: `boat stop`, [auto-stop](/long-running-tasks/auto-stop) and a stop for an empty wallet. Only `boat stop --force` and [snapshots off](/data-retention/snapshots-and-monitoring-off#snapshots-off) skip the save. * To erase the sandbox for good, delete it. Read [Delete a sandbox](/data-retention/delete). ## State names The CLI and the dashboard show one set of names. The API and webhooks show another. | CLI and dashboard | API and webhooks | Meaning | | - | - | - | | `stopping` | `archiving` | boat saves the disk and removes the machine | | `stopped` | `archived` | The disk is saved. The sandbox costs nothing | The API reports a stopped sandbox as `archived`. The webhook event for a stop is `sandbox.archived`. The field `archiveAfter` is the auto-stop time. These are names only. A stopped sandbox is not moved or deleted. ## Keep a stopped sandbox longer than 14 days | Day after the stop | What happens | | - | - | | 0 to 14 | The disk is kept for free. `boat resume` and `boat fork` work. | | After 14 | Eligible for automated retention cleanup once enabled. The job currently reports candidates without deleting them in production. Once deleted, resume and fork fail with `409 snapshot_data_expired`. | * A resume starts the 14 days again from the next stop. * A [saved snapshot](/snapshots/templates) has no scheduled expiry. Save one from a stopped sandbox before day 14. * Your plan includes 10 or more saved snapshots. Each one after that costs \$0.056 a day from the wallet. Delete it to stop the charge. To keep the disk of a sandbox that stays stopped a long time, save a saved snapshot before day 14. Then start from the saved snapshot instead of the sandbox: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshot bx_f7k2q9hd customer-42 # works on a stopped sandbox boat new --from customer-42 # later: a new sandbox with that disk boat snapshot rm customer-42 # when you no longer need it ``` To pay the least, save the saved snapshot only for sandboxes that are still stopped on day 13. Sandboxes that resume earlier need no saved snapshot. Record the stop time in your app when you call `boat stop`, and run the save from a daily job. ## Wait for the stop in a script `boat stop` returns when the stop starts, with state `stopping`. It does not wait for `stopped`. To wait, poll `boat info` until the state is `stopped`: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat stop "$ID" until [ "$(boat info "$ID" --json | jq -r .sandbox.state)" = "stopped" ]; do sleep 2; done ``` With the API, poll `GET /sandboxes/{sandboxId}` until `sandbox.state` is `archived`. A second stop is safe to send: | Sandbox is | `POST /sandboxes/{sandboxId}/stop` returns | | - | - | | Already stopping | `202` with the stop operation that runs | | Already stopped | `200` with the last stop operation | You do not need to wait before a plain `boat resume`. A resume during `stopping` takes back the same machine, with no restore. If boat cannot take the machine back, the resume fails with `409 sandbox_stopping`. The answer carries a `Retry-After` header and the stop operation. ### Resume within 10 minutes boat keeps the machine for 10 minutes after the sandbox reads `stopped`. These 10 minutes are not billed. * A plain `boat resume` in those 10 minutes usually takes back the same machine, with no restore. * Memory, running programs, open terminals and the IP address are then still there. * boat can release the machine early. The resume then starts a new machine from the snapshot, like a reboot. * After 10 minutes, a resume always starts a new machine from the snapshot. Make your work survive a new machine: run it as an [always-on service](/long-running-tasks/always-on-services). Wait for `stopped` before you resume with a new `--type` or `--environment`. Such a resume always starts a new machine. ## What a stop does boat does these steps in this order: 1. boat runs your [pre-stop command](#save-app-state-before-a-stop), if you have one. 2. boat stops your Docker containers. Each container gets 30 seconds to exit. 3. boat takes the last snapshot of the disk. 4. boat turns off the machine and removes it. boat does not shut down the operating system. Only Docker containers get a stop signal. Your other programs get no signal. A program that runs during the stop does not run its cleanup code. Its files go into the snapshot as they are at that moment. To clean up, use one of these: * Clean up when the sandbox starts again. An enabled systemd service with an `ExecStartPre=` step runs at every resume. Read [Always-on services](/long-running-tasks/always-on-services#run-an-always-on-service). * Run your own cleanup first, then run `boat stop`. ## Save app state before a stop Some apps keep recent changes in memory. They write them to disk later. Chrome is an example. Chrome writes new cookies to disk every 30 seconds, or when it closes. If you stop the sandbox a few seconds after a login, the snapshot has the old cookies. A kill signal does not help, because Chrome then exits without saving. To fix this, put a command in the file `~/.boat/pre-stop`. boat runs it at every stop, before the last snapshot. The example below closes Chrome. It needs Chrome to have a debug port. Start Chrome with `--remote-debugging-port=9222`. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} mkdir -p ~/.boat cat > ~/.boat/pre-stop <<'EOF' #!/bin/bash # Ask Chrome to close over its debug port, so it writes its cookies. node -e ' fetch("http://127.0.0.1:9222/json/version").then(r => r.json()).then(v => { const ws = new WebSocket(v.webSocketDebuggerUrl); ws.onopen = () => ws.send(JSON.stringify({ id: 1, method: "Browser.close" })); ws.onclose = () => process.exit(0); }).catch(() => process.exit(0));' # Then wait for it to exit. for i in $(seq 30); do pgrep -f remote-debugging-port=9222 >/dev/null || exit 0; sleep 1; done EOF chmod +x ~/.boat/pre-stop ``` A Chrome that you started without the flag does not answer, so the command does not close it. A Chrome that you opened from the desktop is an example. Start it again with the flag. How the pre-stop command runs: * It runs as `user`, in your home folder. * It has 60 seconds. After that, boat stops it. * It runs on `boat stop` and on auto-stop. * It does not run on `boat stop --force`. It does not run when you save a saved snapshot. * If it fails or takes too long, the stop continues. * The file is on the disk. Resumes, forks and saved snapshots keep it. ## When a stop is refused A stop saves the disk first. If the save fails, boat refuses the stop. The sandbox keeps running, so the unsaved work stays on its disk. boat tries again by itself and sends you an email. **You do not pay while the stop waits.** The billing meter pauses at the first refused stop. Your balance and your invoice both show the pause. You do not need to ask for a refund. * The meter stays paused while the stop waits, even if you or your scripts use the sandbox. * The meter starts again when the sandbox stops. * The meter also starts again when you resume the sandbox, because a resume cancels the stop. * If the refused stop was an auto-stop, the meter starts again when you use the sandbox again. The stop waits until a save works. Then the sandbox stops by itself. If this happens again and again, snapshots fail on that sandbox. The stop error shows the last snapshot error. We get an alert. Also [contact us](/support), so that we look at your sandbox. > [!WARNING] > > The boat agent in the sandbox uploads snapshots to `boat.dev` and to snapshot storage. If you block outbound traffic in the sandbox, let the agent service `ascii-agent.service` out, or every save fails and every stop is refused. An nftables `socket cgroupv2` rule stops to match when the agent restarts, for example on a boat update. Load that rule again each time `ascii-agent.service` starts. To stop the sandbox now, run `boat stop --force`. In the API, send `{"force": true}` in the body. The reply has `"forced": true` when boat reads the force. The sandbox stops with its last good snapshot. **You lose everything written after that snapshot.** After 3 days of failed saves, boat does a forced stop by itself. You then lose everything written after the last good snapshot. boat sends you an email one day before it does this. ## Why a sandbox stops by itself Auto-stop is the most common cause. For every cause and how to check it, read [Why did my sandbox stop?](/troubleshooting#why-did-my-sandbox-stop). ## Stop without saving To never save a sandbox, turn [snapshots off](/data-retention/snapshots-and-monitoring-off#snapshots-off) for your account or for one sandbox. boat then never saves it, and a stop erases it. # Saved snapshots Source: https://docs.boat.dev/snapshots/templates Save a sandbox under a name, use it as a template for many new sandboxes, make many copies at once, and share it with another account. A saved snapshot is a copy of a sandbox disk that you save under a name. Each new sandbox that you start from it gets the same disk. Use a saved snapshot as a template: install your tools one time, then start many sandboxes from it. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshot bx_23456789 web-stack # save the disk under a name boat new --from web-stack # start a new sandbox from it ``` ## Automatic and saved snapshots | | Automatic snapshot | Saved snapshot | | - | - | - | | Who makes it | boat, every minute and at each stop | You, with `boat snapshot <id> <name>` | | Belongs to | One sandbox | Your account or your organization | | Kept | The newest one while the sandbox runs and **at least 14 days after it stops**. Older ones expire ([details](/data-retention#how-long-boat-keeps-data)) | No scheduled expiry, even after the sandbox is gone. Unpaid extras can be deleted ([details](/data-retention#how-long-boat-keeps-data)) | | Used by | `boat resume`, `boat fork`, `boat snapshot pull` | `boat new --from <name>` | | Price | Free, no count limit | Included in your plan, then \$0.056 a day each from the wallet ([details](#saved-snapshot-pricing)) | ## Save a saved snapshot 1. Create a sandbox. Install everything: runtimes, packages, your app. 2. Save it with `boat snapshot <id> <name>`. This saves the disk as it is now, under the name. 3. Start each new sandbox with `boat new --from <name>`. Each deploy is ready in a few seconds. The time and the cost stay about the same, whatever the saved snapshot holds. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new # install your stack, then: boat snapshot bx_23456789 web-stack # save it under a name boat new --from web-stack # deploy as many as you want boat snapshots # your saved snapshots, then recent automatic snapshots boat snapshot rm web-stack # remove it and release its storage ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/saved-snapshots" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"sandboxId":"bx_23456789","name":"web-stack"}' curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"from":"web-stack","environment":"users","env":{"TENANT_ID":"acme"}}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.saveSavedSnapshot({ sandboxId: "bx_23456789", name: "web-stack" }); // poll until it settles at "ready" const saved = await sandbox.getSavedSnapshot({ name: "web-stack" }); await sandbox.create({ from: "web-stack", environment: "users", env: { TENANT_ID: "acme" } }); await sandbox.listSavedSnapshots(); await sandbox.deleteSavedSnapshot({ name: "web-stack" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.saved_snapshot_save_request import SavedSnapshotSaveRequest from boat_sdk.models.create_sandbox_request import CreateSandboxRequest sandbox.save_saved_snapshot(SavedSnapshotSaveRequest(sandbox_id="bx_23456789", name="web-stack")) # poll until it settles at "ready" saved = sandbox.get_saved_snapshot("web-stack") sandbox.create(create_sandbox_request=CreateSandboxRequest( var_from="web-stack", environment="users", env={"TENANT_ID": "acme"}, )) sandbox.list_saved_snapshots() sandbox.delete_saved_snapshot("web-stack") ``` `$BOAT_API_BASE` is `https://boat.dev/api/v1`. In Python, `from` is a reserved word, so the field is `var_from`. * `current` works only in a terminal that has the boat shell integration. In scripts, pass the sandbox id. * If the sandbox runs, the save takes a new snapshot of its disk. The call returns at once with status `saving`. The capture runs after that, in the background. A file that is on the disk when you run the command is in the save. * A write after the call can also land in the save. To save an exact state, wait until `getSavedSnapshot` shows `ready` before you write again. * If the sandbox is stopped, the save uses its last snapshot. * The save does not run your [pre-stop command](/snapshots/stop#save-app-state-before-a-stop). * `boat snapshots` shows the size of each saved snapshot. Docker containers and every tagged Docker image are in a saved snapshot. The build cache is not. Read [Docker](/snapshots/whats-saved#docker). ### A saved snapshot does not depend on its sandbox A saved snapshot is a full copy. The source sandbox can change, stop or be deleted. The name still deploys the exact disk that you saved. A saved snapshot does not expire. ## Make many copies To start many sandboxes with the same disk, save a saved snapshot one time. Then start each sandbox with `--from`. Do not fork a running sandbox again and again: each fork gets a slightly different disk. Each start counts against your start limits. Above a limit, the start fails with `429 rate_limited`. | Plan | Starts per minute / hour / day | Sandboxes at once | | - | - | - | | \$20 | 12 / 60 / 200 | 100 | | \$100 | 30 / 210 / 840 | 300 | | \$500 | 65 / 420 / 1,680 | 1,000 | | \$2000 | 90 / 600 / 2,400 | 2,000 | | [Free trial](/free-trial) | 5 / 25 / 75 | 2 | The example below paces for the \$20 plan. Change the wait for your plan. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} # 50 copies, paced for 12 starts per minute for i in $(seq 50); do boat new --from web-stack --json > "sandbox-$i.json" & sleep 5 done wait ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const ids: string[] = []; for (let i = 0; i < 50; i++) { const created = await sandbox.create({ from: "web-stack" }); ids.push(created.sandbox.id); await new Promise((r) => setTimeout(r, 5000)); // 12 starts per minute } ``` * To get an answer at once when no machine is free, add `--fail-fast`. Read [Fail fast when no machine is free](/machines/fail-fast). * To retry a create safely, send an `Idempotency-Key` header. A retry with the same key returns the same sandbox. * During the free trial, you can run 2 sandboxes at once. Read [Free trial](/free-trial). ## Update a saved snapshot Save the same name again: 1. Resume the sandbox, or use any sandbox that has the setup you want. 2. Update your tools. 3. Run `boat snapshot <id> <name>` with the same name. The name now deploys the new disk. boat removes the old copy. Sandboxes that you already deployed do not change. If the new save fails, the name keeps the last good save. To keep the old version too, save under a new name, for example `web-stack-v2`. ## Saved snapshots and environments A saved snapshot holds the **disk**. An [environment](/environments) holds the **settings**. Most setups use both. | | Saved snapshot | Environment | | - | - | - | | Holds | Installed packages, builds, caches | Repositories to clone, secrets, logins | | Answers | "What is already on this machine?" | "What can this machine use?" | | Costs | Storage, and a few seconds per deploy | Nothing | | To change it | Save the name again. Deployed sandboxes do not change | boat makes a new version. Running sandboxes change only when you upgrade them | | Used at | Deploy, one time | Every start, resume and fork | A simple rule: what you put in a Dockerfile goes in a saved snapshot. What you put in a `.env` file goes in an environment. Use both together: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --from web-stack --environment users --env TENANT_ID=acme ``` This sandbox starts with your tools installed, none of your logins, and one variable of its own. > [!WARNING] > > A deploy from a saved snapshot does **not** get the **environment** of the source sandbox. It gets the environment from `--environment`, or your default environment. So a saved snapshot that you saved while logged in to your GitHub does not give that access to its deploys. > > A deploy **does** get the **per-sandbox variables** of the source, the same as a fork. Each `--env KEY=VALUE` that you gave the source is set on every deploy, unless the deploy sends its own `env`. Do not put a secret in `--env` on a sandbox that you will save as a saved snapshot. ## Saved snapshot pricing Each account and each organization has included saved snapshots: 10 for every \$20 of plan per seat, and never fewer than 10. A \$100 plan includes 50. You cannot save a snapshot during the free trial. Saved snapshots that you already have stay free. You can keep more. Each saved snapshot above the included count costs \$0.056 a day (\$1.68 for 30 days). * boat takes this cost each day from your [wallet](/billing#wallet). The plan's included VM time does not pay it. * When you remove a saved snapshot, it stops costing from the next day. * A save goes to your active organization, or to the one that you pass with `--org`. All members of an organization share its included saved snapshots. See [Team images](#team-images-saved-snapshots-of-an-organization). * If a member leaves an organization, the organization keeps the saved snapshots that the member saved for it. * To save a new saved snapshot above the included count, the wallet needs money. With an empty wallet, the save fails with `credit_required`. * With [zero data retention](/data-retention/zero-data-retention) on, you cannot save a saved snapshot. `boat snapshots` shows how many saved snapshots you keep and their monthly cost. The API gives the same numbers in `allowance` on `GET /saved-snapshots`. ### When your wallet is empty 1. Your sandboxes get the usual grace period. Read [Why did my sandbox stop?](/troubleshooting#why-did-my-sandbox-stop). 2. Your saved snapshots above the included count get 7 days. 3. boat sends you an email. It lists these saved snapshots and the date that boat deletes them. boat sends a reminder one day before. 4. If your wallet is still empty on that date, boat deletes them. boat never deletes your most recent saved snapshots, up to the included count. To cancel the deletion, add money to the wallet: `boat wallet pay 20`. You can also remove saved snapshots until you are at or below the included count. ## Team images: saved snapshots of an organization A saved snapshot that you save under an organization belongs to the organization. Every member sees it in `boat snapshots` and starts sandboxes from it. No share code is necessary. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat --org acme snapshot bx_23456789 web-stack # save it for the organization boat --org acme new --from web-stack # any member deploys it ``` * The name counts on the organization's allowance, not on yours. * Any member can save the name again to update it. * The member who saved it, or an owner or admin of the organization, can remove it or make a share code. * It holds the disk of the member who saved it. If that member turns on zero data retention or deletes their account, boat deletes it. If the member only leaves the organization, the organization keeps it. * A sandbox that a teammate deploys gets none of your logins. Before it opens, boat removes your Claude, Codex and GitHub logins, your SSH keys and your environment secret files from its disk. The teammate's own environment then applies. Files that you cloned yourself stay. * Saved snapshots that you saved before 2026-10-22 under `--org` stay personal. Save them again under `--org` to make them team images. ## Share a saved snapshot with another account A share code lets another boat account deploy one of your saved snapshots. The other account runs `boat new --from <code>`. The new sandbox is in their account, and they pay for it. A share has two values: | Value | Prefix | Use | | - | - | - | | Share code | `bsh_...` | The secret that you give out. The other account deploys with it | | Share id | `shr_...` | Not secret. You use it to revoke the code | 1. Create the source sandbox. 2. Install your tools and save them: `boat snapshot <id> <name>`. 3. Make a code: `boat snapshot share <name>`. Give the `bsh_...` code to the other account. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshot share web-stack # prints the bsh_... code one time only boat snapshot shares web-stack # list share ids (shr_...), use counts, status boat snapshot unshare web-stack shr_... # revoke one code, by its share id # in the other account boat new --from bsh_... ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/saved-snapshots/web-stack/shares" \ -H "Authorization: Bearer $BOAT_API_KEY" curl -sS "$BOAT_API_BASE/saved-snapshots/web-stack/shares" \ -H "Authorization: Bearer $BOAT_API_KEY" curl -sS -X DELETE "$BOAT_API_BASE/saved-snapshots/web-stack/shares/shr_..." \ -H "Authorization: Bearer $BOAT_API_KEY" # in the other account curl -sS -X POST "$BOAT_API_BASE/sandboxes" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"from":"bsh_..."}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { shareCode, share } = await sandbox.createSnapshotShare({ name: "web-stack" }); await sandbox.listSnapshotShares({ name: "web-stack" }); await sandbox.revokeSnapshotShare({ name: "web-stack", shareId: share.id }); // in the other account await sandbox.create({ from: shareCode }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.create_sandbox_request import CreateSandboxRequest created = sandbox.create_snapshot_share("web-stack") sandbox.list_snapshot_shares("web-stack") sandbox.revoke_snapshot_share("web-stack", created.share.id) # in the other account sandbox.create(create_sandbox_request=CreateSandboxRequest(var_from=created.share_code)) ``` * boat shows the code one time only, when you make it. boat keeps only a hash of the code. * If you lose a code, revoke it and make a new one. * A code has 256 random bits. Nobody can guess it. > [!WARNING] > > Before the other account can use its sandbox, boat removes these from the disk: your logins and API keys, the secret files of your environment, your repository clones, and your SSH authorized keys. > > boat shares everything else on the disk. This includes secrets that you wrote into files yourself. The other account gets: * A sandbox in their account, which they pay for. * None of your per-sandbox variables. Their own environment applies, as with any `boat new`. To use no environment, they send `noEnv: true` (`--no-env`). What happens to a code over time: | You do this | Result | | - | - | | Save the same name again | The code deploys the new save | | Revoke the code | New deploys with the code fail. Sandboxes made before keep their copy | | Remove the name | boat removes its codes too. Sandboxes made before keep their copy | | Delete your account | Sandboxes made from your codes keep their copy | A wrong or revoked code fails with `404 snapshot_not_found`. API keys need these scopes: | Action | Scope | | - | - | | Make or revoke a code | `snapshot.write` | | List codes | `snapshot.read` | | Deploy from a code | `sandbox.create` and `snapshot.read`, the same as any `from` | # What a snapshot saves Source: https://docs.boat.dev/snapshots/whats-saved Which folders a snapshot saves and which it does not. Docker containers, images and build cache, tool caches, /tmp and the IP address after a resume. A snapshot saves the parts of the disk that you changed. It does not save the operating system that every machine already has. ## Saved and not saved > [card] Saved > > `/home/user`: your code, files and settings > > Every other home folder under `/home`, for example a second Linux user > > Folders that you create at `/`, for example `/code` or `/data` > > Docker **named volumes** (`/var/lib/docker/volumes`) > > Your Docker **containers** and every tagged Docker **image**, used by a container or not ([read more](#docker)) > > **Your changes** in `/etc`, `/usr`, `/opt`, `/root`, `/srv` and `/var`, with their owners and permissions. This means installed packages, systemd services, system settings, cron tables and the data of databases that you install with apt. > [card] Not saved > > The operating system and the tools that come with every machine > > The identity of the machine: hostname, IP address, network settings, [SSH host keys](/ssh-access#verify-the-host-key) > > `/tmp` and `/var/tmp`, `/var/cache`, the journal logs (`/var/log/journal`) and Docker internals other than volumes. Put files that must survive a stop in `/home/user` or in a folder that you create at `/`. > > Your cache folder `~/.cache`, except Playwright browsers and the Deno cache ([read more](#tool-caches)) > > Running programs, memory and open ports. A resume within 10 minutes of a stop usually gets them back on the same machine ([read more](/snapshots/stop#resume-within-10-minutes)) > > The Docker **build cache**, and untagged `<none>` images ([read more](#docker)) The IP address changes at every resume and fork. To reach a port at a fixed address, use a [public URL](/hosting). ### Keep a hostname A snapshot does not save `/etc/hostname`, so the hostname changes at every resume and fork. To keep a hostname, set it from an enabled systemd service. Enabled services start again after each resume and fork. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sudo tee /etc/systemd/system/set-hostname.service >/dev/null <<'EOF' [Unit] Description=Set a fixed hostname [Service] Type=oneshot ExecStart=/usr/bin/hostnamectl set-hostname my-sandbox [Install] WantedBy=multi-user.target EOF sudo systemctl enable --now set-hostname.service ``` To name a sandbox in boat, set its `name` instead. The hostname is not used for that. ## Deleted files stay deleted A deletion is a change, so the snapshot saves it too. For example, remove a coding agent that comes with the machine: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} sudo rm -rf /opt/kimi-code /usr/local/bin/kimi sudo npm uninstall -g @openai/codex ``` The agent stays gone after every resume, fork and deploy from a saved snapshot. The same is true for an apt package that you remove. If you install your own copy of a tool, your copy is used, not the one that comes with the machine. ## A restore is like a reboot When a sandbox comes back from a snapshot, it is like a server that restarts. * Your files, packages and system settings are there. * **Systemd services that you enabled start again by themselves.** * **Docker containers that ran start again by themselves.** * Programs that you started by hand are not running. Start them again, or make them a service. * Snap packages are reinstalled. Services and containers start a few seconds after the sandbox is `ready`. Read [Readiness and resume speed](/readiness). To keep a program running across stops, read [Keep a sandbox running](/long-running-tasks). ## Docker Docker and BuildKit are installed. This is what a resume, a fork or a deploy from a saved snapshot gets back: | Docker part | After a resume or fork | | - | - | | Named volumes | Saved. All data comes back | | Containers | boat creates each container again with its settings. Containers that ran start again. A Compose project comes back with `docker compose up` | | Images that a container uses, from a registry | boat pulls the exact same image again, by digest | | Images that a container uses, built in the sandbox | Saved in the snapshot, with their tags | | Other tagged images, also images that no container uses | Saved in the snapshot, with their tags | | Untagged `<none>` images | Not saved | | Build cache | Not saved. The first build starts from zero | A snapshot saves these images at the moment you take it. Do not stop Docker before `boat snapshot`. After a resume reaches `ready`, images and containers load in the background. They appear about 2 seconds later. Read [Readiness and resume speed](/readiness). boat pulls the registry images that a container uses from their registry at each resume. A private registry needs its login in the sandbox. ### Docker builds While a sandbox runs, `docker build` uses its layer cache as usual. A rebuild with no change takes less than one second. The cache is in `/var/lib/docker`, and a snapshot does not save it. To keep the build cache, save it in your home folder: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} docker buildx build \ --cache-to type=local,dest=$HOME/.buildcache,mode=max \ --cache-from type=local,src=$HOME/.buildcache \ --load -t myapp . ``` We measured this on a Node app with a slow dependency install: | Build | Time | | - | - | | First build, no cache | 38 s | | Rebuild on the same machine | 0.4 s | | Rebuild on a fork, with the saved cache | 8 s | ## Tool caches A snapshot does not save `~/.cache`. Tools that download files into it download them again after a resume or a fork. Two folders in `~/.cache` are saved: * `~/.cache/ms-playwright`: the Playwright browsers. `npx playwright install` puts them there by default. * `~/.cache/deno`: the Deno cache. To keep the cache of another tool, point that tool at a folder outside `~/.cache`. ## Leave files out with `.boatignore` Build output and dependency folders slow down every restore, and you can make them again. To leave them out of snapshots, write a `.boatignore` file. The next snapshot uses it. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} cd ~/myapp printf 'node_modules/\n.next/\n' > .boatignore ``` * It uses the same rules as `.gitignore`. * Its rules apply to the folder that it is in. A `.boatignore` in a repo applies to that repo. A `.boatignore` in your home folder applies to the whole sandbox. * boat looks for it up to six folders below your home folder. It does not look inside `node_modules`, `.next`, `target` or `vendor`. * Put the file at the top of the folder that you want to leave out, not inside it. * `.git` is always saved, because you cannot make it again. * boat also reads the old names `.boxignore` and `.oneignore`. If a folder has more than one, `.boatignore` wins. **boat does not read your `.gitignore`.** A `.gitignore` lists files that you do not commit. That is not the same as files that you can lose. Also, a tool that you install with `git clone` has its own `.gitignore`. For example, the `.gitignore` of `~/.nvm` lists every Node version that you install. # SSH Source: https://docs.boat.dev/ssh-access Open a shell in a sandbox, run commands, forward a port to your computer, connect VS Code or another SSH client, and copy files in and out. Run `boat ssh <id>` for a shell. The CLI creates the SSH key, authorizes it on the sandbox and checks the host key for you. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ssh bx_f7k2q9hd ``` In the dashboard, **Copy SSH** in the row menu of a sandbox copies this command. ## Run commands * For a script or an agent, use `boat exec`. It is faster than `boat ssh` because it opens no SSH session. * For a long-running server, add `--detach`. A normal command stops after 30 seconds by default. Read [Background commands](/long-running-tasks/background-commands). * In an integration, use the command API. The examples use `BOAT_API_BASE=https://boat.dev/api/v1`. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat exec bx_f7k2q9hd --cwd my-repo "npm test" boat ssh bx_f7k2q9hd "cd /home/user/my-repo && npm test" boat ssh bx_f7k2q9hd -- bash -s < ./setup.sh ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/commands" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"command":"npm test","cwd":"my-repo","timeoutSeconds":60}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const result = await sandbox.command({ sandboxId: "bx_f7k2q9hd", command: "npm test", cwd: "my-repo", timeoutSeconds: 60, }); console.log(result.stdout); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.command_request import CommandRequest result = sandbox.command( "bx_f7k2q9hd", CommandRequest(command="npm test", cwd="my-repo", timeout_seconds=60), ) print(result.actual_instance.stdout) # command() returns a wrapper ``` `boat ssh` and `boat exec` without an id use the last sandbox that you created or forked in this terminal. This needs the shell function that the installer adds. In scripts, always pass the id. > [!NOTE] > > * SSH works only while the sandbox runs. Resume a stopped sandbox first. > * In the first seconds of a start or a resume, SSH can answer `sandbox_restoring` or `sandbox_securing`. Retry a few seconds later. The CLI retries for you. ## Forward a port Use `boat forward` to reach a port of the sandbox on your own computer. Nothing becomes public. It works for any TCP service, for example a database. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat forward bx_f7k2q9hd --remote 5432 # sandbox 127.0.0.1:5432 -> your localhost:5432 boat forward bx_f7k2q9hd --remote 3000 --local 8080 # sandbox port 3000 -> your localhost:8080 boat forward bx_f7k2q9hd --reverse --local 7777 # your localhost:7777 -> sandbox 127.0.0.1:7777 ``` * The command runs until you press Ctrl+C. It connects again by itself after a network drop. * `--bind` changes the listen address. The default is `127.0.0.1`. * The API key needs the `ssh` action. For a URL that other people can open, read [Public URLs](/hosting). ## Use VS Code, Cursor or another SSH client The full setup, with an `~/.ssh/config` block, is on [VS Code, Cursor and SSH config](/ssh-access/editors). In short: 1. Authorize your public key on the sandbox. 2. Connect to `sshEndpoint` when it is set. Else connect to `machineIp` on port 22. 3. Pin the host key from the API response. 4. Do steps 1 to 3 again after each resume and fork. The machine, its IP address and its host key change. The curl tab does all three steps. It uses your own key `~/.ssh/id_ed25519`. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ssh bx_f7k2q9hd true # authorizes ~/.ssh/ascii_box_ed25519 and pins the host key for boat ssh boat info bx_f7k2q9hd # "ip", and "sshEndpoint" (host:port) when the sandbox has no public IPv4 ssh -i ~/.ssh/ascii_box_ed25519 user@<ip> # when sshEndpoint is null ssh -i ~/.ssh/ascii_box_ed25519 -p <port> user@<host> # when sshEndpoint is "host:port" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} resp="$(curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/sshkey" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"key\":\"$(cat ~/.ssh/id_ed25519.pub)\"}")" echo "bx_f7k2q9hd $(echo "$resp" | jq -r .hostKey)" > ~/.ssh/known_hosts_bx_f7k2q9hd # sshEndpoint ("host:port") is set when the sandbox has no public IPv4 of its own endpoint="$(echo "$resp" | jq -r '.sshEndpoint // empty')" host="${endpoint%:*}"; port="${endpoint##*:}" [ -n "$endpoint" ] || { host="$(echo "$resp" | jq -r .machineIp)"; port=22; } ssh -p "$port" -i ~/.ssh/id_ed25519 \ -o StrictHostKeyChecking=yes \ -o UserKnownHostsFile=~/.ssh/known_hosts_bx_f7k2q9hd \ -o HostKeyAlias=bx_f7k2q9hd \ user@"$host" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const { hostKey, machineIp, sshEndpoint } = await sandbox.sshKey({ sandboxId: "bx_f7k2q9hd", key: "ssh-ed25519 AAAAC3Nza... you@example.com", }); // write `bx_f7k2q9hd ${hostKey}` to a known_hosts file, then connect with HostKeyAlias=bx_f7k2q9hd // to sshEndpoint ("host:port") when it is set, else to machineIp on port 22 ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.ssh_key_request import SshKeyRequest resp = sandbox.ssh_key("bx_f7k2q9hd", SshKeyRequest(key="ssh-ed25519 AAAAC3Nza... you@example.com")) # write f"bx_f7k2q9hd {resp.host_key}" to a known_hosts file, then connect with HostKeyAlias=bx_f7k2q9hd # to resp.ssh_endpoint ("host:port") when it is set, else to resp.machine_ip on port 22 ``` * The CLI tab trusts the host key on the first connection. Use the curl tab to pin the key. * The host key comes over your API connection, not over SSH. You can trust it without a first-connection prompt. * An authorized key stays in `~/.ssh/authorized_keys` on the sandbox. Stop, resume and fork keep it. * The CLI key file keeps its old name, `~/.ssh/ascii_box_ed25519`. ### "REMOTE HOST IDENTIFICATION HAS CHANGED" Every resume and every fork runs the sandbox on a new machine with a new host key. `boat ssh` and `boat scp` get the new key for you. For another client, call the SSH key endpoint again and replace the line in your known_hosts file. ## Copy files * From a terminal, use `boat scp` with the sandbox ID as the remote host. Add `-r` for a folder. * In an integration, use the file and artifact API calls. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat scp ./local-file.txt bx_f7k2q9hd:/home/user/ boat scp bx_f7k2q9hd:/home/user/output.zip ./output.zip boat scp -r ./my-folder bx_f7k2q9hd:/home/user/ ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X PUT "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/files" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"path":"notes/input.txt","content":"hello\n","encoding":"utf8"}' curl -L -o output.zip "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/artifacts?path=output.zip" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.writeFile({ sandboxId: "bx_f7k2q9hd", path: "notes/input.txt", content: "hello\n", encoding: "utf8", }); const artifact = await sandbox.artifact({ sandboxId: "bx_f7k2q9hd", path: "output.zip" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.file_write_request import FileWriteRequest sandbox.write_file("bx_f7k2q9hd", FileWriteRequest( path="notes/input.txt", content="hello\n", encoding="utf8", )) artifact = sandbox.artifact("bx_f7k2q9hd", "output.zip") ``` File read and write paths follow these rules: | Path | Rule | | - | - | | Relative | boat resolves it from the sandbox work directory, `/home/user`. | | Absolute | It must resolve under `/home/user` or `/tmp`. | | Absolute, outside these roots | boat refuses it with a 400 `invalid_path` error. The error names the allowed roots. | ### Large files The JSON file calls stop at 5 MiB. For a larger file, ask for a signed URL and send the bytes straight to the sandbox. The sandbox serves the URL itself. So boat sets no size limit, and the transfer needs no Authorization header. ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} # Upload: get a URL, then PUT the raw file to it url=$(curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/files/upload-url" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"path":"data/dataset.parquet"}' | jq -r .url) curl -sS -X PUT --data-binary @dataset.parquet "$url" # Download: get a URL, then GET it url=$(curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/files/download-url" \ -H "Authorization: Bearer $BOAT_API_KEY" -H "Content-Type: application/json" \ -d '{"path":"output/model.bin"}' | jq -r .url) curl -sS -o model.bin "$url" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const up = await sandbox.createUploadUrl({ sandboxId: "bx_f7k2q9hd", path: "data/dataset.parquet" }); await fetch(up.url, { method: "PUT", body: await fs.readFile("dataset.parquet") }); const down = await sandbox.createDownloadUrl({ sandboxId: "bx_f7k2q9hd", path: "output/model.bin" }); const bytes = await (await fetch(down.url)).arrayBuffer(); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import requests from boat_sdk.models.file_url_request import FileUrlRequest up = sandbox.create_upload_url("bx_f7k2q9hd", FileUrlRequest(path="data/dataset.parquet")) with open("dataset.parquet", "rb") as f: requests.put(up.url, data=f) down = sandbox.create_download_url("bx_f7k2q9hd", FileUrlRequest(path="output/model.bin")) open("model.bin", "wb").write(requests.get(down.url).content) ``` * A URL works for one path and one direction (download or upload). * It expires after 15 minutes. Pass `ttlSeconds` (up to 3600) to change that. * An upload creates missing directories. It replaces an existing file only when the upload completes. * Anyone who has the URL can use it until it expires. Do not log it or share it. * Getting a download URL needs `file.read`. Getting an upload URL needs `file.write`. For all `scp` options, read [CLI reference](/cli-reference#boat-scp). ## Related * [VS Code, Cursor and SSH config](/ssh-access/editors) * [Public URLs](/hosting) * [Long-running tasks](/long-running-tasks) * [Desktop streaming](/desktop-streaming) # VS Code, Cursor and SSH config Source: https://docs.boat.dev/ssh-access/editors Open a sandbox in VS Code Remote-SSH or Cursor with an ~/.ssh/config entry, and refresh the address and host key after each resume. VS Code Remote-SSH and Cursor use the normal OpenSSH client. They read `~/.ssh/config`. The boat CLI does not write that file. Use the script below to write one entry per sandbox. > [!WARNING] > > Each resume and each fork moves the sandbox to a new machine. The address and the SSH host key change. Run the script again after each resume. ## Before you start * An API key with the `ssh` action in `BOAT_API_KEY`. Read [API keys](/api-keys). * An SSH key pair at `~/.ssh/id_ed25519`. Create one with `ssh-keygen -t ed25519` if you have none. * `curl` and `jq`. * On Windows, run the script in Git Bash. VS Code reads the same `C:\Users\<you>\.ssh\config`. ## 1. Save the script Save this as `boat-ssh-config.sh`: ```bash boat-ssh-config.sh theme={"theme":{"light":"github-light","dark":"github-dark-default"}} #!/usr/bin/env bash # Usage: bash boat-ssh-config.sh <sandbox-id> # Authorizes ~/.ssh/id_ed25519 on the sandbox and writes ~/.ssh/boat/<id>.conf. set -euo pipefail id="$1" key=~/.ssh/id_ed25519 resp="$(curl -fsS -X POST "https://boat.dev/api/v1/sandboxes/$id/sshkey" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"key\":\"$(cat "$key.pub")\"}")" # sshEndpoint ("host:port") is set when the sandbox has no public IPv4 of its own endpoint="$(echo "$resp" | jq -r '.sshEndpoint // empty')" if [ -n "$endpoint" ]; then host="${endpoint%:*}"; port="${endpoint##*:}" else host="$(echo "$resp" | jq -r .machineIp)"; port=22 fi mkdir -p ~/.ssh/boat echo "$id $(echo "$resp" | jq -r .hostKey)" > ~/.ssh/boat/"$id".known_hosts cat > ~/.ssh/boat/"$id".conf <<EOF Host $id HostName $host Port $port User user IdentityFile "$key" HostKeyAlias $id UserKnownHostsFile "$HOME/.ssh/boat/$id.known_hosts" StrictHostKeyChecking yes EOF echo "Wrote ~/.ssh/boat/$id.conf" ``` ## 2. Include the entries in your SSH config Add this line at the **top** of `~/.ssh/config`, before any `Host` line: ```text ~/.ssh/config theme={"theme":{"light":"github-light","dark":"github-dark-default"}} Include ~/.ssh/boat/*.conf ``` ## 3. Write the entry and connect ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} bash boat-ssh-config.sh bx_f7k2q9hd ssh bx_f7k2q9hd true # test: prints nothing and exits 0 ``` * **VS Code**: install the Remote - SSH extension. Run **Remote-SSH: Connect to Host...** and pick `bx_f7k2q9hd`. * **Cursor**: run **Remote-SSH: Connect to Host...** and pick `bx_f7k2q9hd`. * Other tools that read `~/.ssh/config` work the same way. Open the folder `/home/user/<your-repo>`. ## After a resume or a fork 1. Run `bash boat-ssh-config.sh <id>` again. It writes the new address and the new host key. 2. Reconnect the editor. For a fork, use the id of the fork. Each sandbox gets its own entry. If you skip step 1, SSH stops with `REMOTE HOST IDENTIFICATION HAS CHANGED` or cannot connect. Do not delete the key check. Run the script. ## Good to know * An open editor does not delay auto-stop. To keep the sandbox up for a work day, run `boat extend <id> --hours 8`. Read [Auto-stop](/long-running-tasks/auto-stop). * The editor installs its server in `/home/user/.vscode-server` or a similar folder. Snapshots keep it, so the next connection after a resume is faster. * Your key stays authorized after a stop, a resume and a fork. The script authorizes it again anyway. This is safe. * `boat ssh <id>` needs none of this. It finds the address and the host key itself. ## Related * [SSH](/ssh-access) * [Forward a port](/ssh-access#forward-a-port) # Support Source: https://docs.boat.dev/support How to reach the boat team by email or Discord, and what to send so we can help on the first reply. ## Contact | Channel | Use it for | | - | - | | Email [support@ascii.dev](mailto:support@ascii.dev) | Account, billing, refunds, a sandbox that misbehaves, security issues, anything private. | | [Discord](https://discord.gg/Y3TFTmE89g) | Questions, ideas, and help from the team and other users. | The support address is on `ascii.dev`, the mail domain of the company behind boat. It is the right address for boat. You do not need to contact us to use a feature that your plan includes. For example, `xlarge` needs only the \$100 plan or higher. Read [Pricing](/pricing). ## What to send * The email address of your boat account. * The sandbox ID, for example `bx_23456789`, if one sandbox is affected. * The command or API call you ran, and the full error text. * The `requestId` from the API error, if you have one. * The time it happened, with your time zone. Do not send API keys, passwords or secret files. We never ask for them. ## Before you write * Is the platform down? See [status.ascii.dev](https://status.ascii.dev). Uptime, SOC 2 and data location are on [Compliance and uptime](/compliance). * A sandbox stopped or does not answer? Read [Troubleshooting](/troubleshooting). * A `429` or another error code? Read [Limits and errors](/limits). # Troubleshooting Source: https://docs.boat.dev/troubleshooting Why a sandbox stopped by itself, what to do when a sandbox does not answer or is in error, out of memory (exit 137), out-of-disk emails, and what common error messages mean. Start with `boat info <id>`. It shows the state, the auto-stop time (`archiveAfter`), the reason for a stop or a failure (`error`), and the time of the last snapshot (`snapshotCompletedAt`). ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat info bx_f7k2q9hd ``` ## Why did my sandbox stop? Auto-stop is the most common cause. A stop by boat keeps the disk, the same as `boat stop`, unless the table says otherwise. | Cause | How to check | Data | | - | - | - | | **Auto-stop.** The default is 1 hour, counted from the create or the last resume. A running prompt moves the time later | `archiveAfter` in `boat info` is in the past | Kept | | **Empty wallet for 24 hours.** The included time is used and the wallet is empty. boat sends an email, then stops your sandboxes 24 hours later | `boat wallet`. Email "Your sandboxes will stop soon" | Kept | | **Plan cancelled with an empty wallet.** The stop comes at once, with no 24-hour wait | `boat billing status` | Kept | | **Free trial used its 25 hours of compute** | `boat billing status`. New starts fail with `trial_compute_limit_reached` | Kept. Read [Free trial](/free-trial) | | **Forced stop after 3 days of failed saves.** A stop was refused because its snapshot kept failing | Email "could not be stopped" | Kept up to the last good snapshot. Later writes are lost | | **Machine stopped answering for 3 days**, with no snapshot newer than the failure | Email about a sandbox that stopped responding | Kept up to the last good snapshot. Later writes are lost | | **Account closed** | Email that confirms the closing | Kept for 30 days. Read [Close your account](/data-retention/close-account) | Two settings change what a stop keeps: | Setting | How to check | Data | | - | - | - | | [Zero data retention](/data-retention/zero-data-retention) | `boat data-retention status` | Deleted at the stop. You cannot resume | | [Snapshots off](/data-retention/snapshots-and-monitoring-off#snapshots-off) | `"snapshots": false` in `boat info` | Erased at the stop. You cannot resume | To get the sandbox back, run `boat resume <id>`. > [!WARNING] > > boat keeps the disk of a stopped sandbox for at least 14 days. After that, automated retention cleanup can delete it once enabled, whatever caused the stop. The job currently reports candidates without deleting them in production. Read [Keep a stopped sandbox longer than 14 days](/snapshots/stop#keep-a-stopped-sandbox-longer-than-14-days). To stop auto-stop for a long job: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat extend bx_f7k2q9hd --hours 12 # sets the auto-stop to 12 hours from now boat extend bx_f7k2q9hd --no-auto-stop # runs until you stop it ``` Read [Auto-stop](/long-running-tasks/auto-stop). To never stop for an empty wallet, turn on **Auto top-up** on the [Billing](https://boat.dev/dashboard?tab=billing) tab, or run `boat wallet auto-top-up 50`. ## A sandbox does not answer If commands and SSH hang, boat marks the sandbox as not answering. boat sends you an email. **Billing pauses while it does not answer.** The disk stays on the machine. Do these steps in this order: 1. Wait a few minutes. After a kernel crash, the machine restarts by itself in about 15 seconds. The disk is not touched. A sandbox that answers again reconnects by itself, with all its data. 2. If it still does not answer, run `boat stop --force <id>`, then `boat resume <id>`. The sandbox comes back from its last good snapshot. **You lose what was written after that snapshot.** `snapshotCompletedAt` in `boat info` shows its time. 3. If the sandbox never completed a snapshot, do not stop it. [Contact us](/support). We get the disk back by hand. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat stop --force bx_f7k2q9hd boat resume bx_f7k2q9hd ``` After 3 days without an answer, boat stops the sandbox. It falls back to its last snapshot. boat sends a reminder one day before. > [!NOTE] > > `boat recover` and `POST /sandboxes/{id}/recover` are deprecated. boat removes them soon. Use the steps above. ## A sandbox is in error `error` means that boat lost contact with the machine, or that a start failed. `boat info` shows the reason in `error`. | Question | Answer | | - | - | | Am I billed? | No. Billing stops while the sandbox is in `error` | | Is my data safe? | boat keeps the machine and its disk for 3 days. Everything up to the last snapshot is safe in any case | | Does boat fix it by itself? | Sometimes. If the last snapshot is newer than the failure, boat rebuilds the sandbox on a new machine from that snapshot and sends you an email | | Can I run commands? | No. Commands fail with `409 sandbox_not_ready` | Do these steps in this order: 1. Read the reason: `boat info <id>`. Check your email from boat. 2. If it is still in `error`, run `boat resume <id>`. You lose what was written after `snapshotCompletedAt`. 3. If you cannot lose that work, do not resume. [Contact us](/support) within 3 days. After 3 days, boat stops the sandbox. It falls back to its last snapshot. To stop an errored sandbox without a resume, run `boat stop <id>`. To erase it, read [Delete a sandbox](/data-retention/delete). ## A command was killed: exit code 137 (out of memory) Your programs can use all the RAM of the size except 512 MiB. boat keeps that part for its own services. Above that limit, Linux kills the process that uses the most memory. The sandbox stays up. * The killed command ends with `exitCode` 137, and the command result shows `oomKilled: true`. * Other processes and the sandbox keep running. * Use less memory, or move to a bigger size. Read [Change size](/machines/change-size). ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat stop bx_f7k2q9hd until [ "$(boat info bx_f7k2q9hd --json | jq -r .sandbox.state)" = "stopped" ]; do sleep 2; done boat resume bx_f7k2q9hd --type large ``` ## Out-of-disk emails boat reads the disk use of each running sandbox and emails you: | Disk use | Email | | - | - | | 85% | A warning. Free space before the disk fills. | | 95% | "Out of disk". Snapshots fail, so your newest work is not saved. A stop also fails. | You get at most one email per level per day for each sandbox. When space gets low, boat deletes caches that it can download again: the apt cache, journal logs and pulled Docker images that no container uses. boat never deletes your own files. To free space: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat ssh bx_f7k2q9hd docker system prune # unused Docker data sudo apt-get clean # apt download cache ``` If the sandbox needs more disk, stop it and resume it with a bigger `--type`. If you cannot get in, [contact us](/support). Do not resume from an old snapshot if you need the unsaved work. ## A stop does not finish A stop saves the disk first. If the save fails, boat refuses the stop, keeps the sandbox running and does not bill you while it waits. Read [When a stop is refused](/snapshots/stop#when-a-stop-is-refused). `boat stop` returns at `stopping`. A short `stopping` is normal. To wait for `stopped`, read [Wait for the stop in a script](/snapshots/stop#wait-for-the-stop-in-a-script). ## Error messages ### `409 snapshot_data_expired` ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} This sandbox's data was deleted after it was stopped for at least 14 days. Save a saved snapshot to keep data: boat snapshot <id> <name>. ``` boat deleted this sandbox's data after it had been stopped for at least 14 days. Resume, fork and a saved snapshot save of this sandbox fail. You cannot get the data back. The sandbox stays in your list until you delete it. Next time, save a saved snapshot before day 14. Read [Keep a stopped sandbox longer than 14 days](/snapshots/stop#keep-a-stopped-sandbox-longer-than-14-days). ### `409 sandbox_starting` ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} Sandbox is still starting (current state: provisioned); environment and secrets are not applied yet. Retry when the sandbox is ready. ``` The API held your command for 60 seconds, and the sandbox was still starting. Send the command again. Read [Readiness and resume speed](/readiness). ### `409 sandbox_not_ready` ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} Sandbox bx_abc12345 is in error: <reason>. Run `boat resume bx_abc12345`, then retry. ``` The sandbox is in `error` or another state that cannot run commands. Run `boat resume <id>`. For `error`, read [A sandbox is in error](#a-sandbox-is-in-error). ### `409 machine_not_running` ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} Sandbox bx_abc12345 is stopped. Run `boat resume bx_abc12345`, then retry. ``` The sandbox has no machine now. Usually its TTL ran out or someone stopped it. Run the `boat resume` command from the message. The body also carries `state`, and `retryable` is `true` only while the sandbox is still starting. ### `409 sandbox_stopping` ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} Sandbox is still stopping and would resume on its live machine, which cannot switch size. ``` A resume during `stopping` keeps the same machine. It cannot change the size, the environment, the provider or the host. The stop finishes in a few seconds. The answer carries a `Retry-After` header and the running stop operation. Wait that many seconds, or wait for `stopped`. Then run the same resume again. ### `429 rate_limited` ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} You used all 200 sandbox starts included in the last 24 hours. Your running sandboxes keep running. New ones can start again at 14:32 UTC. Need more now? Pick one: 1. Pay per extra start, from $0.03 each, on your next invoice, up to $80 a month. boat billing extra-starts on 2. Move to the $100 plan, 840 starts included a day. boat billing plan 100 3. Add seats to your team, each seat adds 20% more starts, up to the next plan. https://boat.dev/dashboard?tab=billing ``` Nothing is broken. Create, fork and resume each count as one start. Run one of the commands, or wait until that time. Read [Limits and errors](/limits). ### `429 trial_compute_limit_reached` ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} Trial Sandbox compute is limited to 25 hours total. Stopping, forking, or resuming does not reset that allowance. ``` The free trial used its 25 hours. The first payment removes this limit. Read [Free trial](/free-trial). ### `503 no_ready_machine` You sent `failFast` and no machine of that size was free. Nothing was created or billed. Retry, or fall back to another size. Read [Fail fast when no machine is free](/machines/fail-fast). ### `402 credit_required` You keep your plan's included saved snapshots or more, and you saved one more with an empty wallet. Add money with `boat wallet pay 20`, or remove a saved snapshot. Read [Saved snapshot pricing](/snapshots/templates#saved-snapshot-pricing). ## Still stuck [Contact us](/support). Send the sandbox id and the output of `boat info <id>`. # Webhooks Source: https://docs.boat.dev/webhooks Receive signed notifications when a sandbox becomes ready, finishes restoring, fails, stops, degrades or recovers. A webhook sends sandbox lifecycle events to your HTTPS endpoint. One webhook gets the events of all the sandboxes in your account. Use webhooks to: * Start work when a sandbox is usable. * Respond when a sandbox fails to start. * Continue an automation after a sandbox stops. boat sends 6 events: `sandbox.ready`, `sandbox.hydrated`, `sandbox.error`, `sandbox.archived` (stopped), `sandbox.degraded` and `sandbox.recovered`. Read [Events](#events). | | CLI | API | SDKs | Dashboard | | - | - | - | - | - | | Register | `boat webhook create` | `POST /webhooks` | `createWebhook` | [Webhooks & OTel](https://boat.dev/dashboard?tab=webhooks) | | List / read | `boat webhook list` | `GET /webhooks`, `GET /webhooks/{id}` | `listWebhooks`, `getWebhook` | [Webhooks & OTel](https://boat.dev/dashboard?tab=webhooks) | | Edit in place | not available | `PATCH /webhooks/{id}` | `updateWebhook` | not available | | Rotate secret | `boat webhook rotate` | `POST /webhooks/{id}/rotate` | `rotateWebhookSigningSecret` | [Webhooks & OTel](https://boat.dev/dashboard?tab=webhooks) | | Remove | `boat webhook remove` | `DELETE /webhooks/{id}` | `deleteWebhook` | [Webhooks & OTel](https://boat.dev/dashboard?tab=webhooks) | | Delivery history | not available | not available | not available | [Webhooks & OTel](https://boat.dev/dashboard?tab=webhooks) → Deliveries | ## Register an endpoint The examples use `BOAT_API_BASE=https://boat.dev/api/v1`. The API key needs the `account.admin` action. ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat webhook create https://example.com/hooks/sandbox \ --name production \ --event ready \ --event error \ --event archived ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/webhooks" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "production", "url": "https://example.com/hooks/sandbox", "events": ["sandbox.ready", "sandbox.error", "sandbox.archived"] }' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} const created = await sandbox.createWebhook({ name: "production", url: "https://example.com/hooks/sandbox", events: new Set(["sandbox.ready", "sandbox.error", "sandbox.archived"]), }); console.log(created.webhook.id, created.secret); // secret is shown once ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.webhook_create_request import WebhookCreateRequest created = sandbox.create_webhook(WebhookCreateRequest( name="production", url="https://example.com/hooks/sandbox", events=["sandbox.ready", "sandbox.error", "sandbox.archived"], )) print(created.webhook.id, created.secret) # secret is shown once ``` How to name events: | Surface | Event names | If you give no event | | - | - | - | | CLI `--event` | `ready`, `error`, `archived`, `hydrated`, `degraded` or `recovered`. The `sandbox.` prefix is optional. | You get all six events. | | API and SDKs | The full name, for example `sandbox.ready`. | The call fails. You must give at least one event. | The call returns a signing secret that starts with `whsec_`. **You see this secret only once.** Store it in your secret manager. > [!NOTE] > > The endpoint must use HTTPS on port 443. Its address must resolve only to public IP addresses. boat does not follow redirects. An account can register up to 10 endpoint URLs. ## Manage endpoints ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat webhook list boat webhook rotate <id> # replaces the signing secret boat webhook remove <id> ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS "$BOAT_API_BASE/webhooks" \ -H "Authorization: Bearer $BOAT_API_KEY" curl -sS "$BOAT_API_BASE/webhooks/$WEBHOOK_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" curl -sS -X PATCH "$BOAT_API_BASE/webhooks/$WEBHOOK_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"events":["sandbox.error"]}' curl -sS -X POST "$BOAT_API_BASE/webhooks/$WEBHOOK_ID/rotate" \ -H "Authorization: Bearer $BOAT_API_KEY" curl -sS -X DELETE "$BOAT_API_BASE/webhooks/$WEBHOOK_ID" \ -H "Authorization: Bearer $BOAT_API_KEY" ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.listWebhooks(); await sandbox.getWebhook({ webhookId: "wh_0123456789abcdef01234567" }); await sandbox.updateWebhook({ webhookId: "wh_0123456789abcdef01234567", events: new Set(["sandbox.error"]), }); const rotated = await sandbox.rotateWebhookSigningSecret({ webhookId: "wh_0123456789abcdef01234567" }); console.log(rotated.secret); await sandbox.deleteWebhook({ webhookId: "wh_0123456789abcdef01234567" }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.webhook_update_request import WebhookUpdateRequest sandbox.list_webhooks() sandbox.get_webhook("wh_0123456789abcdef01234567") sandbox.update_webhook( "wh_0123456789abcdef01234567", WebhookUpdateRequest(events=["sandbox.error"]), ) rotated = sandbox.rotate_webhook_signing_secret("wh_0123456789abcdef01234567") print(rotated.secret) sandbox.delete_webhook("wh_0123456789abcdef01234567") ``` The [Webhooks & OTel](https://boat.dev/dashboard?tab=webhooks) tab of the dashboard does the same tasks. Only the dashboard shows the delivery history. > [!NOTE] > > Only the API and SDKs can change the name, URL or events of an endpoint in place (`PATCH /webhooks/{webhookId}`). The CLI and the dashboard cannot edit an endpoint. Delete it and create it again. This gives you a new signing secret. When you rotate the secret, accept the old secret and the new secret for a short time. A delivery attempt that already started can still carry the old signature. When you delete an endpoint, boat removes its queued deliveries. A delivery attempt that already started can still arrive. ## Events | Event | boat sends it when | | - | - | | `sandbox.ready` | A sandbox becomes usable (`ready`, `idle` or `running`) after it was not usable. This includes recovery from an error. boat can run commands now. Your own services and Docker containers can need more seconds to start. | | `sandbox.hydrated` | A restored sandbox finishes materializing. See [After a restore](#after-a-restore). | | `sandbox.error` | A sandbox enters `error`. | | `sandbox.archived` | A sandbox is stopped. The API reports a stopped sandbox as `archived`. | | `sandbox.degraded` | The machine is alive, but boat cannot fully reach it. boat sends this about a minute after the machine stops answering. The sandbox keeps running. boat does not stop it. `data.reason` gives the cause. | | `sandbox.recovered` | A degraded sandbox is fully reachable again. This happens on the same machine, or on a new machine after a resume or an automatic recovery. | boat creates `sandbox.ready`, `sandbox.error` and `sandbox.archived` in the same database transaction as the state change. ### After a restore `sandbox.hydrated` arrives after `sandbox.ready`. It can arrive at the same moment, or minutes later. 1. The sandbox becomes `ready`. boat sends `sandbox.ready`. 2. The Docker containers of the sandbox start as soon as their images load. 3. The background disk copy finishes. The Docker volumes move onto the real disk. 4. Each running container's volume mounts move onto the real disk in place. The containers pause for about 0.1 s. They do not restart. 5. boat sends `sandbox.hydrated`. To poll instead, read `hydrated` and `hydratedAt` on `GET /sandboxes/{id}`. ### Degraded sandboxes A degraded sandbox shows `"health": "degraded"` and a `healthReason` on `GET /sandboxes/{id}`. The most common cause is a firewall rule inside the sandbox that blocks the boat tunnel. See [Firewall rules](/hosting/firewall). ## Payload ```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}} { "id": "evt_2af97cd17a8248bb8fe37653a235bc91", "type": "sandbox.ready", "createdAt": "2026-08-11T12:00:00.000Z", "data": { "sandbox": { "id": "bx_23456789", "name": "Production worker" }, "previousState": "cloning", "state": "ready" } } ``` * `data.sandbox.id` is the public sandbox ID. * Use the top-level event `id` as an idempotency key. The fields in `data` change with the event: | Event | `previousState` | `state` | `reason` | | - | - | - | - | | `sandbox.ready`, `sandbox.error`, `sandbox.archived` | yes | yes | no | | `sandbox.hydrated` | no | no | no | | `sandbox.degraded`, `sandbox.recovered` | no | yes | yes | ## Verify signatures Each request has these headers. The header names keep the old `Ascii` prefix. | Header | Value | | - | - | | `X-Ascii-Event` | Event type | | `X-Ascii-Delivery` | Stable event ID | | `X-Ascii-Timestamp` | Unix timestamp for this attempt | | `X-Ascii-Signature` | `v1=` followed by a hex HMAC-SHA256 signature | | `X-Ascii-Attempt` | Attempt number, starting at 1 | To verify a request: 1. Compute the expected signature over the exact raw request body: ```text theme={"theme":{"light":"github-light","dark":"github-dark-default"}} HMAC_SHA256(secret, delivery_id + "." + timestamp + "." + raw_body) ``` 2. Compare the signatures in constant time. 3. Reject old timestamps. 4. Deduplicate on the delivery ID. ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import { createHmac, timingSafeEqual } from "node:crypto"; function verifyWebhook(rawBody: Buffer, headers: Headers, secret: string) { const id = headers.get("x-ascii-delivery") ?? ""; const timestamp = headers.get("x-ascii-timestamp") ?? ""; const supplied = (headers.get("x-ascii-signature") ?? "").replace(/^v1=/, ""); const expected = createHmac("sha256", secret) .update(`${id}.${timestamp}.`) .update(rawBody) .digest("hex"); const issuedAt = Number(timestamp); if (!Number.isFinite(issuedAt) || Math.abs(Date.now() / 1000 - issuedAt) > 300) return false; if (!/^[a-f0-9]{64}$/i.test(supplied)) return false; return timingSafeEqual(Buffer.from(supplied, "hex"), Buffer.from(expected, "hex")); } ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} import hmac, re, time from hashlib import sha256 def verify_webhook(raw_body: bytes, headers, secret: str) -> bool: delivery = headers.get("x-ascii-delivery", "") timestamp = headers.get("x-ascii-timestamp", "") supplied = headers.get("x-ascii-signature", "").removeprefix("v1=") try: if abs(time.time() - float(timestamp)) > 300: return False except ValueError: return False if not re.fullmatch(r"[a-fA-F0-9]{64}", supplied): return False expected = hmac.new( secret.encode(), f"{delivery}.{timestamp}.".encode() + raw_body, sha256, ).hexdigest() return hmac.compare_digest(supplied.lower(), expected) ``` > [!WARNING] > > Verify the raw bytes before you parse the JSON. If you serialize the body again, the signature changes. ## Delivery and retries | Your endpoint | What boat does | | - | - | | Returns a `2xx` | Marks the event as delivered. | | Returns another status, fails to connect, or takes more than 5 seconds | Retries with exponential backoff, up to 8 attempts. | * Delivery is **at least once**. The same event ID can arrive more than once. * Events can arrive out of order. Use the ID, creation time and state of each event. Do not rely on the request order. * Return a `2xx` quickly. Move slow work to your own queue. * boat keeps completed and exhausted delivery records for 30 days. ## Inspect deliveries 1. Open [Webhooks & OTel](https://boat.dev/dashboard?tab=webhooks) in the boat dashboard. 2. Expand **Deliveries** next to an endpoint. The log of recent deliveries shows: * The event that boat sent. * The exact payload. * The boat ID and the event ID. * The number of attempts. * The HTTP result, or a connection diagnostic. * The time of the next retry, if there is one. # Windows apps Source: https://docs.boat.dev/windows-apps Run Windows-only desktop software in a sandbox with Wine, let an agent drive it, and reuse the set-up sandbox as a saved snapshot. A sandbox runs Windows programs on its Linux desktop through [Wine](https://www.winehq.org). * The programs open as normal windows on the [desktop stream](/desktop-streaming). You can watch them. * The agents of the sandbox can click, type and read them with the built-in [`computer` tools](/integrated-agents/computer-use). * You install once. Then you save the sandbox as a [saved snapshot](/snapshots/templates) and start new sandboxes from it. ## Main task 1. [Install Wine](/windows-apps/install-wine) in the sandbox. It takes about 5 minutes. 2. [Install and start the app](/windows-apps/run-apps). Every GUI command needs `DISPLAY=:0`. Check the [tested apps](/windows-apps/tested-apps) first. 3. [Give a prompt to an agent](/windows-apps/agents-and-forks#let-an-agent-drive-it) that uses the app. 4. [Save a saved snapshot and start a sandbox from it](/windows-apps/agents-and-forks#set-up-once-start-many-times) for each task. If something fails, read [Windows apps troubleshooting](/windows-apps/troubleshooting). ## Learn more > [card] [Tested apps](/windows-apps/tested-apps) > > The apps that run, the extra steps they need, and the apps that do not run. > [card] [Install Wine](/windows-apps/install-wine) > > The install script, and what each part of it does. > [card] [Run an app](/windows-apps/run-apps) > > Install and start an app. Recipes for Steam, Paint.NET, Sysinternals and Direct3D games. > [card] [Agents and forks](/windows-apps/agents-and-forks) > > Let an agent drive the app. Set up once, then start many sandboxes from a saved snapshot. > [card] [Windows apps troubleshooting](/windows-apps/troubleshooting) > > Common errors and their fixes. Licence rules. ## Related * [Desktop streaming](/desktop-streaming) * [Computer use](/integrated-agents/computer-use) * [Saved snapshots](/snapshots/templates) * [Long-running tasks](/long-running-tasks) # Agents and forks Source: https://docs.boat.dev/windows-apps/agents-and-forks Let an agent drive a Windows app in a sandbox. Set up the sandbox once, save it as a saved snapshot, and start a new sandbox from it for each task. ## Let an agent drive it The Windows apps open as ordinary windows on the sandbox desktop. A prompt is enough. The agent needs a connected AI key first: read [Keys](/integrated-agents/keys). ```bash CLI theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat prompt bx_f7k2q9hd --provider claude "Open Notepad++, write a short release note, and save it as release.txt in My Documents" ``` ```bash curl theme={"theme":{"light":"github-light","dark":"github-dark-default"}} curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/prompt" \ -H "Authorization: Bearer $BOAT_API_KEY" \ -H "Content-Type: application/json" \ -d '{"provider":"claude","prompt":"Open Notepad++, write a short release note, and save it as release.txt in My Documents"}' ``` ```ts TypeScript theme={"theme":{"light":"github-light","dark":"github-dark-default"}} await sandbox.prompt({ sandboxId: "bx_f7k2q9hd", provider: "claude", prompt: "Open Notepad++, write a short release note, and save it as release.txt in My Documents", }); ``` ```python Python theme={"theme":{"light":"github-light","dark":"github-dark-default"}} from boat_sdk.models.prompt_request import PromptRequest sandbox.prompt("bx_f7k2q9hd", PromptRequest( provider="claude", prompt="Open Notepad++, write a short release note, and save it as release.txt in My Documents", )) ``` For scripted steps, `xdotool` and `wmctrl` are installed. Examples: * `wmctrl -l` lists the open windows. * `wmctrl -a Notepad++` brings one window to the front. To record the run, use the [desktop recorder](/desktop-streaming/drive-and-record#record-the-screen). ## Set up once, start many times The Wine set-up is in `~/.wine` and in the system packages. A snapshot keeps both. 1. Make one sandbox with Wine and the apps that your agents need. 2. Save it as a saved snapshot: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat snapshot bx_f7k2q9hd wine-apps ``` 3. Start a new sandbox from it for each task: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} boat new --from wine-apps ``` The saved snapshot does not change when the source sandbox changes. To copy one sandbox in its current state, fork it instead: `boat fork bx_f7k2q9hd`. Read [Saved snapshots](/snapshots/templates). In our test, a sandbox with Wine and 40 Windows apps (16 GB) gave these results: | Action | Time | Result | | - | - | - | | Fork | About 2 minutes until the desktop accepts windows | Every app starts. Notepad++ keeps its unsaved text. | | Stop | 4 seconds | | | Resume | 20 to 32 seconds, on a different machine | Every app starts. | The sandbox itself is ready in a few seconds. The desktop needs more time, because the 16 GB of data streams in while the desktop starts. > [!NOTE] > > Running Windows programs do not survive a stop, a fork or a new sandbox. Start them again. # Install Wine Source: https://docs.boat.dev/windows-apps/install-wine Install Wine and the Windows runtimes in a sandbox with one script. Run this script one time inside the sandbox. It takes about 5 minutes. ## Run the script 1. Save the script below as `install-wine.sh` on your computer. 2. Send it to the sandbox in one of these ways: | Surface | How | | - | - | | CLI | `boat ssh bx_f7k2q9hd -- bash -s < install-wine.sh` | | API | Pass the script as the `command` of [`POST /sandboxes/{sandboxId}/commands`](/api/reference/agent/execute-sandbox-command), with `detached: true`. | | SDK | Pass the script to the `command` call, with `detached: true`. | 3. For the API and the SDK, poll the command status until the command finishes. > [!WARNING] > > Without `detached`, a command stops after 30 seconds by default and after 600 seconds at most. Then Wine is only half installed. ```bash install-wine.sh theme={"theme":{"light":"github-light","dark":"github-dark-default"}} set -e sudo dpkg --add-architecture i386 sudo mkdir -pm755 /etc/apt/keyrings sudo wget -qO /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key sudo wget -qNP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources printf 'Package: libgd3\nPin: release o=Ubuntu\nPin-Priority: 1001\n' | sudo tee /etc/apt/preferences.d/wine-libgd3 sudo apt-get update -qq sudo DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --allow-downgrades --no-install-recommends \ winehq-staging mesa-vulkan-drivers mesa-vulkan-drivers:i386 cabextract p7zip-full sudo wget -qO /usr/local/bin/winetricks https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks sudo chmod +x /usr/local/bin/winetricks export DISPLAY=:0 WINEDLLOVERRIDES="mscoree,mshtml=" wineboot -i winetricks -q corefonts vcrun2022 dxvk d3dcompiler_47 wine --version ``` ## What each part does | Part | Why it is there | | - | - | | **WineHQ staging** | Ubuntu's own Wine is version 9. Steam, Paint.NET 5.2 and Direct3D games need Wine 11 or newer. | | **The `libgd3` pin** | The sandbox has a PHP repository. Its `libgd3` exists only for 64-bit. 32-bit Wine needs the same version for both. The pin selects Ubuntu's version. As a side effect, PHP's `gd` extension is removed. | | **`mesa-vulkan-drivers`** | A sandbox has no GPU. This software Vulkan driver lets DXVK run Direct3D 8 to 11 on the CPU. | | **`WINEDLLOVERRIDES="mscoree,mshtml="`** | A new Wine set-up opens a "Wine Mono Installer" window and waits for a click. This setting skips that window. Apps that need .NET get Microsoft's runtime from winetricks instead. | | **winetricks** | Installs Microsoft's free redistributables: core fonts, the Visual C++ 2015 to 2022 runtime, DXVK and the Direct3D shader compiler. | ## Next step [Run an app](/windows-apps/run-apps). # Run an app Source: https://docs.boat.dev/windows-apps/run-apps Install and start a Windows app in a sandbox. Recipes for Steam, Paint.NET, Sysinternals and Direct3D games. Before you start, [install Wine](/windows-apps/install-wine). ## Install and start an app 1. Download the official installer or portable archive in the sandbox. 2. Install it. 3. Start it on the desktop. Every GUI command needs `DISPLAY=:0`. This example installs the MicroDicom medical image viewer and opens a CT scan: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} export DISPLAY=:0 curl -fsSL -o /tmp/microdicom.exe https://www.microdicom.com/downloads/Software/MicroDicom-2026.4-Setup.exe wine /tmp/microdicom.exe /S curl -fsSL -o ~/CT_small.dcm https://github.com/pydicom/pydicom/raw/main/src/pydicom/data/test_files/CT_small.dcm wine start /unix "$HOME/.wine/drive_c/Program Files/MicroDicom/mDicom.exe" 'Z:\home\user\CT_small.dcm' ``` On the first start, MicroDicom asks to become the default viewer. It does not open the file. To open the scan: 1. Press Escape. 2. Close MicroDicom. 3. Run the last command again. After this, the scan opens immediately. ## Tips * Use `wine start /unix <path>` to start a program. `start` gives the program normal Windows console handles. Without it, programs written in Python (Blender, FreeCAD) and many others crash. * Most installers have a silent switch: | Installer type | Silent switch | | - | - | | NSIS | `/S` | | Inno Setup | `/VERYSILENT` | | MSI | `msiexec /i app.msi /qn` | * To find an official download link, open the app's manifest in [winget-pkgs](https://github.com/microsoft/winget-pkgs/tree/master/manifests). The `InstallerUrl` field is the vendor's own link. * Windows paths map to Linux paths: | Windows path | Linux path | | - | - | | `C:\` | `~/.wine/drive_c` | | `Z:\` | The Linux root `/` | ## Steam Steam has these needs: * It needs the Arial font. * It must not use Wine's DirectWrite. * Its web view must not use a GPU. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} export DISPLAY=:0 winetricks -q arial wine reg add 'HKCU\Software\Wine\AppDefaults\steam.exe\DllOverrides' /v dwrite /t REG_SZ /d '' /f curl -fsSL -o /tmp/SteamSetup.exe https://cdn.cloudflare.steamstatic.com/client/installer/SteamSetup.exe wine /tmp/SteamSetup.exe /S wine start 'C:\Program Files (x86)\Steam\steam.exe' -no-dwrite -cef-disable-gpu -cef-disable-sandbox ``` The first start updates Steam and takes about 2 minutes. Then the sign-in window opens. ## Paint.NET Paint.NET 5.2 has a separate [build for Wine](https://github.com/paintdotnet/Paint.NET-on-Wine). * It needs Wine 11.15 or newer. The [Wine set-up](/windows-apps/install-wine) installs this version. * Its installer makes its own Wine set-up and needs Wine Mono. So it opens the "Wine Mono Installer" window. * The `xdotool` loop below presses **Install** for you. ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} export DISPLAY=:0 mkdir -p ~/apps/paintnet && cd ~/apps/paintnet curl -fsSL -o pdn.zip "$(curl -s https://api.github.com/repos/paintdotnet/Paint.NET-on-Wine/releases \ | grep -o '"browser_download_url": *"[^"]*x64[^"]*\.zip"' | cut -d'"' -f4 | head -1)" unzip -q pdn.zip ( for i in $(seq 1 120); do w=$(wmctrl -l | grep 'Wine Mono Installer' | awk '{print $1}') [ -n "$w" ] && { wmctrl -i -a $w; sleep 0.5; xdotool key Return; break; } sleep 2 done ) & ./install.sh ./paintdotnet.sh & ``` * Use the `x64` file. The release also has an `arm64` file. That file does not run on a sandbox. * The Wine build is experimental. It expires 12 weeks after its build date. When it expires, download a new one. * Paint.NET 5.1 and older do not run. ## Sysinternals Process Explorer and Autoruns show a licence window on the first start. Accept the licence before the start, so that an agent does not have to. Autoruns rejects the `/accepteula` flag. So set the registry value for both apps: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} export DISPLAY=:0 curl -fsSL -o /tmp/procexp.zip https://download.sysinternals.com/files/ProcessExplorer.zip curl -fsSL -o /tmp/autoruns.zip https://download.sysinternals.com/files/Autoruns.zip mkdir -p ~/apps/sysinternals && cd ~/apps/sysinternals unzip -qo /tmp/procexp.zip && unzip -qo /tmp/autoruns.zip wine reg add 'HKCU\Software\Sysinternals\Process Explorer' /v EulaAccepted /t REG_DWORD /d 1 /f wine reg add 'HKCU\Software\Sysinternals\Autoruns' /v EulaAccepted /t REG_DWORD /d 1 /f wine start /unix ~/apps/sysinternals/procexp64.exe ``` ## Direct3D games DXVK from the Wine set-up runs Direct3D 8, 9, 10 and 11 games on the software Vulkan driver. | Game type | Speed | | - | - | | Simple 2D games and older 3D games | Playable | | Modern 3D games | Too slow without a GPU | Old games that change the screen resolution can leave a full-screen window over the desktop. To stop Wine from changing the resolution, run: ```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}} wine reg add 'HKCU\Software\Wine\X11 Driver' /v UseXRandR /t REG_SZ /d N /f wine reg add 'HKCU\Software\Wine\X11 Driver' /v UseXVidMode /t REG_SZ /d N /f ``` # Tested apps Source: https://docs.boat.dev/windows-apps/tested-apps Windows apps that run in a boat sandbox with Wine, the extra steps they need, and the apps that do not run. Every app below ran on a boat sandbox with the set-up from [Install Wine](/windows-apps/install-wine). The "Extra step" column gives what the app needs in addition to that set-up. ## Apps that run | App | What it is | Extra step | | - | - | - | | Notepad++, HxD, WinMerge, Everything | Editors, hex, diff, file search | None | | WinRAR, 7-Zip, WinDirStat | Archives, disk usage | None | | HeidiSQL | Database client | None. Install a database server, for example `sudo apt-get install -y mysql-server`, if you need a local one. | | Winamp, foobar2000, MPC-HC, IrfanView, FastStone, XnView | Media and image viewers | None | | LTspice | Circuit simulator | None | | FORScan | Car diagnostics | None | | x64dbg | Debugger | None | | Process Explorer, Autoruns | Microsoft Sysinternals | [Accept the licence first](/windows-apps/run-apps#sysinternals) | | MicroDicom, RadiAnt | Medical image (DICOM) viewers | RadiAnt asks you to start its free trial | | Steam | Game store client | [Steam](/windows-apps/run-apps#steam) | | Paint.NET 5.2 | Image editor | [Paint.NET](/windows-apps/run-apps#paint-net) | | Spelunky, Cave Story | Games | None. Direct3D runs through DXVK. | | ImgBurn | Disc image tool | None | | SkiFree and other 16-bit Windows 3.1 programs | Old games and tools | Run them alone. Their emulator slows every other Wine window. | ## Apps that do not run No set-up makes these apps work. | App | Why | | - | - | | CPU-Z | Opens with a driver error. It loads a Windows kernel driver, and Wine cannot load kernel drivers. | | Paint.NET 5.1 and older | Needs a Windows system file that Wine does not have. Use 5.2. | | CCleaner | Starts, then opens no window. | # Windows apps troubleshooting Source: https://docs.boat.dev/windows-apps/troubleshooting Fix common errors when you run Windows apps with Wine in a sandbox. Licence rules. ## Common errors | Symptom | Cause | Fix | | - | - | - | | `apt-get` says `libgd3:i386` "is not going to be installed" | The `libgd3` from the PHP repository | Add the `libgd3` pin from [Install Wine](/windows-apps/install-wine#what-each-part-does) | | `wineboot` never finishes | The "Wine Mono Installer" window waits for a click | `WINEDLLOVERRIDES="mscoree,mshtml=" wineboot -i` | | `Cannot open display` | The command does not know the desktop | `export DISPLAY=:0` | | A Python-based app exits immediately with `init_sys_streams` | No Windows console handles | Start it with `wine start /unix` | | `unimplemented function msvcp140.dll...` | Old Visual C++ runtime | `winetricks -q vcrun2022` | | Windows go blank and show "Not Responding" | A window was closed from Linux with `wmctrl -c` or the title bar while it held a modal dialog | Answer dialogs with keys (`xdotool key Return`). Do not close them from outside. | | Every Wine window is slow | A 16-bit Windows 3.1 program is running. Its emulator keeps Wine busy. | Close it. Run 16-bit programs on their own. | | A game covers the whole desktop | It changed the screen resolution | Set `UseXRandR` and `UseXVidMode` to `N`. Read [Direct3D games](/windows-apps/run-apps#direct3d-games). | ## Licences * Install only software that you have the right to use. * Download it from the vendor, as on these pages. * Do not copy Windows system files into Wine. Microsoft's licence does not allow it. * Wine does not need Windows system files for the apps on these pages. * The winetricks components on these pages are Microsoft's free redistributables.