Policy API
Control outbound network access using DNS-based filtering. Policies define which domains sprites can reach, with support for exact matches, wildcard subdomains, and preset rule bundles.
Changes apply immediately—existing connections to newly-blocked domains are terminated. Failed DNS lookups return REFUSED for fast failure.
Get Network Policy
Section titled "Get Network Policy"GET
/v1/sprites/{name}/policy/networkGet the current network policy configuration.
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | Success |
404 | Not Found - Resource not found |
500 | Internal Server Error |
Request
Response
{"rules": [ { "action": "allow", "domain": "github.com" }, { "action": "allow", "domain": "*.npmjs.org" }, { "action": "deny", "domain": "*" }]}Set Network Policy
Section titled "Set Network Policy"POST
/v1/sprites/{name}/policy/networkUpdate the network policy configuration.
Request Body
rules:NetworkPolicyRule[]
List of network policy rules
Responses
Section titled “Responses”| Status | Description |
|---|---|
200 | Success |
400 | Bad Request - Invalid request body |
404 | Not Found - Resource not found |
500 | Internal Server Error |
Request
Response
{"rules": [ { "action": "allow", "domain": "github.com" }]}