curl --request PUT \
--url https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allowlist": [
"<string>"
],
"denylist": [
"<string>"
],
"rules": {}
}
'import requests
url = "https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy"
payload = {
"allowlist": ["<string>"],
"denylist": ["<string>"],
"rules": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({allowlist: ['<string>'], denylist: ['<string>'], rules: {}})
};
fetch('https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allowlist' => [
'<string>'
],
'denylist' => [
'<string>'
],
'rules' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy"
payload := strings.NewReader("{\n \"allowlist\": [\n \"<string>\"\n ],\n \"denylist\": [\n \"<string>\"\n ],\n \"rules\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allowlist\": [\n \"<string>\"\n ],\n \"denylist\": [\n \"<string>\"\n ],\n \"rules\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowlist\": [\n \"<string>\"\n ],\n \"denylist\": [\n \"<string>\"\n ],\n \"rules\": {}\n}"
response = http.request(request)
puts response.read_body{
"policy": {
"allowlist": [
"<string>"
],
"denylist": [
"<string>"
],
"rules": {}
},
"generation": 1,
"applied_generation": 0,
"applied": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Update Sandbox Egress Policy Endpoint
Replace the egress policy of a running or paused VM sandbox.
The replacement is complete, never a merge. The request returns 202 after the desired generation is persisted; durable action dispatch continues asynchronously until accepted. A paused sandbox receives it on resume. The applied callback updates the status endpoint; new connections follow the replacement once applied and established flows are not revoked.
curl --request PUT \
--url https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"allowlist": [
"<string>"
],
"denylist": [
"<string>"
],
"rules": {}
}
'import requests
url = "https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy"
payload = {
"allowlist": ["<string>"],
"denylist": ["<string>"],
"rules": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({allowlist: ['<string>'], denylist: ['<string>'], rules: {}})
};
fetch('https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'allowlist' => [
'<string>'
],
'denylist' => [
'<string>'
],
'rules' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy"
payload := strings.NewReader("{\n \"allowlist\": [\n \"<string>\"\n ],\n \"denylist\": [\n \"<string>\"\n ],\n \"rules\": {}\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"allowlist\": [\n \"<string>\"\n ],\n \"denylist\": [\n \"<string>\"\n ],\n \"rules\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.primeintellect.ai/api/v1/sandbox/{sandbox_id}/egress-policy")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"allowlist\": [\n \"<string>\"\n ],\n \"denylist\": [\n \"<string>\"\n ],\n \"rules\": {}\n}"
response = http.request(request)
puts response.read_body{
"policy": {
"allowlist": [
"<string>"
],
"denylist": [
"<string>"
],
"rules": {}
},
"generation": 1,
"applied_generation": 0,
"applied": true
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Rate Limit
120 requests per 60 seconds per IP and token per sandbox.Authorizations
Body
Full replacement of a running VM sandbox's egress policy.
Exactly one of allowlist or denylist must be non-null. An empty allowlist
denies all egress; an empty denylist restores allow-all. rules is part
of the same complete replacement: omitting it clears the rules.
Response
Successful Response
Desired vs applied egress policy state for a VM sandbox.
Was this page helpful?