IAM Helper for Policy Management
Orchestrates the lifecycle and management of IAM allow and deny policies across
IAM v1 (allow policies) and IAM v2 (deny policies).
Usage Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read and follow the instructions in
Usage Attribution.
Core Concepts & Paradigms
IAM operates across two policy paradigms:
- IAM v1 (Allow Policies): Grants roles to principals (users, service
accounts, groups, domains) on specific resources. Supports Resource Manager
resources (organizations, folders, projects) as well as individual resources
across supported Google Cloud services.
- IAM v2 (Deny Policies): Sets explicit organization-, folder-, or
project-level guardrails that prevent specified principals from using
designated permissions, regardless of any allow policies granted. Evaluated
before allow policies.
Workflow & Decision Tree
When receiving a policy management request, determine whether the operation is
Read-Only or Mutating, and whether it targets IAM v1 (Allow
Policies) or IAM v2 (Deny Policies):
1. Read-Only Operations (Autonomous Execution)
Read-only actions include the following:
- IAM v1 Allow Policies:
get-iam-policy on project/folder/organization,
or gcloud iam list-testable-permissions //cloudresourcemanager.googleapis.com/projects/PROJECT_ID.
- IAM v2 Deny Policies:
gcloud iam policies list or gcloud iam policies get with --attachment-point and --kind=denypolicies.
For read-only actions, execute the command autonomously to inspect state, and
present the query results clearly to the user.
2. Mutating Operations (Plan & Confirm Protocol)
Mutating operations include the following:
- IAM v1 Allow Policies:
add-iam-policy-binding,
remove-iam-policy-binding, or set-iam-policy across project, folder,
organization, or resource levels (see
references/v1-allow-policies.md).
- IAM v2 Deny Policies:
create, update, or delete deny policies on
attachment points
(cloudresourcemanager.googleapis.com/projects/PROJECT_ID,
cloudresourcemanager.googleapis.com/folders/FOLDER_ID, or
cloudresourcemanager.googleapis.com/organizations/ORG_ID) using YAML/JSON
policy files (see
references/v2-deny-policies.md).
For mutating operations, follow the Plan & Confirm Protocol below. DO
NOT execute mutating commands autonomously without prior user approval.
Execution & Safety Protocol
- Plan and Confirm (No Autonomous Mutation): Mutating allow and deny
policy changes modify live security perimeters and access controls. You MUST
NOT execute mutating
gcloud commands directly via tool calls without
explicit prior confirmation from the user. When asked to apply a mutating
change, do the following:
- Formulate the Command: Generate the exact, fully constructed
gcloud command (including all parameters such as --member, --role,
--attachment-point, --kind=denypolicies, and --policy-file).
- Warn of Impact & Propagation: Issue a general warning that the
change could impact access in a live environment and takes time to
propagate across Google Cloud global infrastructure.
- Request User Confirmation: Prompt the user for approval before
applying the changes to the live environment.
- Post-Execution Verification: After the user approves and the mutating
policy change is executed, run the corresponding verification command (see
references/v1-allow-policies.md and
references/v2-deny-policies.md for exact
verification steps) to verify that the active state matches expectations
before reporting completion.
- Security Guardrail (Public & Blanket Access Refusal): Never grant
allUsers or allAuthenticatedUsers basic roles (roles/owner,
roles/editor, roles/viewer, roles/admin, roles/writer, and
roles/reader) or broad permissions. Explicitly refuse blanket public
access requests, explain the severe security risks of public project
ownership/access, and propose scoped, least-privileged role bindings for
specific authenticated identities instead.
Supporting Links
1---2name: iam-helper-for-policy-management3description: >-4 Streamlines the creation, modification, and management of IAM allow policies5 (v1) and deny policies (v2). Manages access control across Resource Manager6 resources (Organization, Folder, Project) and individual resources. Use when7 creating, updating, listing, or deleting IAM allow policies or deny policies.8 Don't use for access denial troubleshooting (use9 iam-helper-for-troubleshooting), temporary privileged access (use10 iam-helper-for-privileged-access-management), configuring VPC Service11 Controls, or managing network firewall rules.12metadata:13 source: https://skillmd.com/skills/google/iam-helper-for-policy-management14 version: "1.0.1"15 category: Security16---1718# IAM Helper for Policy Management1920Orchestrates the lifecycle and management of IAM allow and deny policies across21IAM v1 (allow policies) and IAM v2 (deny policies).2223## Usage Attribution2425**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you26MUST read and follow the instructions in27[Usage Attribution](references/attribution.md).2829--------------------------------------------------------------------------------3031## Core Concepts & Paradigms3233IAM operates across two policy paradigms:34351. **IAM v1 (Allow Policies)**: Grants roles to principals (users, service36 accounts, groups, domains) on specific resources. Supports Resource Manager37 resources (organizations, folders, projects) as well as individual resources38 across supported Google Cloud services.392. **IAM v2 (Deny Policies)**: Sets explicit organization-, folder-, or40 project-level guardrails that prevent specified principals from using41 designated permissions, regardless of any allow policies granted. Evaluated42 before allow policies.4344--------------------------------------------------------------------------------4546## Workflow & Decision Tree4748When receiving a policy management request, determine whether the operation is49**Read-Only** or **Mutating**, and whether it targets **IAM v1 (Allow50Policies)** or **IAM v2 (Deny Policies)**:5152### 1. Read-Only Operations (Autonomous Execution)5354Read-only actions include the following:5556- **IAM v1 Allow Policies**: `get-iam-policy` on project/folder/organization,57 or `gcloud iam list-testable-permissions58 //cloudresourcemanager.googleapis.com/projects/PROJECT_ID`.59- **IAM v2 Deny Policies**: `gcloud iam policies list` or `gcloud iam policies60 get` with `--attachment-point` and `--kind=denypolicies`.6162For read-only actions, execute the command autonomously to inspect state, and63present the query results clearly to the user.6465### 2. Mutating Operations (Plan & Confirm Protocol)6667Mutating operations include the following:6869- **IAM v1 Allow Policies**: `add-iam-policy-binding`,70 `remove-iam-policy-binding`, or `set-iam-policy` across project, folder,71 organization, or resource levels (see72 [references/v1-allow-policies.md](references/v1-allow-policies.md)).73- **IAM v2 Deny Policies**: `create`, `update`, or `delete` deny policies on74 attachment points75 (`cloudresourcemanager.googleapis.com/projects/PROJECT_ID`,76 `cloudresourcemanager.googleapis.com/folders/FOLDER_ID`, or77 `cloudresourcemanager.googleapis.com/organizations/ORG_ID`) using YAML/JSON78 policy files (see79 [references/v2-deny-policies.md](references/v2-deny-policies.md)).8081For mutating operations, follow the **Plan & Confirm Protocol** below. **DO82NOT** execute mutating commands autonomously without prior user approval.8384--------------------------------------------------------------------------------8586## Execution & Safety Protocol8788- **Plan and Confirm (No Autonomous Mutation)**: Mutating allow and deny89 policy changes modify live security perimeters and access controls. You MUST90 NOT execute mutating `gcloud` commands directly via tool calls without91 explicit prior confirmation from the user. When asked to apply a mutating92 change, do the following:93 1. **Formulate the Command**: Generate the exact, fully constructed94 `gcloud` command (including all parameters such as `--member`, `--role`,95 `--attachment-point`, `--kind=denypolicies`, and `--policy-file`).96 2. **Warn of Impact & Propagation**: Issue a general warning that the97 change could impact access in a live environment and takes time to98 propagate across Google Cloud global infrastructure.99 3. **Request User Confirmation**: Prompt the user for approval before100 applying the changes to the live environment.101- **Post-Execution Verification**: After the user approves and the mutating102 policy change is executed, run the corresponding verification command (see103 [references/v1-allow-policies.md](references/v1-allow-policies.md) and104 [references/v2-deny-policies.md](references/v2-deny-policies.md) for exact105 verification steps) to verify that the active state matches expectations106 before reporting completion.107- **Security Guardrail (Public & Blanket Access Refusal)**: Never grant108 `allUsers` or `allAuthenticatedUsers` basic roles (`roles/owner`,109 `roles/editor`, `roles/viewer`, `roles/admin`, `roles/writer`, and110 `roles/reader`) or broad permissions. Explicitly refuse blanket public111 access requests, explain the severe security risks of public project112 ownership/access, and propose scoped, least-privileged role bindings for113 specific authenticated identities instead.114115--------------------------------------------------------------------------------116117## Supporting Links118119- [IAM Overview](https://cloud.google.com/iam/docs/overview)120- [IAM Deny Policies](https://cloud.google.com/iam/docs/deny-overview)