---
title: "Update a sandbox network policy"
method: PATCH
path: "/sandboxes/{id}/network-policy"
tags: ["Sandboxes"]
---

# Update a sandbox network policy

`PATCH /sandboxes/{id}/network-policy`

## Request

- Base URL: `https://api.thundercompute.com:8443/v1`
- URL: `https://api.thundercompute.com:8443/v1/sandboxes/{id}/network-policy`
- Auth: API key in header `Authorization`

Accepts a durable outbound network policy update. Poll the sandbox generations to confirm enforcement.

## Path parameters

- `id` string, required

## Request body

- ThundertypesSandboxNetworkPolicyUpdateRequest
  - `network_policy` ThundertypesSandboxNetworkPolicy, required
    - `cidr_allowlist` string[]
    - `domain_allowlist` string[]
    - `internet_access` 'closed' | 'open' | 'restricted', required

## Response `200`

OK

- ThundertypesSandboxNetworkPolicyUpdateResponse
  - `generation` integer
  - `id` string, required
  - `network_policy` ThundertypesSandboxNetworkPolicy, required
    - `cidr_allowlist` string[]
    - `domain_allowlist` string[]
    - `internet_access` 'closed' | 'open' | 'restricted', required

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict
- `500`: Internal Server Error

## Changes

- **2026-10-31** `ea9a917bfab8`: 1 info
  - added the optional property `generation` to the response with the `200` status
- **2026-09-18** `e6309ce01c8d`: 3 breaking
  - added the new required request property `network_policy`
  - removed `#/components/schemas/thundertypes.SandboxNetworkPolicyUpdateRequest, subschema #1` from the request body `oneOf` list
  - the request's body type changed from no type to `object`
- **2026-09-02** `6921c98f096f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/thundercompute/apis/thunder-compute-api/changes/sandboxes/:id/network-policy/patch.md)

---

[API](https://skmtc.dev/thundercompute/apis/thunder-compute-api.md) - [All operations](https://skmtc.dev/thundercompute/apis/thunder-compute-api/llms.txt) - [OpenAPI document](https://skmtc.dev/thundercompute/apis/thunder-compute-api/revisions/62bf97c7bba4?raw)
