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

# Network

The CLI's `network` command updates the **egress (outbound) rules** of a running sandbox, letting you control which external destinations the sandbox is allowed or denied to reach. Rules are applied to a sandbox by its ID and take effect on the running sandbox.

<Note>
  **Note:** If no `allowOut` is specified, all outbound traffic is allowed. Omitting both `--allow-out` and `--deny-out` clears all egress rules.
</Note>

***

## Prerequisites

Set your API key in the environment before running the command:

```bash CLI icon="terminal" theme={"system"}
export NOVITA_API_KEY=<your API key>
```

***

## Usage

```bash CLI icon="terminal" theme={"system"}
novita-sandbox-cli sandbox network <sandboxID> [--allow-out <destination>] [--deny-out <destination>]
```

| Option / Argument | Value       | Description                                                                                  |
| ----------------- | ----------- | -------------------------------------------------------------------------------------------- |
| `<sandboxID>`     | string      | ID of the running sandbox to update (required)                                               |
| `--allow-out`     | destination | Allowed outbound destination. Repeatable — pass multiple times to allow several destinations |
| `--deny-out`      | destination | Denied outbound destination. Repeatable — pass multiple times to deny several destinations   |

A `destination` is an IP address or CIDR range, for example `1.1.1.1` or `8.8.8.0/24`.

***

## Examples

```bash CLI icon="terminal" theme={"system"}
# Only allow egress to these two destinations
novita-sandbox-cli sandbox network <sandboxID> \
  --allow-out 1.1.1.1 \
  --allow-out 8.8.8.0/24
```

```bash CLI icon="terminal" theme={"system"}
novita-sandbox-cli sandbox network <sandboxID> \
  --deny-out 1.1.1.1 \
  --deny-out 8.8.8.0/24
```

```bash CLI icon="terminal" theme={"system"}
# Omit both options to remove all egress rules
novita-sandbox-cli sandbox network <sandboxID>
```

On success the CLI prints:

```text Output icon="code" theme={"system"}
Sandbox <sandboxID> network has been updated
```

<Note>
  **Note:** If the sandbox ID does not exist, the command reports `Sandbox <sandboxID> wasn't found` and exits with a non-zero status.
</Note>
