Replace which outside destinations the sandbox may reach.
Changed on{"mode": "internet"} allows any public destination on ports 80 and 443; {"mode": "restricted", "rules": [{"host": "api.example.com", "ports": [443]}, {"cidr": "1.1.1.0/24"}]} allows only what a rule lists (*.example.com matches subdomains; ports defaults to 80 and 443). Private, loopback, link-local and metadata destinations are refused in every mode, and the Temps model, MCP and git relays keep working whatever the policy. A refused request gets a 403 from the sandbox's proxy naming the destination and the policy.
Applied before it is stored: on a running Docker sandbox the egress proxy is replaced, which interrupts outbound connections for a second or two and closes open tunnels; a stopped sandbox gets it on its next start.
Request
- Base URL/api (relative, and the document was published on a file host, not at the API’s origin)
- AuthHTTP bearer
Path parameters
Sandbox id (sbx_...)
Request body
Example request
{
"rules": [
{
"cidr": "1.1.1.0/24",
"host": "api.example.com"
}
]
}Response
Policy applied and stored
Example response
{
"sandbox": {
"egress_policy": {
"rules": [
{
"cidr": "1.1.1.0/24",
"host": "api.example.com"
}
]
}
}
}Changes
- breaking
removed the required property
extensionsfrom the response with the status - breaking
removed the required property
extensionsfrom the response with the status - breaking
removed the required property
extensionsfrom the response with the status
4 more changes in this revision
- breaking