--- license: mit pretty_name: "Preflight โ€” GCP IAM Guardrails for Claude Code (free sample)" tags: - claude-code - ai-agents - developer-tools - devops - gcp - iam - security - guardrails --- ![Preflight โ€” GCP IAM Guardrails for Claude Code](banner.png) # ๐Ÿ›ก๏ธ GCP IAM Guardrails for Claude Code โ€” free sample **Stop your AI coding agent from running destructive `gcloud`, `gsutil`, and `bq` commands against your GCP project.** This repo is a free sample from the [**Preflight**](https://lindenberg17.gumroad.com/) studio โ€” *catch it before it ships.* Letting Claude Code (or any agent) touch a real cloud project is great until the day it runs `gcloud projects delete` or `gsutil rm -r` on the wrong bucket. These deny rules make Claude Code **refuse those commands outright** โ€” no confirmation, no "oops." ## What's in this free sample `sample-deny-rules.json` โ€” **10 of the highest-impact deny rules** from the full pack, as a ready-to-merge `settings.json` fragment. Drop the `permissions.deny` array into your project's `.claude/settings.json` and Claude Code will block: | Blocked command | Why it matters | |---|---| | `gcloud projects delete` | nukes an entire project | | `gcloud * set-iam-policy` | overwrites your whole IAM policy (lockout / privilege escalation) | | `gcloud * remove-iam-policy-binding` | silently strips access | | `gcloud iam service-accounts delete` | kills a service account other things depend on | | `gcloud iam service-accounts keys delete` | breaks live auth | | `gcloud compute instances delete` | deletes a VM | | `gcloud storage buckets delete` | deletes a bucket | | `gcloud storage rm` / `gsutil rm -r` | deletes objects, recursively | | `gsutil iam ch *allUsers*` | makes private data **public** | | `bq rm` | drops BigQuery datasets/tables | ### Install (30 seconds) 1. Open `sample-deny-rules.json`. 2. Merge the `permissions.deny` array into your project's `.claude/settings.json` (create the file if it doesn't exist). 3. Done. Try asking Claude to delete a bucket โ€” it refuses. ## What the full product adds The free sample is the "obvious catastrophes" layer. The paid product is the defense-in-depth version: - **27 deny rules** (17 more than here), covering snapshots, disks, networks, firewall rules, logging sinks, service-account keys, and more. - An **`ask` tier** for risky-but-recoverable operations (add-iam-policy-binding, stop instance, create SA key) so they pause for human approval instead of being blocked. - A curated **`allow` list** so safe read-only commands (`list`, `describe`, `get-iam-policy`) never prompt โ€” no guardrail fatigue. - A **PreToolUse hook** (`block-destructive-gcloud.sh`) that catches obfuscated and chained commands the static rules can miss. - A **31-assertion test suite** proving every block/allow decision, so you can trust it. - `INSTALL.md`, `SKILL.md`, and worked `examples/` (allowed vs blocked). ### โ†’ Get the full pack on Gumroad **[GCP IAM Guardrails for Claude Code โ€” $24](https://lindenberg17.gumroad.com/l/hmtcxf?ref=hf)** --- *From **Preflight** โ€” guardrails for agentic coding & cloud. See also: [Terraform Plan Reviewer](https://lindenberg17.gumroad.com/l/qodem?ref=hf) ยท [webOS QA Checklist Runner](https://lindenberg17.gumroad.com/l/fhrioj?ref=hf).*