> This page is for version 0.7.0.
> For other versions, use one of these documentation indexes:
> - Main (default): https://docs.nvidia.com/nemo/gym/main/llms.txt
> - 0.7.0: https://docs.nvidia.com/nemo/gym/v0.7.0/llms.txt
> - 0.6.0: https://docs.nvidia.com/nemo/gym/v0.6.0/llms.txt
> - 0.5.1: https://docs.nvidia.com/nemo/gym/v0.5.1/llms.txt
> - 0.5.0: https://docs.nvidia.com/nemo/gym/v0.5.0/llms.txt
> - 0.4.0: https://docs.nvidia.com/nemo/gym/v0.4.0/llms.txt
> - 0.3.0: https://docs.nvidia.com/nemo/gym/v0.3.0/llms.txt
> - 0.2.1: https://docs.nvidia.com/nemo/gym/v0.2.1/llms.txt

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.nvidia.com/nemo/gym/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.nvidia.com/nemo/gym/_mcp/server.

# nemo_gym.sandbox.providers.opensandbox.cleanup_sandboxes

Audit or delete OpenSandbox sandboxes owned by one exact run and user.

## Module Contents

### Functions

| Name                                                                                               | Description                                                        |
| -------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| [`_run`](#nemo_gym-sandbox-providers-opensandbox-cleanup_sandboxes-_run)                           | Run the cleanup and turn its failures into a message and a status. |
| [`cleanup_sandboxes`](#nemo_gym-sandbox-providers-opensandbox-cleanup_sandboxes-cleanup_sandboxes) | List exact run-owned sandboxes and optionally delete them.         |
| [`main`](#nemo_gym-sandbox-providers-opensandbox-cleanup_sandboxes-main)                           | -                                                                  |

### Data

[`REAP_CONCURRENCY`](#nemo_gym-sandbox-providers-opensandbox-cleanup_sandboxes-REAP_CONCURRENCY)

[`REAP_SWEEPS`](#nemo_gym-sandbox-providers-opensandbox-cleanup_sandboxes-REAP_SWEEPS)

[`REQUEST_TIMEOUT_SECONDS`](#nemo_gym-sandbox-providers-opensandbox-cleanup_sandboxes-REQUEST_TIMEOUT_SECONDS)

[`RUN_METADATA_KEY`](#nemo_gym-sandbox-providers-opensandbox-cleanup_sandboxes-RUN_METADATA_KEY)

[`USER_METADATA_KEY`](#nemo_gym-sandbox-providers-opensandbox-cleanup_sandboxes-USER_METADATA_KEY)

### API

```python
nemo_gym.sandbox.providers.opensandbox.cleanup_sandboxes._run(
    parser: argparse.ArgumentParser,
    domain: str,
    access_key: str,
    protocol: str,
    args: argparse.Namespace,
    tls_verify: bool = False
) -> int
```

Run the cleanup and turn its failures into a message and a status.

```python
nemo_gym.sandbox.providers.opensandbox.cleanup_sandboxes.cleanup_sandboxes(
    domain: str,
    protocol: str,
    access_key: str,
    run_id: str,
    user: str,
    reap: bool,
    tls_verify: bool = False
) -> int
```

async

List exact run-owned sandboxes and optionally delete them.

```python
nemo_gym.sandbox.providers.opensandbox.cleanup_sandboxes.main(
    argv: list[str] | None = None
) -> int
```

```python
nemo_gym.sandbox.providers.opensandbox.cleanup_sandboxes.REAP_CONCURRENCY = 32
```

```python
nemo_gym.sandbox.providers.opensandbox.cleanup_sandboxes.REAP_SWEEPS = 3
```

```python
nemo_gym.sandbox.providers.opensandbox.cleanup_sandboxes.REQUEST_TIMEOUT_SECONDS = 30
```

```python
nemo_gym.sandbox.providers.opensandbox.cleanup_sandboxes.RUN_METADATA_KEY = 'nemo-gym.nvidia.com/run'
```

```python
nemo_gym.sandbox.providers.opensandbox.cleanup_sandboxes.USER_METADATA_KEY = 'nemo-gym.nvidia.com/user'
```