1.7.0 (2026-12-01)
Sandboxes now support fine-grained control over network egress via OutboundPolicy and OutboundRoute objects:
- Pass an Outbound Policy to
Sandbox.create()(or update it on a running Sandbox withSandbox.set_outbound_policy()) to precisely specify an allowlist of CIDRs or domains that requests from inside the Sandbox can reach. - The Outbound Policy also supports Secret Injection via header replacement in outbound HTTPS requests. This allows you to withhold sensitive API credentials from untrusted processes in the Sandbox.
- DNS lookups from the Sandbox are filtered to the domains in its routes when the policy ends by blocking unmatched traffic.
- These new APIs replace the existing
outbound_cidr_allowlist=andoutbound_domain_allowlist=parameters inSandbox.create(), along with the_experimental_outbound_policy=parameter and themodal.experimental.OutboundPolicyobject, all of which are now deprecated.
We're adding more control over the use of pickle for serialization of Function, Dict, and Queue payloads: …