Skip to content

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/v1/sprites/{name}/policy/network

Get the current network policy configuration.

StatusDescription
200Success
404Not Found - Resource not found
500Internal Server Error
Request
Response
{
"rules": [
{
"action": "allow",
"domain": "github.com"
},
{
"action": "allow",
"domain": "*.npmjs.org"
},
{
"action": "deny",
"domain": "*"
}
]
}

POST/v1/sprites/{name}/policy/network

Update the network policy configuration.

Request Body

rules:NetworkPolicyRule[]

List of network policy rules

StatusDescription
200Success
400Bad Request - Invalid request body
404Not Found - Resource not found
500Internal Server Error
Request
Response
{
"rules": [
{
"action": "allow",
"domain": "github.com"
}
]
}