Access

Update, enable or disable a policy

Changed on

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.

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

patch/v1/authz/policies/{policyId}

Request

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

Path parameters

policyIdstring required

Request body

cedarTextstring
descriptionstring
enabledboolean
endpointsstring[]
ipRangesstring[]
modelsstring[]
namestring

Response

Updated

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