create_policy
Create a policy to allow or deny actions on all resources of a type or on a single resource.
Instructions
Create a policy. A policy grants or denies a set of actions on a resource type (type-level) or a specific resource (instance-level). After creating, assign it to a subject or role with assign_policy.
For type-level: set resource_type_id and actions — the policy applies to ALL resources of that type. For instance-level: set resource_id and actions — the policy applies to ONE specific resource.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Policy name, e.g. "editors-can-read-write-documents" | |
| effect | Yes | ALLOW grants the actions. DENY blocks them even if another policy would allow. Use ALLOW unless you specifically need an override. | |
| actions | Yes | Actions this policy covers, e.g. ["read", "write"] | |
| priority | No | Priority 0–100. Higher priority wins when multiple policies apply. Default 50. | |
| description | No | Optional description | |
| resource_id | No | Resource UUID — makes this an instance-level policy. Mutually exclusive with resource_type_id. | |
| resource_type_id | No | Resource type UUID — makes this a type-level policy. Mutually exclusive with resource_id. |