Skip to main content
PATCH
Update a standing policy rule

Authorizations

Authorization
string
header
required

JWT authentication token

Path Parameters

id
string<uuid>
required

Body

application/json

Every field is optional; only what is supplied changes.

action
object

What happens when the matcher matches. Each action only runs on the events that read it, and a pairing outside that is refused.

enabled
boolean
matcher
object

Which calls the rule covers. An absent field matches anything, so an empty matcher covers everything within its scope. Prefer path for anything about a file or directory: it is checked against every string in the call, so one rule covers a read, a write, and a shell command alike.

Response

Rule updated

action
object
required

What happens when the matcher matches. Each action only runs on the events that read it, and a pairing outside that is refused.

created_at
string<date-time>
required
enabled
boolean
required
event
enum<string>
required

The moment in a task where the rule is checked.

Available options:
PreToolUse,
PostToolUse,
PostToolUseFailure,
PermissionRequest,
SessionStart,
SubagentStop,
Stop
id
string<uuid>
required
locked
boolean
required

Locked workspace policy cannot be changed through this API.

matcher
object
required

Which calls the rule covers. An absent field matches anything, so an empty matcher covers everything within its scope. Prefer path for anything about a file or directory: it is checked against every string in the call, so one rule covers a read, a write, and a shell command alike.

scope
enum<string>
required

Who the rule applies to. Rules from every scope are evaluated together.

Available options:
org,
repo,
user,
thread
scope_id
string
required
updated_at
string<date-time>
required
editable
boolean

Whether this caller may change or delete the rule. Reads are wider than writes.