iam-helper-for-troubleshooting

Diagnoses and remediates Google Cloud IAM access denials via Policy Troubleshooter and PAM.

Updated May 11, 2026
One-click install
npx skills add https://github.com/alon3153/upe-social-publisher --skill iam-helper-for-troubleshooting-alon3153
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: iam-helper-for-troubleshooting
Source: https://github.com/alon3153/upe-social-publisher/tree/main/.agents/skills/iam-helper-for-troubleshooting
Command: npx skills add https://github.com/alon3153/upe-social-publisher --skill iam-helper-for-troubleshooting-alon3153

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve? Google Cloud access denials (403 errors) are hard to diagnose because allow policies, deny policies, and Principal Access Boundary policies interact across the resource hierarchy. This Skill identifies the root cause of an access denial and orchestrates the correct remediation path based on whether the caller is a blocked developer or a privileged administrator. ## Core Features & Use Cases - Dual-mode troubleshooting: A Requester Flow for developers (error capture, self-service PAM JIT activation, structured escalation tickets) and a Resolver Flow for admins (authoritative policy analysis, deny exemptions, least-privilege role discovery, PAM/IAM provisioning). - Policy Troubleshooter integration: Uses the Policy Troubleshooter MCP server or gcloud fallback commands to evaluate allow, deny, and PAB policies from an error ID or principal/permission/resource tuple. - Least-privilege role discovery: A helper script finds the narrowest predefined or custom IAM role granting a specific permission, excluding overly broad basic roles. - Safety guardrails: Human-in-the-loop approval tiers for read-only, mutating, and admin role grants, plus anti-looping and access-already-granted termination rules. - Use Case: A developer hits a 403 on bigquery.datasets.create. The Skill extracts the error ID, runs Policy Troubleshooter, finds no deny policy but a missing allow binding, activates an existing PAM entitlement for one hour, and verifies access before the developer retries. ## Quick Start Ask the assistant to troubleshoot why your Google Cloud account gets a permission denied error on a specific resource, providing the error ID or the principal, permission, and resource URI.

Frequently Asked Questions about iam-helper-for-troubleshooting

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

FAQPage Schema
How do I troubleshoot a Google Cloud IAM permission denied error?

Provide the base64 error ID from the 403 response, or the principal email, missing permission, and resource URI. The Skill calls Policy Troubleshooter to evaluate allow, deny, and Principal Access Boundary policies and reports the root cause.

How do I find the least-privileged IAM role for a permission?

Run the included least_privileged_role.py script with the IAM_PERMISSION environment variable set. It queries predefined and custom roles via gcloud, excludes broad basic roles like roles/owner, and returns the role with the fewest included permissions.

Can this Skill fix access blocked by an IAM deny policy?

Yes, in Resolver mode it presents options to add the principal to exceptionPrincipals, remove the permission from the deny rule, or narrow the policy scope. All deny policy updates require explicit human approval before execution.

Does it support Privileged Access Manager for temporary access?

Yes. The Requester flow checks for existing PAM entitlements and creates time-bound grants with gcloud pam grants create. The Resolver flow can delegate entitlement creation and grant requests to a companion PAM skill.

Why does troubleshooting stop when access state is UNKNOWN?

An UNKNOWN state means the caller lacks permissions to expand group memberships, typically requiring roles/browser. The Skill terminates immediately rather than running speculative secondary queries that could misdiagnose the issue.

What permissions are required to run Policy Troubleshooter?

The caller needs roles/policyintelligence.policyTroubleshooterViewer or roles/iam.securityReviewer, plus roles/serviceusage.serviceUsageConsumer for gcloud commands. If the caller gets PERMISSION_DENIED, the Skill halts instead of retrying alternative commands.