Egress policy is one argument on create. Not a sidecar, not a firewall you build inside the sandbox yourself.
| allow | default; unrestricted egress |
| deny | no network at all, for closed-internet evals |
| allowlist | only the hosts you name (model APIs, package mirrors) |
sb = nc.sandboxes.create(
template_id=tpl,
egress="allowlist",
allow=["api.anthropic.com", "api.openai.com"],
)deny keeps inter-service networking but no internet.