Get a guardrail or custom policy
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).
Required permission
Requires the policy.read permission. See Permissions for the roles and API key permissions that include it.
Command line
The orl CLI wraps this endpoint:
orl authz policy get <policy-id>apiKeyAuthorizationBearer <token>OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).
policyId*stringThe policy
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 GET 'https://api.openrelay.inc/v1/authz/policies/string'{ "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"}Validate a policy without saving it POST
Returns line and column diagnostics and the lockout check for a candidate policy. Requires a signed-in session and the permission saving it would need.
Update, enable or disable a policy PATCH
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.