Network Policy
By default the Claude container has full outbound network access. For sensitive work, switch to restricted mode and explicitly allow-list the destinations Claude is permitted to reach.
Full mode (default)
Section titled “Full mode (default)”network: policy: fullThe container is attached to a standard bridge network with normal outbound. Use this for everyday development.
Restricted mode
Section titled “Restricted mode”network: policy: restricted allow: - api.github.com - registry.npmjs.org - api.anthropic.comWhat happens:
- ccpod adds
--cap-add NET_ADMINto the container so the entrypoint can write iptables rules. - At container start, the entrypoint applies these OUTPUT rules before launching Claude:
ACCEPTloopback and established/related connectionsACCEPTDNS (UDP + TCP port 53) so hostname resolution works- For each entry in
allow: resolve hostname → IPs viagetent hosts, thenACCEPTeach IP. IPs and CIDRs are used directly. DROPall other outbound
- The resolution happens once at startup — if a domain’s IPs rotate during your session, reconnection to new IPs will be blocked until you restart the container.
Combining with project config
Section titled “Combining with project config”A project’s .ccpod.yml can tighten the policy or extend the allow-list:
network: policy: restricted allow: - api.stripe.comUnder deep merge, allow lists are concatenated. Under merge: override, the project replaces the profile’s network block entirely.
Caveats
Section titled “Caveats”- Resolution is done once at container start. IPs resolved at startup remain allowed even if DNS changes; new IPs for the same hostname are blocked until container restart.
getent hostsreturns both IPv4 and IPv6 addresses — both are allowed when present.- Loopback (
lo) is always allowed, so MCP servers and sidecar containers on the same network remain reachable. - Restricted mode is a defense-in-depth tool, not a sandbox. Combine with ephemeral state and no SSH agent forwarding for sensitive work.