# Network and IPv6

Full internet by default, only selected destinations, or no network at all – for your whole team or a single sandbox or job. Over IPv4, IPv6 or both.

## Network modes

**Python**

```
Sandbox.create(internet=False)                                  # no network
Sandbox.create(allow=["pypi.org", "files.pythonhosted.org"])    # only these
Sandbox.create(block=["example.com"])                           # everything except
```

**curl**

```
"network": {"mode": "none"}
"network": {"mode": "allowlist", "allow": ["pypi.org", "files.pythonhosted.org"]}
"network": {"mode": "full", "block": ["example.com"]}
```

| Mode | What the sandbox can reach |
| --- | --- |
| `full` (default) | The public internet, except the destinations in `block`. |
| `allowlist` | Only the destinations in `allow`. Domains apply to web traffic only (HTTP on port 80, HTTPS on port 443 over IPv4, checked by hostname); other ports and UDP/QUIC are blocked, while listed IPs and ranges (IPv4 or IPv6) are reachable directly. |
| `none` | Nothing – the sandbox has no network. |

- Your team's network policy is set on the Network page in the portal; a single sandbox or job can only make it **stricter**.
- Your private networks, our infrastructure and outgoing e-mail (SMTP) are always blocked, over IPv4 and IPv6.
- Jobs take the same `network` object as sandboxes.

## IPv6

With `"network": {"ip": "dual"}` or `{"ip": "ipv6"}` (Python: `ip="dual"`) the sandbox gets its own public IPv6 /64 and configures its address by itself within a few seconds of starting. The address is in `info.ipv6` of the sandbox (`info.ipv6_prefix` is the /64; in Python `sb.ipv6`).

- The /64 belongs to the sandbox for its whole life – pausing and resuming keep it – and every new sandbox gets a different one; a /64 that was released is not given to another sandbox straight away. Because the address changes with every sandbox, don't put it on a third party's allowlist.
- Outgoing connections use this address directly – no NAT, not shared with other customers.
- Incoming connections from the internet are blocked; the address only answers ping (ICMPv6 echo, rate-limited), so you can check that the sandbox is up – except with `"mode": "none"`. To reach an app in the sandbox use a [public URL](https://sandbox.wbx.cz/docs/sandboxes/urls.md), which works over IPv4 and IPv6.
- `ipv6` means no IPv4 internet; DNS still works, and so does the package cache.
- Your team's default is set on the Network page in the portal; a single sandbox or job can choose differently.
- If no server with IPv6 has free capacity, creating the sandbox fails with HTTP 503 – it is never started with IPv4 instead.

## Package cache

Sandboxes with full internet access use a package cache on the server for **pip / uv, npm and Go modules** automatically (the variables `PIP_INDEX_URL`, `npm_config_registry` and `GOPROXY` are set for you).

- Packages are downloaded from the official registries and checked against the registry's checksums before they are stored; nobody can write into the cache, so it cannot be poisoned by another customer.
- Go modules are checked against `sum.golang.org` before they are stored (private modules are passed through without caching).
- Turn it off for a job or sandbox with `"dependency_cache": false`. It is not used with an allowlist or without network.

Source: https://sandbox.wbx.cz/docs/sandboxes/network
