Update, enable or disable a policy
Changes a policy's name, description, networks, models, endpoints, Cedar text or enabled state, and returns it. Fields left out keep their values. Requires a signed-in session and the permission creating the policy needs.
Required permission
Checked against the guardrail.manage permission for the resource it acts on. See Permissions for the roles and API key permissions that include it.
Command line
The orl CLI wraps this endpoint:
orl authz policy update <policy-id>apiKeyAuthorizationBearer <token>OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).
policyId*stringapplication/json- body
name?stringlength <= 64description?stringlength <= 256enabled?booleanipRanges?array<string>models?array<string>endpoints?array<string>cedarText?stringlength <= 10240Updated
application/json- response
id*stringname*stringdescription?stringkind*string"guardrail""custom"enabled*booleanguardrail?stringkey_networks limits API keys to ipRanges; everyone_networks limits sessions and keys (owners only); model_allowlist limits inference to models and endpoints.
"key_networks""everyone_networks""model_allowlist"ipRanges?array<string>models?array<string>endpoints?array<string>cedarText?stringA custom policy's Cedar source.
cedar?stringThe Cedar a guardrail generates.
stale?stringSet when an enabled policy names something this version of OpenRelay does not know, or can no longer be read: what it does now and what to change.
createdBy?stringcreatedAt?stringupdatedBy?stringupdatedAt?stringcurl -X PATCH 'https://api.openrelay.inc/v1/authz/policies/string' \ -H 'Content-Type: application/json' \ -d '{}'{ "id": "string", "name": "string", "description": "string", "kind": "guardrail", "enabled": true, "guardrail": "key_networks", "ipRanges": [ "string" ], "models": [ "string" ], "endpoints": [ "string" ], "cedarText": "string", "cedar": "string", "stale": "string", "createdBy": "string", "createdAt": "string", "updatedBy": "string", "updatedAt": "string"}Get a guardrail or custom policy GET
Returns one guardrail or custom policy by id: its enabled state, its networks, models or endpoints, and its Cedar (the source, or what a guardrail generates).
Delete a policy DELETE
Deletes a guardrail or custom policy and returns 204. A delete is refused with 403 when removing the policy would let the organization do what you cannot. Requires a signed-in session and the permission creating the policy needs.