Skip to content

Create a agent-policy

POST
/agent-policies
object
data
object
name
required
string
>= 1 characters <= 200 characters
organisation
required
One of:

DocumentId reference to api::organisation.organisation

string
scope_type
required

Determines what scope_value refers to: org = org-level policy, environment = named env (dev/prod/…), action_type = action type pattern.

string
Allowed values: org environment action_type
scope_value

The scoped value: org documentId, environment name, or action type pattern. Null means applies to all within the org.

string
autonomy_level
required

L0=observe only (no writes), L1=suggest only (no writes), L2=execute with approval, L3=auto-execute within policy.

string
Allowed values: L0 L1 L2 L3
freeze_windows

Array of time windows where all agent actions are blocked. Format: [{name: string, start: ‘HH:MM’, end: ‘HH:MM’, days: number[], timezone: string}]. days: 0=Sunday…6=Saturday.

max_blast_radius

Maximum scope of impact a single agent action may have under this policy.

string
Allowed values: single_resource service_tier availability_zone region
allowed_action_types

Explicit allowlist of action type strings. Null = all action types are allowed within the autonomy_level.

blocked_action_types

Explicit blocklist of action type strings. Takes precedence over allowed_action_types.

is_active
required
boolean
created_by_agent

True when this policy was created by an agent. Used by no-self-policy-mutation guard to reject agent-initiated mutations.

boolean
policy_document

Legacy OPA-compatible policy document. Format: { allow_actions: string[], deny_actions: string[], conditions: { max_instances_per_day?: number, allowed_regions?: string[], … } }

scope

Legacy: Policy specificity scope for OPA matching priority (per-action > per-env > per-provider > global).

string
Allowed values: global per-provider per-env per-action
provider
string
Allowed values: aws azure gcp hetzner all
environment
string
Allowed values: dev staging prod sandbox all
action_pattern

Legacy: Glob-style pattern matched against the requested action. ’*’ matches all.

string

Created

object
data
object
name
required
string
>= 1 characters <= 200 characters
organisation
required
One of:

DocumentId reference to api::organisation.organisation

string
scope_type
required

Determines what scope_value refers to: org = org-level policy, environment = named env (dev/prod/…), action_type = action type pattern.

string
Allowed values: org environment action_type
scope_value

The scoped value: org documentId, environment name, or action type pattern. Null means applies to all within the org.

string
autonomy_level
required

L0=observe only (no writes), L1=suggest only (no writes), L2=execute with approval, L3=auto-execute within policy.

string
Allowed values: L0 L1 L2 L3
freeze_windows

Array of time windows where all agent actions are blocked. Format: [{name: string, start: ‘HH:MM’, end: ‘HH:MM’, days: number[], timezone: string}]. days: 0=Sunday…6=Saturday.

max_blast_radius

Maximum scope of impact a single agent action may have under this policy.

string
Allowed values: single_resource service_tier availability_zone region
allowed_action_types

Explicit allowlist of action type strings. Null = all action types are allowed within the autonomy_level.

blocked_action_types

Explicit blocklist of action type strings. Takes precedence over allowed_action_types.

is_active
required
boolean
created_by_agent

True when this policy was created by an agent. Used by no-self-policy-mutation guard to reject agent-initiated mutations.

boolean
policy_document

Legacy OPA-compatible policy document. Format: { allow_actions: string[], deny_actions: string[], conditions: { max_instances_per_day?: number, allowed_regions?: string[], … } }

scope

Legacy: Policy specificity scope for OPA matching priority (per-action > per-env > per-provider > global).

string
Allowed values: global per-provider per-env per-action
provider
string
Allowed values: aws azure gcp hetzner all
environment
string
Allowed values: dev staging prod sandbox all
action_pattern

Legacy: Glob-style pattern matched against the requested action. ’*’ matches all.

string
documentId
string
id
integer
createdAt
string format: date-time
updatedAt
string format: date-time
publishedAt
string format: date-time
nullable

Validation error

Missing or invalid authentication

Not authorized (tenant scope or capability)