# Kill Sandbox - Documentation

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown is available with `Accept: text/markdown` and `.md` URL variants.

Source: /docs/guides/sandbox-kill

# Kill Sandbox

Copy pageCopy page

Copy pageCopy page

Killing a sandbox shuts it down and permanently removes it. A killed sandbox cannot be resumed or reconnected. You can kill sandboxes from the CLI or programmatically through the SDK.

##

[​](#kill-a-connected-sandbox)

Kill a connected sandbox

JavaScript & TypeScript

Python

```
import { Novita } from 'novita-sandbox'

const novita = new Novita()
const sandbox = await novita.sandbox.create()

// ... use the sandbox ...

await sandbox.kill()
```

```
from novita_sandbox import Novita

novita = Novita()
sandbox = novita.sandbox.create()

# ... use the sandbox ...

sandbox.kill()
```

##

[​](#kill-by-sandbox-id)

Kill by sandbox ID

Use the namespace `kill` method when you only have the sandbox ID. It returns `true` if the sandbox was found and killed, and `false` if no sandbox with that ID exists.

JavaScript & TypeScript

Python

CLI

```
import { Novita } from 'novita-sandbox'

const novita = new Novita()
const killed = await novita.sandbox.kill('sbx-123')
if (!killed) {
console.log('Sandbox not found')
}
```

```
from novita_sandbox import Novita

novita = Novita()
killed = novita.sandbox.kill("sbx-123")
if not killed:
print("Sandbox not found")
```

```
# Kill a sandbox by ID (alias: sandbox kl)
novita-sandbox-cli sandbox kill
```

##

[​](#kill-all-sandboxes)

Kill all sandboxes

The CLI can kill every running sandbox at once with `-a` / `--all`, optionally filtered by state or metadata.

CLI

```
# Kill all running sandboxes
novita-sandbox-cli sandbox kill -a

# Filter which ones to kill by state or metadata
novita-sandbox-cli sandbox kill -a --state running
novita-sandbox-cli sandbox kill -a --metadata env=test
```

Last modified on August 5, 2026
