---
title: "Network policy"
description: "How a box's network allowlist is chosen, why shells start offline, how to inspect it with abx net, and what it does not guarantee."
---

> Documentation Index
> Fetch the complete documentation index at: https://sandrinodm.github.io/agent-box/llms.txt
> Use this file to discover all available pages before exploring further.

# Network policy

A box has one of two network policies. It is chosen when the box is created and never changed afterwards. This page explains how the hosts are chosen, how to inspect them and where the filter stops.

| Mode | What the guest can reach |
| --- | --- |
| `off` | Nothing. No hosts and no credential bindings. |
| `restricted` | The exact hostnames in the policy, over smolvm's restricted network backend. Private, loopback, link-local, multicast and other reserved IPv4 and IPv6 ranges are denied even if an allowed name resolves into them. |

## Inspect a box's policy

```sh
abx net fix-auth
abx net fix-auth --json
```

`abx net [box]` prints the mode and hosts of a box. Without `--json` and without a terminal, it prints the mode followed by the allowed hosts on one line.

Before it starts, stops or renews credentials for a box, `abx` reads what smolvm reports for the machine (network flag, hosts, credential bindings, ports and host mounts, of which a box may have only its transcript share). It refuses if that differs from the policy saved in the box state.

## How the hosts are chosen

![Flow at box creation: the agent endpoints from the login in use, or the default hosts when there is no login, plus any allow hosts you pass, form the allowed host list. A non-empty list gives restricted networking and an empty list gives off. The net option overrides the mode. A login replaces the agent default hosts instead of adding to them.](https://sandrinodm.github.io/agent-box/_nimbus/md/1lssj2k/network-hosts.webp)

When a box is created, the allowed hosts are the union of:

- the endpoints of each granted agent, and
- every `--allow HOST` you pass.

An agent's endpoints depend on its saved or requested login:

- With a host-managed login, a masked token or an API key, the agent's credential endpoint (for example `api.anthropic.com`) plus any extra hosts the mode needs.
- With a guest login, the hosts that login needs. For Claude, that is Anthropic plus `claude.ai`, `claude.com` and `platform.claude.com`. When [account connectors](https://sandrinodm.github.io/agent-box/agents/claude-code/#claudeai-connectors) are turned on (`abx auth connectors claude on` or `--connectors`), Claude with `anthropic/login` also allows `mcp-proxy.anthropic.com`.
- With no saved login, the agent's default hosts. Claude, OpenCode and Pi default to `api.anthropic.com`, and Codex to `api.openai.com`. Cursor and Antigravity (`agy`) declare none.

A selected login replaces the agent's default hosts; it does not add to them. For example, Pi with an OpenAI API key gets `api.openai.com` and not `api.anthropic.com`. Each [agent page](https://sandrinodm.github.io/agent-box/agents/) lists its hosts.

`--net` overrides the mode. Without it, the box is `restricted` when the host list is not empty and `off` otherwise. `--net restricted` with an empty host list fails with `Restricted networking requires at least one exact hostname.`

## Offline boxes

A plain `abx shell` box has no agent and no `--allow` host, so it starts offline. So does a Cursor or Antigravity box until a login is chosen. To give such a box network access, save a login with `abx auth set` before you create the box, or pass `--access local` at launch (see [Access modes](https://sandrinodm.github.io/agent-box/authentication/access-modes/)). `--allow` also gives them hosts.

Because the policy can't change after creation, an offline box that needs a login has to be [removed](https://sandrinodm.github.io/agent-box/git-workflow/removing-boxes/) and created again. Repeating the recorded `--net` or `--allow` values on a later launch is accepted. Anything different fails with `fixed-option`.

Rules for `--net off`:

- It can't be combined with `--access` or `--auth-profile`.
- An offline box can't have `--allow` hosts.
- An offline box ignores saved credential selections.

An offline box can still run an installed agent locally:

```sh
abx codex version-check --net off -- --version
```

## Host rules

Hosts are exact DNS names, normalized to lowercase. A name needs at least two labels, every label must start with a letter and end with a letter or digit (with letters, digits and `-` in between, up to 63 characters), and the whole name is at most 253 characters. Ports, paths, wildcards, a trailing dot and IP addresses are rejected, and so is a label that starts with a digit, such as `1password.com`. An invalid host fails with `Allowed hosts must be exact DNS names without ports, paths, or wildcards.` A credential binding must name a host that is on the list. smolvm swaps the real credential in for the handle the guest holds, and only on requests to that host. See [Access modes](https://sandrinodm.github.io/agent-box/authentication/access-modes/).

## Limits

The policy filters by name and address. In early testing on smolvm 1.37.0, a guest could reach other sites that share a CDN address with an allowed host by resolving them itself. That behavior was not re-tested for the current CLI. Treat `restricted` as a strong filter, not as proof against a guest that is trying to reach a specific CDN-hosted site.

There is no command to list denied requests or to change the hosts of an existing box. See the [security model](https://sandrinodm.github.io/agent-box/concepts/security-model/).

Source: https://sandrinodm.github.io/agent-box/network/policy/index.mdx
