gcp-spend-guardrails

gcp-spend-guardrails is a skill for Claude Code, Codex from shivamsriva31093/gcp-ironclad. It costs 95 tokens per session (2,054 once invoked), scanned A, original, MIT.

A Google Cloud tool that adds controls to limit API usage and alert you about project billing. Google Cloud Platform (GCP) is Google's service for running applications and using cloud APIs.

In plain words
What is it for?
Setting Gemini API quotas, configuring Cloud Billing budget alerts, disabling unused paid APIs, and identifying projects that may need a hard spend cap.
Why use it?
It reduces the risk of unexpected spending by applying safe controls and sending budget warnings. Actions that are not safe to apply automatically are flagged for review.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Setting Gemini API quotas, configuring Cloud Billing budget alerts, disabling unused paid APIs, and identifying projects that may need a hard spend cap.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shivamsriva31093/gcp-ironclad/gcp-spend-guardrails
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 shivamsriva31093/gcp-ironclad --skill gcp-spend-guardrails
Clone the repo
git clone --depth 1 https://github.com/shivamsriva31093/gcp-ironclad

Made for: Claude Code, Codex.

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-spend-guardrails

README.md
[![agentmods](https://agentmods.dev/badge/skills/shivamsriva31093/gcp-ironclad/gcp-spend-guardrails/github.svg)](https://agentmods.dev/skills/shivamsriva31093/gcp-ironclad/gcp-spend-guardrails)
Your own site
<a href="https://agentmods.dev/skills/shivamsriva31093/gcp-ironclad/gcp-spend-guardrails"><img src="https://agentmods.dev/badge/skills/shivamsriva31093/gcp-ironclad/gcp-spend-guardrails/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-spend-guardrails

Your own site · 80×15
<a href="https://agentmods.dev/skills/shivamsriva31093/gcp-ironclad/gcp-spend-guardrails"><img src="https://agentmods.dev/badge/skills/shivamsriva31093/gcp-ironclad/gcp-spend-guardrails.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 95 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,054 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. 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.00095 $0.02054
Opus 5 $0.00048 $0.01027
Sonnet 5 $0.00019 $0.00411
Haiku 4.5 $0.00010 $0.00205

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

Security

Grade A, and why

gcp-spend-guardrails scanned grade A with 1 finding 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 12d 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.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -X POST \
skills/gcp-spend-guardrails/SKILL.md · 128 lines

How it starts

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

GCP Spend Guardrails (APPLY)

Overview

Per project, applies three blast-radius controls — but only when each is genuinely safe per the safety matrix in docs/superpowers/specs/2026-05-24-gcp-api-key-ironclad-skill-design.md §6. Actions that fail the safety gate are demoted to "flag for review" and surfaced for the human, never auto-applied.

When to Use

  • Triggered by gcp-ironclad as Phase 3a, after the read-only audits.
  • Or invoked standalone when you want only the spend-control half of the suite.

Inputs

  • SESSION_DIR env var (must already contain audit.json and anomalies.json from prior phases when invoked by the driver).
  • DRY_RUN env var: if 1, plan all actions but apply none. Default 0.
  • QUOTA_FLOOR_PER_DAY env var: minimum daily request quota for Gemini API. Default 5000.
  • QUOTA_MULTIPLIER env var: peak-multiplier for quota sizing. Default 5.

Outputs

Writes ${SESSION_DIR}/guardrails-applied.json matching output.schema.json.

Safety matrix (excerpt)

Action Auto-apply ONLY when Demoted to "flag" when
Set Gemini API quota API enabled + ≥7d usage + proposed > peak No usage data; new project (<7d); export missing
Quota sizing max(peak_30d × 5, 5000/day) Peak shows abuse signature → use floor only
Create budget alerts caller is billing.admin + no existing budget at threshold viewer-only; budget already configured
Recommend spend-cap budget never auto-applied — console-only (no gcloud/API surface as of July 2026), and pausing a live service is a human call always flagged, never applied
Disable idle API zero 30-d usage + enabled >7d + not sys-* any usage in 30d; enabled <7d; system project

Execution

Action 1 — Quota on generativelanguage.googleapis.com

For each project where generativelanguage.googleapis.com is enabled:

  1. Read peak daily request count from the last 30 days via Monitoring API (same metric as the audit). If <7 days of data → skip with reason "insufficient_usage_data".
  2. Compute target = max(peak * QUOTA_MULTIPLIER, QUOTA_FLOOR_PER_DAY).
  3. Anti-abuse guard: if peak is itself a known abuse signature (e.g., the project appears in anomalies.json with multipleOver > 100), use QUOTA_FLOOR_PER_DAY instead of peak * QUOTA_MULTIPLIER.
  4. Compare against current quota; if equal → outcome "skipped" with reason "already_at_target".
  5. Otherwise (and not DRY_RUN), apply via:
    gcloud alpha services quota update \
      --consumer="projects/${P}" \
      --service="generativelanguage.googleapis.com" \
      --metric="generativelanguage.googleapis.com/generate_content_paid_requests" \
      --unit="1/d/{project}" \
      --override-value="${target}" \
      --force
    
    Rollback (record in details.rollback):
    gcloud alpha services quota update --consumer=projects/${P} --service=generativelanguage.googleapis.com --metric=... --unit=... --override-value=<previous>
    
  6. If gcloud alpha services quota update is unavailable (alpha-surface drift), fall back to the REST API:
    curl -X POST \
      -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
      -H "Content-Type: application/json" \
      "https://serviceusage.googleapis.com/v1beta1/projects/${P}/services/generativelanguage.googleapis.com/consumerQuotaMetrics/.../limits/.../consumerOverrides" \
      -d "{\"overrideValue\":\"${target}\"}"
    

Read the full file on GitHub · 128 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 12d ago First seen · 128 lines · 95 tokens per session scan A ac74973384c9

Subscribe to this mod's changes

gcp-spend-guardrails is a skill published in the GitHub repository shivamsriva31093/gcp-ironclad (24 stars, last pushed 1mo ago), licensed MIT. It adds 95 tokens to every session and 2,054 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

finops-expert

Expert-level cloud financial operations, cost optimization, and cloud economics. Use when the user mentions cloud cost, optimization, cloud economics, or AWS cost, or when the task involves FinOps Fundamentals, Cost Management, FinOps Practices, or Cost Visibility.

personamanagmentlayer/pcl · 55 tokens

gcp-expert

Expert-level Google Cloud Platform, services, and cloud architecture. Use when the user mentions Google Cloud, Cloud Functions, BigQuery, or Firestore.

personamanagmentlayer/pcl · 35 tokens

recipes

Use when a user states a FinOps outcome rather than a tool. Route to one recipe card, then hand off: bill jump → explain-period-change (DIGEST preview); marketplace → marketplace-spend; K8s namespace → namespace-cost; credits runway → provider-credits; GCP spend CUD leftover → gcp-spend-cud; BigQuery warehouse →…

costory-io/costory-finops-mcp-skills · 223 tokens

aegisops-ai

/aegisops-ai — Autonomous Governance Orchestrator workflow skill. Use this skill when the user needs Autonomous DevSecOps & FinOps Guardrails. Orchestrates Gemini 3 Flash to audit Linux Kernel patches, Terraform cost drifts, and K8s compliance and the operator should preserve the upstream workflow, copied support…

diegosouzapw/awesome-omni-skills · 81 tokens

google-agents-cli-deploy

This skill should be used when the user wants to "deploy an agent", "deploy my ADK agent", "set up CI/CD", "configure secrets", "troubleshoot a deployment", or needs guidance on Agent Runtime, Cloud Run, or GKE deployment targets, or binding an agent to an Agent Gateway. Covers deployment workflows, service accounts…

google/agents-cli · 153 tokens

infrastructure

A guide for cloud-native infrastructure: software and configuration used to run applications in containers and manage cloud resources. It covers Kubernetes, Helm, Kustomize, GitOps tools such as ArgoCD and Flux, and infrastructure-as-code tools such as Terraform and Pulumi.

fengshao1227/ccg-workflow · 65 tokens