---
title: "Create Policy Rule"
method: POST
path: "/v1/policies"
tags: ["v1", "protected", "policies"]
---

# Create Policy Rule

`POST /v1/policies`

Create a policy rule in the current workspace.

## Request body

- PolicyRuleCreateRequest — Request body for creating a policy rule.
  - `condition` string, nullable
  - `effect` 'allow' | 'deny' | 'cap' | 'approval' | 'safety' | 'egress', required — What a rule does when it applies.
  - `enabled` boolean
  - `params` object
  - `priority` integer
  - `subject_id` string, required
  - `subject_type` 'workspace' | 'agent' | 'user' | 'group', required — The kind of subject a rule binds to.
  - `target` string, required

## Response `201`

Successful Response

- PolicyRuleResponse — Serialized policy rule returned to clients.
  - `condition` string, nullable
  - `effect` 'allow' | 'deny' | 'cap' | 'approval' | 'safety' | 'egress', required — What a rule does when it applies.
  - `enabled` boolean, required
  - `id` string, required
  - `params` object, required
  - `priority` integer, required
  - `subject_id` string, required
  - `subject_type` 'workspace' | 'agent' | 'user' | 'group', required — The kind of subject a rule binds to.
  - `target` string, required

## Other responses

- `422` — Validation Error

## Changes

> 19 revisions in range; 5 could not be searched.

- **2026-07-08** `8940d7f77282` — 1 warning, 1 info
  - added the new `egress` enum value to the `effect` response property for the response status `201`
  - added the new `egress` enum value to the request property `effect`
- **2026-06-18** `dad98bb65260` — 1 info
  - endpoint added
- **2026-03-30** `e9c153221160` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/agentarea/apis/agentarea-api/changes/v1/policies/post.md)

---

[API](https://skmtc.dev/agentarea/apis/agentarea-api.md) · [All operations](https://skmtc.dev/agentarea/apis/agentarea-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/agentarea/agentarea-api/revisions/ac18f7025c00/schema)
