Skip to content
OpenRelay is in early access, and the /v1 API is stable. New capabilities ship in the changelog.
API ReferenceAccount and accessAccess

Validate a policy without saving it

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.

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 validate --kind <kind> --name <name>
POST
/v1/authz/policies/validate

Authorization

apiKey
headerAuthorizationBearer <token>

OpenRelay API key. Send it as Authorization: Bearer or_… (legacy vl_… keys still work).

Request Body

application/json
  1. body
name*string
Lengthlength <= 64
description?string
Lengthlength <= 256
kind*string
Value in"guardrail""custom"
enabled?boolean

Defaults to true.

guardrail?string
Value in"key_networks""everyone_networks""model_allowlist"
ipRanges?array<string>
models?array<string>
endpoints?array<string>
cedarText?string
Lengthlength <= 10240

Response Body

The validation

application/json
  1. response
valid*boolean
diagnostics*array<>
lockout*array<string>

Permissions the saving owner would lose (policy.manage, member.manage); saving is refused while this is non-empty.

Example Request
curl -X POST 'https://api.openrelay.inc/v1/authz/policies/validate' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "kind": "guardrail"}'
Example Response
{  "valid": true,  "diagnostics": [    {      "line": 0,      "column": 0,      "message": "string"    }  ],  "lockout": [    "string"  ]}