Access

Create a guardrail or a custom Cedar policy

Changed on

Saves a guardrail (key networks, everyone networks or a model allowlist) or a custom Cedar policy and returns it, enabled unless you send enabled: false. Requires a signed-in session. Guardrails that apply to API keys only need guardrail.manage; the everyone_networks guardrail and every custom policy can block sessions and need policy.manage (owners). A policy that would take policy.manage or member.manage from the saving owner is refused with 409 WOULD_LOCK_OUT.

Checked against the guardrail.manage permission for the resource it acts on. See Permissions for the roles and API key permissions that include it.

post/v1/authz/policies

Request

  • Base URL
    https://api.openrelay.inc
  • URL
    https://api.openrelay.inc/v1/authz/policies
  • Auth
    HTTP bearer

Request body

cedarTextstring
descriptionstring
enabledboolean

Defaults to true.

endpointsstring[]
guardrail'key_networks' | 'everyone_networks' | 'model_allowlist'
ipRangesstring[]
kind'guardrail' | 'custom' required
modelsstring[]
namestring required

Response

Created

cedarstring

The Cedar a guardrail generates.

cedarTextstring

A custom policy's Cedar source.

createdAtstring
createdBystring
descriptionstring
enabledboolean required
endpointsstring[]
guardrail'key_networks' | 'everyone_networks' | 'model_allowlist'

key_networks limits API keys to ipRanges; everyone_networks limits sessions and keys (owners only); model_allowlist limits inference to models and endpoints.

idstring required
ipRangesstring[]
kind'guardrail' | 'custom' required
modelsstring[]
namestring required
stalestring

Set 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.

updatedAtstring
updatedBystring

Changes

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      endpoint added