> ## Documentation Index
> Fetch the complete documentation index at: https://docs.novita.ai/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.

***

## 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 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 network <sandboxID> \
  --allow-out 1.1.1.1 \
  --allow-out 8.8.8.0/24
```

```bash CLI icon="terminal" theme={"system"}
novita 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 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.


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