Network access policies
Network access policies control outbound connections from sandboxes. Each policy contains one or more rules that allow the domains, IP ranges, and ports a workflow needs, or block destinations that should stay unavailable.
You can configure network access in two places:
- Local policy, which applies to sandboxes on one developer machine when organization governance is not active.
- Organization policies, which apply centrally across an organization or to selected teams.
When organization governance is active, only organization allow rules grant network access. Local allow rules are inactive until organization governance no longer applies, while local deny rules still apply on top of the organization policy. See Precedence.
Rule syntax
Network rules use the action connect:tcp. Resources are hostnames, CIDR
ranges, ports, or hostnames with ports. The governance policy schema also
accepts connect:udp, but Docker Sandboxes always blocks direct external UDP
and ICMP. connect:udp rules have no effect.
Examples:
api.example.com*.example.com**.example.comexample.com:44310.0.0.0/8
For exact wildcard behavior and CIDR support, see Network rules.
Local network rules
Use sbx policy allow network and sbx policy deny network to manage local
network rules:
$ sbx policy allow network api.example.com
$ sbx policy deny network ads.example.com
For presets, sandbox-scoped rules, testing, and troubleshooting, see Local policy.
Organization network rules
Organization network rules belong to policies that can apply to the whole organization or to selected teams. For setup steps and team scoping, see Organization policies.
Use Monitoring policies to inspect which network rules are active on a developer machine.
NoteTo manage Model Context Protocol (MCP) server registration and requests through Docker's MCP gateway, use MCP access policies. These policies apply only to the gateway. Direct MCP connections from a sandbox don't use the gateway, but you can control access to remote MCP servers with network policy.