gcp-iam

gcp-iam is a skill for Claude Code from Goodsmileduck/claude-registry. It costs 69 tokens per session (1,998 once invoked), scanned A, original, MIT.

A guide for diagnosing Google Cloud IAM permission errors, including inherited permissions, service-account impersonation, and Workload Identity Federation. IAM is Google Cloud's system for controlling who can access resources.

In plain words
What is it for?
Use it to debug denied GCP operations, service-account token errors, GitHub Actions authentication, Workload Identity, and cross-project impersonation.
Why use it?
It helps explain why access can fail even when someone appears to have a role elsewhere in the Google Cloud hierarchy. It traces the full chain of users, service accounts, projects, and conditions.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the cloud-platform-skills plugin — 7 skills shipped together

Good fit Use it to debug denied GCP operations, service-account token errors, GitHub Actions authentication, Workload Identity, and cross-project impersonation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/goodsmileduck/claude-registry/gcp-iam
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Goodsmileduck/claude-registry --skill gcp-iam
Clone the repo
git clone --depth 1 https://github.com/Goodsmileduck/claude-registry

Made for: Claude Code.

Or install cloud-platform-skills, the plugin that ships this one along with the rest of its 7 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for gcp-iam

README.md
[![agentmods](https://agentmods.dev/badge/skills/goodsmileduck/claude-registry/gcp-iam/github.svg)](https://agentmods.dev/skills/goodsmileduck/claude-registry/gcp-iam)
Your own site
<a href="https://agentmods.dev/skills/goodsmileduck/claude-registry/gcp-iam"><img src="https://agentmods.dev/badge/skills/goodsmileduck/claude-registry/gcp-iam/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for gcp-iam

Your own site · 80×15
<a href="https://agentmods.dev/skills/goodsmileduck/claude-registry/gcp-iam"><img src="https://agentmods.dev/badge/skills/goodsmileduck/claude-registry/gcp-iam.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 69 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,998 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00069 $0.01998
Opus 5 $0.00034 $0.00999
Sonnet 5 $0.00014 $0.00400
Haiku 4.5 $0.00007 $0.00200

Measured 10d ago against content hash b3c61bec0c79, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

gcp-iam scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/cloud-platform-skills/skills/gcp-iam/SKILL.md · 155 lines

How it starts

The opening of the file, as written. The whole thing — 155 lines — stays where its author put it; the contents beside it link to each section on GitHub.

For the GitHub Actions caller side of Workload Identity Federation (permissions: id-token: write, google-github-actions/auth setup, the OIDC token shape), see the github-actions-pipelines skill. This skill covers the GCP side: pool provider attribute conditions, service account iam.workloadIdentityUser bindings, impersonation chains.

GCP IAM Inheritance

When to invoke

Symptoms:

  • permission denied: <permission> on resource <X> despite the user being "in the right group at the org level."
  • iam.serviceAccounts.getAccessToken denied during Workload Identity, ESO sync, or CI/CD.
  • A service account can get a resource but not list siblings (or vice versa).
  • gcloud projects get-iam-policy <project> shows no binding for the user, but the user can log into the project console.
  • Cross-project SA impersonation works for human users via gcloud auth login but fails from a workload.

The trap this prevents: assuming GCP IAM is additive across the hierarchy in all directions. It is — but with caveats around conditional bindings, deny policies, audit-log filtering, and the fact that some permissions only apply at specific resource levels.

The inheritance model (the part that does work)

Organization
  └── Folder(s)
        └── Project(s)
              └── Resource(s)   (Bucket, BQ Dataset, GCE Instance, etc.)

Rule: A role granted at level N applies to N and everything below it. Permissions are added — never subtracted (except by Deny policies, see below).

So roles/storage.admin granted at the folder level grants storage.admin on every project under that folder. This is the "obvious" inheritance and it does work as expected.

Why "group at org" sometimes fails to grant project access

Common reasons users report "I'm in the group but it doesn't work":

  1. The group has no IAM binding at any level. Group membership alone grants nothing. The group must appear as a principal in an IAM binding somewhere in the hierarchy.
    # Find every binding that includes a group, project or higher
    gcloud projects get-iam-policy <project> \
      --flatten="bindings[].members" \
      --filter="bindings.members:group:<group-email>" \
      --format="value(bindings.role)"
    
    gcloud organizations get-iam-policy <org-id> \
      --flatten="bindings[].members" \
      --filter="bindings.members:group:<group-email>" \
      --format="value(bindings.role)"
    

Read the full file on GitHub · 155 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 155 lines · 69 tokens per session scan A b3c61bec0c79

Subscribe to this mod's changes

gcp-iam is a skill published in the GitHub repository Goodsmileduck/claude-registry (1 stars, last pushed 1mo ago), licensed MIT. It adds 69 tokens to every session and 1,998 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.