Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,11 @@ remote MCP server registrations are host-global and can be shared by multiple
sandboxes. Local MCP commands declared by the environment belong to that
environment and sandbox.

For a local environment, stop its sandbox with `sbx stop <SANDBOX_NAME>` before
running `sbx env rm`. If the sandbox is running, removal is refused before
plan approval or cleanup. To remove it while running and skip approval, use
`sbx env rm --force`.

`sbx env rm` builds a destroy plan from the resources on the host. The plan
includes all credentials stored at the sandbox's scope, including credentials
that the environment file no longer declares. After approval, `sbx` removes
Expand Down
1 change: 1 addition & 0 deletions content/manuals/ai/sandboxes/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ reuse the name of an existing mountless sandbox, first
then remove and recreate it with a workspace path:

```console
$ sbx stop <sandbox-name>
$ sbx rm <sandbox-name>
$ sbx run --name <sandbox-name> <agent>
```
Expand Down
18 changes: 12 additions & 6 deletions content/manuals/ai/sandboxes/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ $ sbx stop my-sandbox # pause it
$ sbx rm my-sandbox # delete it entirely
```

`sbx rm` asks for confirmation before deleting a sandbox. Use `--force` to
skip the prompt. This flag also permits removal when the sandbox has an active
session — an open attach, SSH connection, or in-flight SFTP transfer:
`sbx rm` asks for confirmation and requires the sandbox to be stopped. Use
`sbx stop` first, or use `--force` to skip confirmation and remove a running
sandbox.

```console
$ sbx rm --force my-sandbox
```
### Recreate a sandbox

If you need a clean slate, remove the sandbox and run it again:

Expand All @@ -54,6 +52,8 @@ $ sbx rm my-sandbox
$ sbx run claude
```

### Remove multiple sandboxes

To remove all stopped local sandboxes, use `sbx prune`. Running sandboxes are
never removed. Preview the sandboxes that would be removed, or filter out
sandboxes stopped within the last week:
Expand All @@ -69,6 +69,12 @@ such as `168h`, an RFC 3339 timestamp, or a Unix timestamp. The older

Run `sbx prune` without flags to confirm and remove all stopped sandboxes.

To remove all local sandboxes, including running ones, and skip confirmation:

```console
$ sbx rm --all --force
```

### Remove a sandbox when the agent exits

Pass `--rm` to `sbx run` for a throwaway session. The sandbox is removed when
Expand Down