---
title: "Update Policy"
method: PUT
path: "/policies/{policy_id}"
---

# Update Policy

`PUT /policies/{policy_id}`

Update an existing policy.

Only provided fields will be updated. Omit fields to leave them unchanged.
Preset policies cannot be modified.
Requires admin role.

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

Raises:
    ResourceNotFoundError: If the policy does not exist.
    PresetPolicyModificationError: If attempting to modify a preset policy.
    AdminRequiredError: If user is not an admin.

## Path parameters

- `policy_id` string, required

## Request body

- PolicyUpdateRequest — Request body for updating an existing policy (all fields optional).
  - `name` string, nullable
  - `description` string, nullable
  - `categories` object, nullable
  - `rule_modes` object, nullable
  - `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

## Response `200`

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/versions/6ef1ea32ff13/schema)
