---
title: "Create Policy"
method: POST
path: "/policies"
---

# Create Policy

`POST /policies`

Create a new policy.

The policy will be created under the organization associated with the API key.
Requires admin role.

Docs: [Guide](https://docs.grayswan.ai/policy-management/policies) |
[API Reference](https://docs.grayswan.ai/api-reference/policies/create-policy)

## Request body

- PolicyCreateRequest — Request body for creating a new policy.
  - `name` string, required — Policy name
  - `description` string, nullable — Policy description
  - `categories` object — Rule definitions (key -> description)
  - `rule_modes` object — Per-rule enforcement mode: "block" (default), "observe", or "disabled"
  - `mode` string, nullable — Policy mode
  - `pre_violation_threshold` number, nullable
  - `pre_jb_threshold` number, nullable
  - `post_violation_threshold` number, nullable
  - `post_violation_jb_threshold` number, nullable
  - `scanners_config` object, nullable
  - `block_message` string, nullable

## Response `201`

Successful Response

- PolicyDetailResponse — Full policy response with all fields.
  - `id` string, required
  - `name` string, required
  - `description` string, nullable
  - `rules` object, required
  - `rule_modes` object
  - `mode` string, nullable
  - `pre_violation_threshold` number, nullable
  - `pre_jb_threshold` number, nullable
  - `post_violation_threshold` number, nullable
  - `post_violation_jb_threshold` number, nullable
  - `scanners_config` object, nullable
  - `block_message` string, nullable
  - `is_preset` boolean
  - `created_at` string, date-time, nullable
  - `updated_at` string, date-time, nullable

## Other responses

- `422` — Validation Error

---

[API](https://skmtc.net/grayswan/apis/gray-swan-ai-api.md) · [All operations](https://skmtc.net/grayswan/apis/gray-swan-ai-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/grayswan/gray-swan-ai-api/revisions/6ef1ea32ff13/schema)
