Create a policy
Requires manage_policy.
A policy carries two things: typed spend columns for the common cases, and a
general rules array. The columns are desugared into rules at compile time, so
they are shorthand, not a separate mechanism.
Everything is validated when you write it, never when an agent is waiting. An
unknown rule kind, a missing setting, or an import naming a module that does not
exist all fail here with a 422.
Authorizations
An identity bearer token for a person or your backend. Capabilities are per member, per workspace. This credential can manage the workspace and can never authorize an action as an agent.
Path Parameters
Body
The policy shape, without an agent binding. Used for previews.
Required on create.
active, disabled blocklist permits unless a rule denies. allowlist inverts it: denied unless an allow rule matches, reported as not_allowlisted. Each allowlist policy is an independent gate, so attaching two means both must be satisfied. A deny still overrides an allow.
blocklist, allowlist Policy module names. Their rules compile in ahead of rules.
Response
The policy, with a stable id assigned to every rule.
The policy shape, without an agent binding. Used for previews.