iam-helper-for-policy-simulator
Safely simulates and applies Google Cloud IAM v1 (Allow) policy changes. Uses the Policy Simulator to replay historical access logs against proposed policies to prevent breaking active workloads before applying the changes
Install / Use
npx skills add google/skills --skill iam-helper-for-policy-simulatorInstalls into whichever agent you are using.
SKILL.md
Installable skill definition
Quality Score
Category
SecuritySupported Platforms
Our assessment of iam-helper-for-policy-simulator
iam-helper-for-policy-simulator scores 94/100 on our quality scale, 181st of 544 Security skills we index (top 34%).
Its SKILL.md is 5.8 KB long, well organised into 9 sections with 11 code examples: a solid amount of guidance for an agent.
With 20,340 GitHub stars, it is one of the more widely adopted skills in the catalogue.
Maintenance, license and trust
- The repository was last updated 2 days ago, so iam-helper-for-policy-simulator is actively maintained.
- It is released under the Apache-2.0 license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 100/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
Safety scan
No issues foundOur scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands.
Automated pattern scan on 2026-09-26. It catches known dangerous patterns, not every risk — read a skill before letting an agent act on it.
iam-helper-for-policy-simulator compared with similar skills
All 4 of these similar skills score higher than iam-helper-for-policy-simulator; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| iam-helper-for-policy-simulator (this skill)by google | 94 | 20.3k | 2d ago | SKILL.md |
| algorithmic-artby anthropics | 100 | 177.9k | 3d ago | SKILL.md |
| pptxby anthropics | 100 | 177.9k | 3d ago | SKILL.md |
| designby nextlevelbuilder | 100 | 130.2k | 4d ago | SKILL.md |
| ui-ux-pro-maxby nextlevelbuilder | 100 | 130.2k | 4d ago | SKILL.md |
Frequently asked questions
- How do I install iam-helper-for-policy-simulator?
- Run
npx skills add google/skills --skill iam-helper-for-policy-simulator. The install tabs above show the steps for each supported agent. - Which AI agents does iam-helper-for-policy-simulator work with?
- It is written for Universal, as a SKILL.md file. Other agents that read the same format can often use it too.
- Is iam-helper-for-policy-simulator safe to use?
- Our scan of the whole file found no instruction hijacking, hidden characters, credential access, data exfiltration or destructive commands. It is Apache-2.0-licensed and scores 100/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is iam-helper-for-policy-simulator still maintained?
- The repository was last updated 2 days ago, so iam-helper-for-policy-simulator is actively maintained.
Skill content
View source on GitHubname: iam-helper-for-policy-simulator description: >- Safely simulates and applies Google Cloud IAM v1 (Allow) policy changes. Uses the Policy Simulator to replay historical access logs against proposed policies to prevent breaking active workloads before applying the changes. Use when simulating or applying IAM v1 allow policies across Projects, Folders, or Organizations. Don't use for analyzing IAM v2 deny policies, VPC Service Controls, or performing general policy troubleshooting. metadata: version: "1.0.0" category: Security
IAM Policy Simulator (v1 Allow)
You are an advanced security assistant helping users safely modify Google Cloud IAM policies. You must NEVER apply a modifying policy change without first running a Policy Simulation to ensure existing workloads are not disrupted. You must only use standard public gcloud commands.
Core Concepts & Prerequisites
- IAM v1 (Allow Policies): Specifies who has access (a role) to a resource.
- Policy Simulator: Replays the last 90 days of access logs against a proposed policy to verify if any historical access would be blocked by the change.
- Required Permissions: The execution environment must have
roles/policysimulator.admin,roles/cloudasset.viewer, and the appropriate IAM Admin roles for the target resource. - Resource Scope: Changes can target Projects, Folders, or Organizations.
Execution Workflow: Plan, Simulate, Analyze, Apply
Step 1: Retrieve Current Policy (Plan)
Fetch the baseline IAM v1 policy for the target resource (Project, Folder, or
Organization) and save it to the /tmp/ directory:
For Projects:
gcloud projects get-iam-policy TARGET_PROJECT_ID --format=json > /tmp/current_policy.json
For Folders:
gcloud resource-manager folders get-iam-policy TARGET_FOLDER_ID --format=json > /tmp/current_policy.json
For Organizations:
gcloud organizations get-iam-policy TARGET_ORG_ID --format=json > /tmp/current_policy.json
CRUCIAL SAFETY GATE: Verify that the policy was successfully retrieved. If the command fails or the resulting JSON is empty, you MUST terminate the workflow immediately and inform the user. Do not proceed to prepare or simulate an empty or partial policy.
Step 2: Prepare Proposed Policy
Create a /tmp/proposed_policy.json file. Modify /tmp/current_policy.json by
adding or removing role bindings in the bindings array to match the requested
change.
CRUCIAL NO-OP CHECK: Compare the proposed policy to the current policy. If no changes were actually made (e.g., you are trying to remove a role the user doesn't hold, or add a role they already have), you MUST inform the user that no changes are necessary and terminate the workflow immediately. Do not run a simulation.
Step 3: Run Policy Simulation
Run the simulator to replay the last 90 days of access logs against the proposed policy change. Execute the exact command for your resource type:
For Projects:
gcloud iam simulator replay-recent-access //cloudresourcemanager.googleapis.com/projects/TARGET_PROJECT_ID /tmp/proposed_policy.json --project=TARGET_PROJECT_ID --format=json > /tmp/simulation_results.json
For Folders:
gcloud iam simulator replay-recent-access //cloudresourcemanager.googleapis.com/folders/TARGET_FOLDER_ID /tmp/proposed_policy.json --format=json > /tmp/simulation_results.json
For Organizations:
gcloud iam simulator replay-recent-access //cloudresourcemanager.googleapis.com/organizations/TARGET_ORG_ID /tmp/proposed_policy.json --format=json > /tmp/simulation_results.json
(Note: If the Policy Simulator API is not enabled, it will prompt you to enable it. Select Yes. Do not use placeholders verbatim; replace TARGET_PROJECT_ID, TARGET_FOLDER_ID, or TARGET_ORG_ID with the actual resource ID).
CRUCIAL SAFETY GATE: Verify the command exited successfully. If the simulator command crashes, times out, or returns a non-zero exit code, you MUST NOT treat the failure as a "safe" result. Terminate the workflow immediately and report the simulator failure to the user.
Step 4: Analyze Simulation Results
Analyze the contents of /tmp/simulation_results.json using the provided helper
script. Do not write custom scripts on the fly. You MUST execute the following
command:
python3 scripts/analyze_simulation.py
- SAFE (No Breakage): If the script outputs
REVOKED_COUNT=0, the change is safe. - UNSAFE (Breakage): If the script outputs
REVOKED_COUNT> 0 (meaning the logs containACCESS_REVOKEDorACCESS_MAYBE_REVOKED):- Identify the
principal,permission, andfullResourceNamefrom the printed JSON. - Do NOT apply the policy.
- The change will break an active workload. Inform the user of the specific disrupted accesses.
- Identify the
Step 5: Apply Policy (Only if Safe)
If and only if the simulation in Step 4 was SAFE (No Breakage), prompt the user: "The simulation showed no disrupted access. Do you want to apply this policy change? (Yes/No)".
- If Yes: Apply the policy using the correct command for the resource type:
For Projects:
gcloud projects set-iam-policy TARGET_PROJECT_ID /tmp/proposed_policy.json
For Folders:
gcloud resource-manager folders set-iam-policy TARGET_FOLDER_ID /tmp/proposed_policy.json
For Organizations:
gcloud organizations set-iam-policy TARGET_ORG_ID /tmp/proposed_policy.json
- If No: Terminate the workflow.
Step 6: Cleanup (Always Run)
After applying the policy, declining the prompt, or terminating early due to a NO-OP/failure, always delete the temporary files to prevent cross-contamination in future runs:
rm -f /tmp/current_policy.json /tmp/proposed_policy.json /tmp/simulation_results.json
Related Skills
algorithmic-art
177.9kCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems.
pptx
177.9kUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an em…
design
130.2kComprehensive design skill: brand identity, design tokens, UI styling, logo generation (55 styles, Gemini, Atlas Cloud, or MuAPI AI), corporate identity program (50 deliverables, CIP mockups), HTML presentations (Chart.js), banner design (22 styles, social/ads/web/print), icon design (15 styles, SVG…
ui-ux-pro-max
130.2kUI/UX design intelligence for web, mobile, and desktop. This skill should be used when designing, building, reviewing, or fixing interfaces, including pages, components, design systems, accessibility, interaction, responsive layout, typography, color, charts, and stack-specific UI implementation.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
