Update a Policy
update_policyUpdate a policy: metadata (description, tags), target scope (targetAll / targetLinks / removeTargetLinks / targetQuery / removeTargetQuery), and bindings (addBindings merges by permission set; removeBindings strips principals from matching bindings). Optimistic concurrency uses version/id from the current state. Call get_resource (kind="policy") first to capture state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| org | Yes | Organization slug (lowercase kebab-case). NEVER guess — if the user has not named one, ask. On org-not-found, stop and ask; do not retry variants. | |
| name | Yes | Resource name (lowercase kebab-case, starts with a letter, 2-64 chars). Names are IMMUTABLE — renaming = delete + recreate (loses URL, DNS, policy links). | |
| tags | No | Add or update tags without replacing the full set. Submit an empty list to clear all tags. | |
| targetAll | No | When true sets target="all" and clears targetLinks (exclusive with targetLinks/removeTargetLinks). | |
| addBindings | No | Bindings to merge in. Matching permission sets merge principalLinks; otherwise a new binding is appended. | |
| description | No | New description for the policy. | |
| targetLinks | No | Replace the targetLinks list with this exact set. Use removeTargetLinks for incremental removal. | |
| targetQuery | No | Replace the dynamic target query (resources matching it are targeted). | |
| removeTagKeys | No | Tag keys to remove from the resource. | |
| removeBindings | No | Bindings to remove. Each item is { permissions: string[], principalLinks: string[] }; matching permission/principal pairs are stripped and empty bindings are removed. | |
| removeTargetLinks | No | Remove these targetLinks from the existing list (mutually exclusive with full-replacement targetLinks). | |
| removeTargetQuery | No | true deletes targetQuery; a stale query keeps granting on every matched resource, additively to targetLinks. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | Whether the call succeeded. | |
| data | No | The full machine-readable result — list rows, the resource object, query results. Read THIS, not just the summary. | |
| summary | Yes | One-line summary of the result. | |
| nextSteps | No | Recommended follow-up actions for this task, in order. |