> ## Documentation Index
> Fetch the complete documentation index at: https://docs.boat.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 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](https://docs.boat.dev/security.md#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](https://docs.boat.dev/environments/access.md#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](https://docs.boat.dev/organizations/active-wallet.md#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](https://docs.boat.dev/organizations.md#limit-who-can-use-an-environment-or-profile).

| | Members | Owners |
| - | - | - |
| [Organization environments](https://docs.boat.dev/environments/manage.md#organization-environments) (`?org=` on environment routes, `boat env --org`) | Read and use | Owners and admins change them |
| [Organization credential profiles](https://docs.boat.dev/ai-credentials.md#organization-profiles) | Use | Create and change |
| [AI credentials proxy](https://docs.boat.dev/ai-credentials.md#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.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.