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

# Create Policy Rule

`POST /v1/workspaces/{workspace}/policies`

Create a policy rule in the current workspace.

## Path parameters

- `workspace` string, required — Slug of the workspace the request acts in

## 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

- **2026-09-26** `d3ad8e1a3681` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/agentarea/apis/agentarea-api/changes/v1/workspaces/:workspace/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.dev/agentarea/apis/agentarea-api/revisions/c926881f6c6e?raw)
