policies

Create policy

Create a new policy configuration

post/v1/policies

Request

  • Base URL: https://platform.lakera.ai/api
  • URL: https://platform.lakera.ai/api/v1/policies
  • Auth: HTTP bearer

Request body

namestring required

A descriptive name for the policy. Leading and trailing whitespace is stripped. Must be unique within your organization.

default_threshold'l1_confident' | 'l2_very_likely' | 'l3_likely' | 'l4_less_likely' required

The confidence level at or above which the policy's detectors flag content. l1_confident is the most lenient and l4_less_likely the strictest. Thresholds are inclusive — l2_very_likely flags on both l2_very_likely and l1_confident detections.

custom_guardrail_idsstring[]

IDs of the custom guardrails to attach to this policy.

Response

Policy created successfully

status'ok'

Response status

messagestring

Human-readable response message

idstring

Policy ID

Changes

No recorded changes to this operation across all 1 revision of this API.