network-policies

Create a NetworkPolicy.

Create a new NetworkPolicy with the specified egress rules. The policy can then be applied to blueprints, devboxes, or snapshot resumes.

post/v1/network-policies

Request body

namestring required

The human-readable name for the NetworkPolicy. Must be unique within the account.

descriptionstring nullable

Optional description for the NetworkPolicy.

allow_allboolean nullable

(Optional) If true, all egress traffic is allowed (ALLOW_ALL policy). Defaults to false.

allow_devbox_to_devboxboolean nullable

(Optional) If true, allows traffic between the account's own devboxes via tunnels. Defaults to false. If allow_all is true, this is automatically set to true.

allowed_hostnamesstring[] nullable

(Optional) DNS-based allow list with wildcard support. Examples: ['github.com', '*.npmjs.org'].

allow_agent_gatewayboolean nullable

(Optional) If true, allows devbox egress to the agent gateway for credential proxying. Defaults to false.

allow_mcp_gatewayboolean nullable

(Optional) If true, allows devbox egress to the MCP hub for MCP server access. Defaults to false.

Response

NetworkPolicy created successfully.

idstring required

The unique identifier of the NetworkPolicy.

namestring required

The human-readable name of the NetworkPolicy. Unique per account.

descriptionstring nullable

Optional description of the NetworkPolicy.

create_time_msinteger required

The creation time of the NetworkPolicy (Unix timestamp in milliseconds).

update_time_msinteger required

Last update time of the NetworkPolicy (Unix timestamp in milliseconds).

Changes