iam-helper-for-policy-simulator

Simulates Google Cloud IAM v1 policy changes against access logs before applying them.

19.1k|1.5k|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/google/skills --skill iam-helper-for-policy-simulator
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iam-helper-for-policy-simulator
Source: https://github.com/google/skills/tree/main/skills/cloud/iam-helper-for-policy-simulator
Command: npx skills add https://github.com/google/skills --skill iam-helper-for-policy-simulator

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Changing IAM policies on Google Cloud Projects, Folders, or Organizations risks accidentally revoking permissions that active workloads depend on, causing production outages. This Skill prevents that by replaying the last 90 days of access logs against a proposed policy before any change is applied.

Core Features & Use Cases

  • Policy Simulation: Uses the Google Cloud Policy Simulator to replay historical access logs against a proposed IAM v1 allow policy and detect revoked access.
  • Safety-Gated Workflow: Enforces a strict Plan, Simulate, Analyze, Apply sequence with no-op detection, failure gates, and mandatory user confirmation before applying changes.
  • Multi-Scope Support: Works across Projects, Folders, and Organizations using standard gcloud commands.
  • Use Case: Before removing an apparently unused role from a service account on a production project, run a simulation to confirm no workload used that permission in the last 90 days, then apply the change only if the simulation reports zero revoked accesses.

Quick Start

Ask the assistant to simulate removing a specific IAM role binding from a Google Cloud project and apply the change only if the simulation shows no disrupted access.

Frequently Asked Questions about iam-helper-for-policy-simulator

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I safely change IAM policies on Google Cloud?

Use the Policy Simulator to replay the last 90 days of access logs against your proposed policy before applying it. If the simulation shows zero revoked accesses, the change is safe to apply with gcloud set-iam-policy.

How to test if removing an IAM role will break a workload?

Run gcloud iam simulator replay-recent-access with the proposed policy against the target project, folder, or organization. The results flag any ACCESS_REVOKED or ACCESS_MAYBE_REVOKED entries, identifying the principal, permission, and resource that would be disrupted.

What permissions are required for IAM Policy Simulator?

The execution environment needs roles/policysimulator.admin, roles/cloudasset.viewer, and the appropriate IAM Admin role for the target resource. The Policy Simulator API must also be enabled, which gcloud will prompt for if missing.

Does Policy Simulator work with IAM deny policies or VPC Service Controls?

No, this workflow only supports IAM v1 allow policies. It does not analyze IAM v2 deny policies, VPC Service Controls, or general policy troubleshooting scenarios.

What happens if the policy simulation fails or crashes?

A simulator failure is never treated as a safe result. The workflow terminates immediately, reports the failure, and cleans up temporary policy files in /tmp without applying any changes.