Documentation

sandboxes

Egress allowlist

Opt-in outbound restriction per sandbox. Default is open egress.

Create with allowlist

{
  "agent_id": "coder",
  "guest_cid": 9201,
  "egress_allowlist": ["example.com", "1.1.1.1"]
}

Entries: IPv4, CIDR (10.0.0.0/8), or hostname (resolved once at create).

Omit the field (or pass null / []) for open egress.

Behavior

ModeGuest outbound
Open (default)Any destination (when host egress is enabled)
AllowlistListed IPs/CIDRs + DNS resolvers only

Enforcement is on the host. Destroy clears rules.

Notes

Hostname resolution is snapshot-at-apply — CDN IPs can drift. True domain filtering via proxy is a later enhancement.

MCP: egress_allowlist_json on sandbox_create.