From 9e49c0df69391c1786bf27fed90bd0374c0adb8a Mon Sep 17 00:00:00 2001 From: Vikram Vaswani Date: Thu, 25 Jun 2026 21:28:17 +0530 Subject: [PATCH 1/3] feat: add info about sandbox firewall Signed-off-by: Vikram Vaswani --- Sandboxes/Proxy-domains.mdx | 40 ++++++++++++++++++++++++++++++++++++- Sandboxes/Proxy.mdx | 7 +++++++ changelog.mdx | 8 ++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) diff --git a/Sandboxes/Proxy-domains.mdx b/Sandboxes/Proxy-domains.mdx index 4295d70d..f89e7670 100644 --- a/Sandboxes/Proxy-domains.mdx +++ b/Sandboxes/Proxy-domains.mdx @@ -11,7 +11,7 @@ tag: "public preview" Domain filtering lets you control which external domains a sandbox can reach. You can define an allowlist (only listed domains are reachable) or a denylist (all domains except listed ones are reachable). Domain filtering and proxy routing are **independent configurations** — you do not need to duplicate domains across both. A domain can appear in the allowlist without having a proxy routing rule, and vice versa. - Domain filtering relies on the sandbox's tools and libraries respecting the standard proxy environment variables (`HTTP_PROXY`, `HTTPS_PROXY`). Traffic from tools that ignore these variables will not be filtered. Routing-level enforcement is planned for a future release. + Domain filtering relies on the sandbox's tools and libraries respecting the standard proxy environment variables (`HTTP_PROXY`, `HTTPS_PROXY`). Traffic from tools that ignore proxy environment variables will not be filtered unless [routing-level enforcement](#routing-level-enforcement) is enabled. ## Allowlist @@ -82,6 +82,44 @@ await SandboxInstance.create({ When both `allowedDomains` and `forbiddenDomains` are set, `forbiddenDomains` takes precedence: a domain that appears in both lists will be blocked. +## Routing-level enforcement + +By default, domain filtering depends on the sandbox's tools respecting `HTTP_PROXY` and `HTTPS_PROXY`. To enforce filtering even for tools that bypass those variables, add a `firewall` config with `rulesets: ["proxy"]`. This routes all egress traffic through the proxy at the network level, regardless of how the tool is configured: + + + +```typescript TypeScript +await SandboxInstance.create({ + name: "enforced-sandbox", + image: "blaxel/base-image:latest", + region: "us-was-1", + network: { + firewall: { rulesets: ["proxy"] }, + allowedDomains: ["httpbin.org"], + proxy: { routing: [] }, + }, +}); +``` + +```python Python +await SandboxInstance.create({ + "name": "enforced-sandbox", + "image": "blaxel/base-image:latest", + "region": "us-was-1", + "network": { + "firewall": {"rulesets": ["proxy"]}, + "allowedDomains": ["httpbin.org"], + "proxy": {"routing": []}, + }, +}) +``` + + + + + Routing-level enforcement is not yet applied automatically when a proxy config is set. In a future release, it will be enabled by default whenever a proxy is configured. + + ## Firewall + proxy combined Firewall rules and proxy routing compose naturally: diff --git a/Sandboxes/Proxy.mdx b/Sandboxes/Proxy.mdx index b19e2867..dc16b010 100644 --- a/Sandboxes/Proxy.mdx +++ b/Sandboxes/Proxy.mdx @@ -93,8 +93,15 @@ sandbox = await SandboxInstance.create({ |---|---|---| | `allowedDomains` | `string[]` / `list[str]` | Allowlist — only these domains are reachable. Supports wildcards (`*.s3.amazonaws.com`). | | `forbiddenDomains` | `string[]` / `list[str]` | Denylist — all domains except these are reachable. Supports wildcards. If both are set, `forbiddenDomains` takes precedence. | +| `firewall` | `FirewallConfig` | Routing-level enforcement config. When set, forces all egress traffic through the Blaxel proxy unconditionally. | | `proxy` | `ProxyConfig` | Proxy routing and bypass configuration. | +### `FirewallConfig` + +| Field | Type | Description | +|---|---|---| +| `rulesets` | `string[]` / `list[str]` | Enforcement rules to apply. Pass `["proxy"]` to force all egress traffic through the Blaxel proxy at the network level. | + ### `ProxyConfig` | Field | Type | Description | diff --git a/changelog.mdx b/changelog.mdx index 523d7b84..542984aa 100644 --- a/changelog.mdx +++ b/changelog.mdx @@ -17,6 +17,14 @@ The SDKs can now clear a sandbox's expiration rules without recreating it. Pass +### Routing-level firewall enforcement for sandboxes + +Sandboxes can now enforce domain filtering at the network level, rather than relying on tools respecting proxy environment variables. Set `firewall: { rulesets: ["proxy"] }` in the sandbox `network` config to route all egress traffic through the Blaxel proxy unconditionally — ensuring `allowedDomains` and `forbiddenDomains` rules apply even to tools that bypass `HTTP_PROXY`. Requires Python SDK ≥ 0.2.56 or TypeScript SDK ≥ 0.2.90. See [Domain filtering](/Sandboxes/Proxy-domains). + + + + + ### Refreshed Billing Explorer experience From 4a76f0841d14db178b4de30395e1239a55d72fb2 Mon Sep 17 00:00:00 2001 From: Vikram Vaswani Date: Thu, 25 Jun 2026 21:37:24 +0530 Subject: [PATCH 2/3] feat: add info about sandbox firewall Signed-off-by: Vikram Vaswani --- Sandboxes/Proxy-domains.mdx | 12 ++++++------ Sandboxes/Proxy.mdx | 4 ++-- changelog.mdx | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Sandboxes/Proxy-domains.mdx b/Sandboxes/Proxy-domains.mdx index f89e7670..5c1973a1 100644 --- a/Sandboxes/Proxy-domains.mdx +++ b/Sandboxes/Proxy-domains.mdx @@ -11,7 +11,7 @@ tag: "public preview" Domain filtering lets you control which external domains a sandbox can reach. You can define an allowlist (only listed domains are reachable) or a denylist (all domains except listed ones are reachable). Domain filtering and proxy routing are **independent configurations** — you do not need to duplicate domains across both. A domain can appear in the allowlist without having a proxy routing rule, and vice versa. - Domain filtering relies on the sandbox's tools and libraries respecting the standard proxy environment variables (`HTTP_PROXY`, `HTTPS_PROXY`). Traffic from tools that ignore proxy environment variables will not be filtered unless [routing-level enforcement](#routing-level-enforcement) is enabled. + Domain filtering relies on the sandbox's tools and libraries respecting the standard proxy environment variables (`HTTP_PROXY`, `HTTPS_PROXY`). Traffic from tools that ignore proxy environment variables will not be filtered unless [domain filter enforcement](#domain-filter-enforcement) is enabled. ## Allowlist @@ -82,14 +82,14 @@ await SandboxInstance.create({ When both `allowedDomains` and `forbiddenDomains` are set, `forbiddenDomains` takes precedence: a domain that appears in both lists will be blocked. -## Routing-level enforcement +## Domain filter enforcement -By default, domain filtering depends on the sandbox's tools respecting `HTTP_PROXY` and `HTTPS_PROXY`. To enforce filtering even for tools that bypass those variables, add a `firewall` config with `rulesets: ["proxy"]`. This routes all egress traffic through the proxy at the network level, regardless of how the tool is configured: +By default, domain filtering depends on the sandbox's tools respecting `HTTP_PROXY` and `HTTPS_PROXY`. To enforce filtering even for tools that bypass those variables, add a `firewall` config with `rulesets: ["proxy"]`. This forces all outbound traffic to flow through the proxy at the network level. ```typescript TypeScript -await SandboxInstance.create({ +await SandboxInstance.createIfNotExists({ name: "enforced-sandbox", image: "blaxel/base-image:latest", region: "us-was-1", @@ -102,7 +102,7 @@ await SandboxInstance.create({ ``` ```python Python -await SandboxInstance.create({ +await SandboxInstance.create_if_not_exists({ "name": "enforced-sandbox", "image": "blaxel/base-image:latest", "region": "us-was-1", @@ -117,7 +117,7 @@ await SandboxInstance.create({ - Routing-level enforcement is not yet applied automatically when a proxy config is set. In a future release, it will be enabled by default whenever a proxy is configured. + Currently, this feature is not enforced automatically by the platform when a proxy is configured. In a future release, it will be automatically enforced whenever a proxy is configured. ## Firewall + proxy combined diff --git a/Sandboxes/Proxy.mdx b/Sandboxes/Proxy.mdx index dc16b010..4c697f35 100644 --- a/Sandboxes/Proxy.mdx +++ b/Sandboxes/Proxy.mdx @@ -93,14 +93,14 @@ sandbox = await SandboxInstance.create({ |---|---|---| | `allowedDomains` | `string[]` / `list[str]` | Allowlist — only these domains are reachable. Supports wildcards (`*.s3.amazonaws.com`). | | `forbiddenDomains` | `string[]` / `list[str]` | Denylist — all domains except these are reachable. Supports wildcards. If both are set, `forbiddenDomains` takes precedence. | -| `firewall` | `FirewallConfig` | Routing-level enforcement config. When set, forces all egress traffic through the Blaxel proxy unconditionally. | +| `firewall` | `FirewallConfig` | Proxy firewall configuration. | | `proxy` | `ProxyConfig` | Proxy routing and bypass configuration. | ### `FirewallConfig` | Field | Type | Description | |---|---|---| -| `rulesets` | `string[]` / `list[str]` | Enforcement rules to apply. Pass `["proxy"]` to force all egress traffic through the Blaxel proxy at the network level. | +| `rulesets` | `string[]` / `list[str]` | Domain filtering rules to apply. Set to `["proxy"]` to force all sandbox outbound traffic through the Blaxel proxy. | ### `ProxyConfig` diff --git a/changelog.mdx b/changelog.mdx index 542984aa..63f3d892 100644 --- a/changelog.mdx +++ b/changelog.mdx @@ -17,9 +17,9 @@ The SDKs can now clear a sandbox's expiration rules without recreating it. Pass -### Routing-level firewall enforcement for sandboxes +### Proxy-based firewall support -Sandboxes can now enforce domain filtering at the network level, rather than relying on tools respecting proxy environment variables. Set `firewall: { rulesets: ["proxy"] }` in the sandbox `network` config to route all egress traffic through the Blaxel proxy unconditionally — ensuring `allowedDomains` and `forbiddenDomains` rules apply even to tools that bypass `HTTP_PROXY`. Requires Python SDK ≥ 0.2.56 or TypeScript SDK ≥ 0.2.90. See [Domain filtering](/Sandboxes/Proxy-domains). +Sandboxes can now enforce domain filtering at the network level. From f0729984d30060db9e35239e5c025dafdfe4f712 Mon Sep 17 00:00:00 2001 From: Vikram Vaswani Date: Thu, 25 Jun 2026 21:42:27 +0530 Subject: [PATCH 3/3] fix: update text Signed-off-by: Vikram Vaswani --- Sandboxes/Proxy-domains.mdx | 2 +- Sandboxes/Proxy.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sandboxes/Proxy-domains.mdx b/Sandboxes/Proxy-domains.mdx index 5c1973a1..a5adf463 100644 --- a/Sandboxes/Proxy-domains.mdx +++ b/Sandboxes/Proxy-domains.mdx @@ -79,7 +79,7 @@ await SandboxInstance.create({ - When both `allowedDomains` and `forbiddenDomains` are set, `forbiddenDomains` takes precedence: a domain that appears in both lists will be blocked. + When both `allowedDomains` and `forbiddenDomains` are set, `allowedDomains` takes precedence: a domain that appears in both lists will be allowed. ## Domain filter enforcement diff --git a/Sandboxes/Proxy.mdx b/Sandboxes/Proxy.mdx index 4c697f35..1b270c06 100644 --- a/Sandboxes/Proxy.mdx +++ b/Sandboxes/Proxy.mdx @@ -92,7 +92,7 @@ sandbox = await SandboxInstance.create({ | Field | Type | Description | |---|---|---| | `allowedDomains` | `string[]` / `list[str]` | Allowlist — only these domains are reachable. Supports wildcards (`*.s3.amazonaws.com`). | -| `forbiddenDomains` | `string[]` / `list[str]` | Denylist — all domains except these are reachable. Supports wildcards. If both are set, `forbiddenDomains` takes precedence. | +| `forbiddenDomains` | `string[]` / `list[str]` | Denylist — all domains except these are reachable. Supports wildcards. If both are set, `allowedDomains` takes precedence. | | `firewall` | `FirewallConfig` | Proxy firewall configuration. | | `proxy` | `ProxyConfig` | Proxy routing and bypass configuration. |