---
title: "Create governance policy"
method: POST
path: "/api/guardrail/policies"
tags: ["GuardRail"]
---

# Create governance policy

`POST /api/guardrail/policies`

## Request

- Base URL: `https://plith.ai`
- URL: `https://plith.ai/api/guardrail/policies`
- Auth: none required

Create a behavioral governance policy. Rules are evaluated deterministically at check time. Supported operators: eq, starts_with, contains, gt, lt, and, or, not. FREE.

## Request body

- object
  - `name` string, required: Unique policy name within the org.
  - `description` string
  - `rules` object[], required: Non-empty array of rule objects. Rules are evaluated with implicit AND.
    - `operator` 'eq' | 'starts_with' | 'contains' | 'gt' | 'lt' | 'and' | 'or' | 'not'
    - `field` string: Field path on proposed_action to evaluate (e.g. 'type', 'cost_estimate').
    - `value` unknown
    - `rules` unknown[]: Sub-rules for 'and' / 'or' operators.
      - unknown
    - `rule` object: Sub-rule for 'not' operator.
  - `action_types` string[]: Optional. Action types this policy applies to. Used for GIN index optimization to avoid loading irrelevant policies.
  - `priority` integer: Higher priority policies are evaluated first.

## Response `201`

Policy created

- object
  - `policy` object
    - `id` string, uuid
    - `name` string
    - `description` string, nullable
    - `rules` unknown[]
      - unknown
    - `action_types` string[]
    - `priority` integer
    - `enabled` boolean
    - `created_at` string, date-time
    - `updated_at` string, date-time
  - `cross_product` string
  - `request_id` string
  - `credits_used` integer
  - `credits_remaining` integer
  - `fallback_behavior` string

## Other responses

- `400`: Missing name or rules
- `401`: Invalid or missing API key
- `409`: A policy with this name already exists for the org
- `413`: Payload too large
- `500`: Internal server error

---

[API](https://skmtc.dev/plith/apis/plith-api.md) · [All operations](https://skmtc.dev/plith/apis/plith-api/llms.txt) · [OpenAPI document](https://skmtc.dev/plith/apis/plith-api/revisions/4a03164b0d75?raw)
