example.com, *.example.com) or IPv4 addresses/CIDRs; IPv6 is not supported. The CLI flags are repeatable. Blocked outbound calls fail with a network error.
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Restrict where a sandbox can send traffic
# Deny all egress, including DNS
prime sandbox create python:3.11-slim --network-deny 0.0.0.0/0
# Allow only specific destinations
prime sandbox create python:3.11-slim --network-allow api.openai.com
# Deny specific destinations, allow everything else
prime sandbox create python:3.11-slim --network-deny evil.example.com
# Deny all egress, including DNS
CreateSandboxRequest(name="isolated", docker_image="python:3.11-slim", network_allowlist=[])
# Allow only specific destinations
CreateSandboxRequest(name="allow", docker_image="python:3.11-slim", network_allowlist=["api.openai.com"])
# Deny specific destinations, allow everything else
CreateSandboxRequest(name="deny", docker_image="python:3.11-slim", network_denylist=["evil.example.com"])
example.com, *.example.com) or IPv4 addresses/CIDRs; IPv6 is not supported. The CLI flags are repeatable. Blocked outbound calls fail with a network error.
# Replace the allowlist with two hosts
prime sandbox network sbx_123 --allow api.openai.com,*.example.com
# Replace the denylist; '*' blocks all outbound traffic
prime sandbox network sbx_123 --deny '*'
# Show current state
prime sandbox network sbx_123
Was this page helpful?