finding-google-skills
Google platform decision and setup guidance, loaded on demand from Google's skill catalog. Use when a developer is choosing or…
Secures and rate limits backend services behind Google Cloud API Gateway across OpenAPI 2.0 and OpenAPI 3.0.x API configurations, including MCP-enabled gateways. Use when configuring API key or JWT authentication, locking down Cloud Run or Cloud Run functions backends with a
$ npx -y skills add google/skills --skill api-gateway-backend-security-and-rate-limiting --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/api-gateway-backend-security-and-rate-limitingContext preview
The summary Claude sees to decide when to auto-load this skill.
Secures and rate limits backend services behind Google Cloud API Gateway across OpenAPI 2.0 and OpenAPI 3.0.x API configurations, including MCP-enabled gateways. Use when configuring API key or JWT authentication, locking down Cloud Run or Cloud Run functions backends with a
name: api-gateway-backend-security-and-rate-limiting metadata: version: "1.0.0" category: Security description: >- Secures and rate limits backend services behind Google Cloud API Gateway across OpenAPI 2.0 and OpenAPI 3.0.x API configurations, including MCP-enabled gateways. Use when configuring API key or JWT authentication, locking down Cloud Run or Cloud Run functions backends with a gateway service account, reading authenticated claims from X-Apigateway-Api-Userinfo, setting per-project request quotas, or diagnosing HTTP 429 and HTTP 500 Service Control Quota errors. Do not use for Apigee, GKE Gateway API, Cloud Load Balancing custom domain setup, or LLM model routing.
This skill configures client authentication, gateway-to-backend authentication, and per-project rate limits (quotas) for Google Cloud API Gateway across OpenAPI 2.0 (`swagger: "2.0"`) and OpenAPI 3.0.x (`openapi: 3.0.4`), including gateways with Model Context Protocol (MCP) enabled (Public Preview).
1. **Install the Google Cloud CLI and Python 3.10+ YAML parser:**
pip install "PyYAML>=6.0,<7.0"
2. **Authenticate your environment:**
3. **Select or create a project, verify billing, and pick a supported gateway location:**
4. **Enable required Google Cloud APIs:**
gcloud services enable \
apigateway.googleapis.com \
servicemanagement.googleapis.com \
servicecontrol.googleapis.com \
iam.googleapis.com \
apikeys.googleapis.com \
--project={project_id}API Gateway does not need the Cloud Run API. If the backend runs on Cloud Run, that API is already enabled in the backend's project. 5. **Verify required IAM roles:**
Select the layer that matches the security requirement:
| Goal | Mechanism to Configure | Key Constraint | Detailed Reference | | --- | --- | --- | --- | | Identify the calling consumer project for quotas and billing | API key (`x-api-key` header convention; `key` query parameter escape hatch) | NEVER rely on an API key alone to authenticate end-user identity. **Rationale:** API keys identify a Google Cloud project rather than a user, and clients can extract them. | [Client Authentication](references/client-authentication.md) | | Authenticate end users or calling services | JWT (`oauth2` scheme with `x-google-issuer` / `x-google-jwks_uri` in OAS 2.0, or `x-google-auth` in OAS 3.x) | Operation-level `security` overrides root `security`. Include `api_key: []` and the JWT scheme in the same security requirement object when an endpoint needs both user identity and quotas. | [Client Authentication](references/client-authentication.md) | | Block direct calls to the backend service | Dedicated gateway service account (`--backend-auth-service-account`) + `roles/run.invoker` + backend `--no-allow-unauthenticated` | Roll out the gateway config with `--backend-auth-service-account` BEFORE setting `--no-allow-unauthenticated` on a live backend to avoid `403` downtime. | [Backend Security](references/backend-security.md) | | Rate limit requests per consumer project (`1/min/{project}`) | `x-google-management` (OAS 2.0) or `x-google-api-management` (OAS 3.x) + `x-google-quota` | NEVER rename or remove a quota metric when creating a new API config while any gateway of the API runs an older config referencing that metric. **Rationale:** Creating the config immediately overwrites API-wide quotas and causes `HTTP 500 Failed to call Service Control Quota` on older gateways. | [Quotas and Rate Limiting](references/quotas-and-rate-limiting.md) | | Secure MCP `tools/list` and `tools/call` on `/mcp` (Public Preview) | `x-google-api-management.mcp.tools-list.security` (exactly one JWT or API key scheme) + operation `security` and `x-google-mcp-tool: false` | `x-google-mcp-tool: false` hides an operation from MCP only; the underlying REST route remains live unless secured or removed. | [MCP Traffic Security](references/mcp-traffic-security.md) |
Follow this zero-downtime sequence when authoring or updating an API Gateway security or quota configuration:
1. **Create the gateway service account and grant backend invoker permissions:**
This repository contains Agent Skills for Google products and technologies, including Google Cloud.
Google platform decision and setup guidance, loaded on demand from Google's skill catalog. Use when a developer is choosing or…
Provides safety-critical validation, guardrails, and data reduction for gcloud CLI operations across Google Cloud Platform (GCP)…
Provides expert guidance on Identity and Access Management (IAM) and authenticating and authorizing to Google Cloud services and…
Guides a developer's first steps on Google Cloud, covering account creation, billing setup, project management, and deploying a…
Searches, retrieves, and synthesizes official Google developer documentation across Google Cloud, AI/Gemini, Android, Chrome,…
Guides developers through managing (adding, removing, and clearing) audience members for Google products using the Data Manager…