network-policies
Network policies are named IP allow and deny lists that restrict where API tokens, MCP servers, and workspace-user or end-user sign-in may connect from. A policy restricts nothing until it is assigned: an MCP server's _networkPolicyId (celigo mcp-servers set <id> _networkPolicyId=<policyId>), an API token's (set in the UI), or the account's sign-in settings. Each environment keeps its own policies. Network policies must be enabled for the account, and only the account owner and administrators can manage them.
Entries are IPv4 or IPv6 addresses or CIDR ranges, at most 200 per list. The server stores a bare address as /32 or /128 and compresses IPv6, so compare against what get returns, not against what you sent. Deny always wins over allow, and an empty ipAllowList permits every address that ipDenyList does not block.
This command group manages the policies: the standard verbs, audit, and dependencies, which lists where a policy is assigned.
Added in celigo-cli 2026.10.1.
⚠️ A policy can lock the CLI out. In the words of
celigo network-policies --help: "LOCKOUT: a policy assigned to the API token this profile uses applies to the CLI itself. An allow list that leaves out the address this machine connects from locks the CLI — and every script using that token — out until someone repairs the policy from the UI or with another token. Checkdependencies <id>before editing a policy, and keep your own egress address on its allow list."
REST API: Network Policies
celigo network-policies <subcommand> [args] [flags]Supports all global flags.
Subcommands
list
List the environment's network policies, sorted by lastModified or name.
get <id>
Fetch one network policy by ID.
create
Create a network policy from a JSON body (--file <path> or stdin).
update <id>
Full-replace PUT from a JSON body (--file <path> or stdin). A list the body leaves out is emptied.
set <id> key=value …
Edit name, description, ipAllowList, and ipDenyList as one atomic JSON Patch; any other path through GET + modify + PUT. Supports key=file://<path>.
audit <id>
Show the audit log (change history) for one network policy.
dependencies <id> (alias used-by)
List where the policy is assigned: MCP servers, API tokens, and sign-in settings.
delete <id>
Delete a network policy — it moves to the recycle bin for 30 days. --force deletes one that is still assigned.
celigo network-policies list
List the network policies of the profile's environment. --sort-by orders them server-side: lastModified, the default, lists the most recently changed policy first; name lists them alphabetically. Policies in the recycle bin are not listed.
The endpoint refuses the include/exclude field projection, so rows are trimmed client-side: --fields changes what is printed, not what is transferred.
Signature
Arguments
None.
Flags
--sort-by <field>
lastModified | name
lastModified
Sort order. Sent as sort_by; any other value is rejected locally.
--fields <spec>
string
default
Fields to return per row. default returns _id, name, and the table columns; all returns complete documents; a comma-separated list selects specific fields. Applied client-side — see field projection.
--limit <n>
integer
—
Return at most <n> rows, fetching a single page.
Default table columns: _id, name, ipAllowList, ipDenyList, lastModified.
Example
Corresponds to: GET /v1/networkpolicies — with sort_by and limit as query parameters.
celigo network-policies get
Fetch one network policy by ID. Its lists hold the stored form of each entry: a bare address carries /32 or /128, and IPv6 is compressed.
Signature
Arguments
<id>
string
Yes
Network policy _id.
Flags
Uses global flags only.
Example
Corresponds to: GET /v1/networkpolicies/{_id}
celigo network-policies create
Create a network policy from a JSON body. Read the body from a file with -f, --file (recommended), or pipe it on stdin. The new policy restricts nothing until you assign it — for an MCP server, with celigo mcp-servers set <id> _networkPolicyId=<policyId>. Requires full mode.
Signature
Arguments
None.
Flags
-f, --file <path>
string
—
Read the JSON body from a file instead of stdin (--file - also means stdin).
Request body
name
Yes
Display name. Another policy in the environment that is not in the recycle bin may not hold the same name.
description
No
What the policy is for.
ipAllowList
No
Addresses or CIDR ranges permitted to connect, at most 200. Empty or omitted: every address that ipDenyList does not block.
ipDenyList
No
Addresses or CIDR ranges refused even when ipAllowList permits them, at most 200.
Example
Corresponds to: POST /v1/networkpolicies
celigo network-policies update
Full-replace PUT from a JSON body (--file <path> or stdin). The change applies at once to every API token, MCP server, and sign-in setting the policy is assigned to. Requires full mode.
⚠️
updatereplaces the whole policy. A list the body leaves out is emptied, which lifts every restriction it imposed, and an omitteddescriptionis removed. Send the complete policy, or useset, which changes only the fields you name.
Signature
Arguments
<id>
string
Yes
Network policy _id.
Flags
-f, --file <path>
string
—
Read the JSON body from a file instead of stdin (--file - also means stdin).
--force
boolean
false
Submit even if the body contains masked credential values ("******") copied from a GET.
Example
Corresponds to: PUT /v1/networkpolicies/{_id}
celigo network-policies set
Edit fields with key=value assignments. name, description, ipAllowList, and ipDenyList are the server's PATCH whitelist: an assignment that touches only those is sent as one atomic JSON Patch. A list assignment replaces the whole list, so pass the complete list as a JSON array (ipAllowList='["10.0.0.0/8","203.0.113.5"]'). description=null removes the description.
Any other path goes through GET → modify → PUT with the complete document: a single list entry by index (ipAllowList[0]=…), and a list assigned null (ipAllowList=null), which clears the list.
set is blocked in read mode, and the group has no field that operate mode may set, so set needs full mode. See Profiles & regions.
Signature
Arguments
<id>
string
Yes
Network policy _id.
<key=value>
string
Yes (≥1)
Field assignments, for example name="Corporate VPN egress" or ipDenyList='["198.51.100.0/24"]'.
Flags
Uses global flags only.
Example
Corresponds to: PATCH /v1/networkpolicies/{_id} for the four whitelisted fields; otherwise GET /v1/networkpolicies/{_id} then PUT /v1/networkpolicies/{_id}.
celigo network-policies audit
Show the audit log (change history) for one network policy. The CLI reads every page.
Signature
Arguments
<id>
string
Yes
Network policy _id.
Flags
Uses global flags only.
Example
Corresponds to: GET /v1/networkpolicies/{_id}/audit
celigo network-policies dependencies
List where the policy is assigned: MCP servers, API tokens, and workspace-user or end-user sign-in per environment. Aliased as used-by. Run it before you edit or delete a policy — the result is what an edit affects, and what delete --force would clear.
The API answers a fixed object — mcpservers, accesstokens, and account — rather than the map the other groups' dependencies return, and JSON output prints it as returned. --format table lists one row per assignment, with the columns assignedTo (mcpServer, apiToken, workspaceUserSignIn, or endUserSignIn), _id, and name, and prints Not assigned anywhere. when there is none. An unassigned policy restricts nothing, and delete needs no --force.
Signature
Arguments
<id>
string
Yes
Network policy _id.
Flags
Uses global flags only.
Example
Corresponds to: GET /v1/networkpolicies/{_id}/dependencies
celigo network-policies delete
Delete a network policy. It moves to the recycle bin for 30 days. A policy that is still assigned is refused with 409 network_policy_in_use and nothing changes; the error names the two ways forward:
--force clears the policy from every API token, MCP server, and sign-in setting it is assigned to, then deletes it, so each former assignee loses the restriction. Prompts for confirmation unless -y is supplied; with --force the question names what is cleared. Requires full mode.
Signature
Arguments
<id>
string
Yes
Network policy _id.
Flags
--force
boolean
false
Clear the policy from everything it is assigned to, then delete it. Sent as force=true.
-y, --yes
boolean
false
Skip the confirmation prompt.
Example
Corresponds to: DELETE /v1/networkpolicies/{_id} — with force=true under --force. To restore the policy, use recycle-bin.
Gotchas
A policy on your own token applies to the CLI. Before you narrow an allow list, check
dependencies <id>for the API token your profile uses, and keep the address this machine connects from on the list. Until someone repairs the policy from the UI or with another token, the CLI and every script using that token stay locked out.updateempties what it does not carry. A list the body leaves out becomes empty — lifting every restriction it imposed — and an omitteddescriptionis removed. Preferset.A list assignment replaces the whole list.
set ipAllowList='[…]'sends the complete list as one PATCH. To add one entry, read the list withget, then assign the full list back.The server normalizes entries. A bare address is stored as
/32(IPv4) or/128(IPv6), and IPv6 is compressed. A script that compares what it sent with whatgetreturns must compare the stored form.An assigned policy cannot be deleted without
--force. The plaindeleteanswers409 network_policy_in_useand changes nothing.--forceclears every assignment first, which leaves every former assignee unrestricted.Other groups take the group name for the type.
recycle-bin list --type network-policiesandaudit list --resource-type network-policiesreach the API's own spellings —networkpoliciesin the recycle bin,networkpolicyin the audit log — andrecycle-bin restore <id>routes a deleted policy correctly. Once a policy is purged from the recycle bin, itsauditroute answers404;celigo audit list --resource-type network-policiesstill lists the entries.Permission modes.
list,get,audit, anddependencieswork inreadmode.create,update,set, anddeleteneedfull—setincluded, because no network-policy field is an operational one. See Profiles & regions.
Related
mcp-servers — assign a policy to an MCP server with
set <id> _networkPolicyId=<policyId>.recycle-bin — restore a deleted policy within its 30 days, or purge it.
audit — the account-wide audit log, which keeps a purged policy's history.
environments — each environment keeps its own network policies.
Last updated
Was this helpful?