Advanced Topics

Network Mode

NETWORK is the opt-in mode. The containers are given an external network connection so the agent can reach the internet — useful for fetching API documentation, contacting a remote resource, or running a network-dependent test. The point of NETWORK mode is that turning it on is a deliberate, conscious choice, not an always-on default.

What changes

In RESTRICTED mode the containers run on an internal network with no external routes: no outbound path, no egress. In NETWORK mode the containers run on a standard external network instead — a virtual interface with a gateway — and outbound HTTP, HTTPS, DNS, and TCP work as they would for any container.

Workspace isolation does not change. The agent still only sees the directory bind-mounted into the container at session start. The home directory, SSH keys, .env files, and the rest of the host filesystem stay invisible. NETWORK mode reopens one channel — the network — and nothing else.

Switching modes

The mode is a per-session setting controlled by the SITU config file at ~/.situ/situ.conf. Edit that file to set the mode to network; the next session will start with a network-attached pod.

Run a query in NETWORK mode after editing the config:

$ cd ./my-project
$ situ -p "Fetch the latest stripe-node release notes and summarize the breaking changes"

To return to the default, set the mode back to restricted in ~/.situ/situ.conf (or remove the override) and start a new session. Mode is locked for the lifetime of a session — there is no command to flip the network on mid-conversation, by design.

A specific config file can also be supplied for a single run via situ -c <file> — convenient for keeping restricted.conf and network.conf presets side by side and selecting the mode at the command line.

What works in NETWORK mode

CapabilityRESTRICTEDNETWORK
Outbound HTTP / HTTPSBlockedAllowed
DNS resolutionNoneStandard
Package registries (npm, PyPI, crates.io, …)UnreachableReachable
Container registriesUnreachableReachable
LAN services (databases, internal APIs)UnreachableReachable
Workspace bind-mount onlyYesYes
Ephemeral containers, destroyed on exitYesYes

When to use NETWORK mode

When NOT to use NETWORK mode

Treat NETWORK mode as a tool, not a default. Whenever the task does not need the network, switch back. In particular:

Principle

If a task does not need the network, it should not have one. Open the channel for the task that requires it, complete the task, and close the channel again by returning to RESTRICTED.

Security implications, stated plainly

Verifying the difference

Running situ -t in NETWORK mode produces a different report — the external probes succeed where they would have failed in RESTRICTED. That output is the most direct way to confirm which mode the current session is actually running in.

Related