[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M698YYV8SM3EKCDTFF6J6QN9":3,"skill-same:01M698YYV8SM3EKCDTFF6J6QN9":110},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":8,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":18,"categories":19,"keywords":30,"publishedAt":51,"linkOnly":52,"markdownContent":53,"markdownBody":54,"frontMatter":55,"refName":59,"commitSha":60,"skillDirectory":61,"forksCount":62,"repositoryHtmlUrl":63,"repositoryHomepageUrl":17,"ownerHtmlUrl":64,"ownerBlogUrl":65,"ownerDescription":66,"updatedAt":67,"install":68,"resources":81},"01M698YYV8SM3EKCDTFF6J6QN9","api-gateway-backend-security-and-rate-limiting","API 网关安全与限流","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.","为 Google Cloud API Gateway 后面的后端服务提供安全防护与速率限制，涵盖 OpenAPI 2.0 和 OpenAPI 3.0.x API 配置，包括启用 MCP 的网关。在配置 API 密钥或 JWT 认证、使用网关服务账号加固 Cloud Run 或 Cloud Run functions 后端、从 X-Apigateway-Api-Userinfo 读取已认证的声明、设置每项目请求配额，或诊断 HTTP 429 和 HTTP 500 Service Control Quota 错误时使用。不用于 Apigee、GKE Gateway API、Cloud Load Balancing 自定义域名设置或 LLM 模型路由。","google\u002Fskills","google","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F1342004?v=4","01M698VYEFDM0VJBZDYYJ2T83S","Google","01M698WR0H76ENHE587T9EJT89",24235,"Apache-2.0",null,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fapi-gateway-backend-security-and-rate-limiting\u002FSKILL.md",[20,25],{"categoryNo":21,"categoryName":22,"taxonomyType":23,"taxonomyTypeDesc":24},"01M8BR4MYFKGCC4WCWVJ50KJ2C","安全工程师","PROFESSION","适用职业",{"categoryNo":26,"categoryName":27,"taxonomyType":28,"taxonomyTypeDesc":29},"01M8BS1P5QP54ZNEBFHBTV293T","API 网关配置与管理","SCENARIO","使用场景",[31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,10],"api gateway backend security and rate limiting","rate","security","api gateway","gateway","api","backend security","backend","rate limiting","model","when","errors","Custom Domain","project","across","backend services","MCP","x api","authentication","google cloud","2026-11-10 10:12:30",false,"---\nname: api-gateway-backend-security-and-rate-limiting\nmetadata:\n  version: \"1.0.1\"\n  category: Security\ndescription: >-\n  Secures and rate limits backend services behind Google Cloud API Gateway\n  across OpenAPI 2.0 and OpenAPI 3.0.x API configurations, including MCP-enabled\n  gateways. Use when configuring API key or JWT authentication, locking down\n  Cloud Run or Cloud Run functions backends with a gateway service account,\n  reading authenticated claims from X-Apigateway-Api-Userinfo, setting per-project\n  request quotas, or diagnosing HTTP 429 and HTTP 500 Service Control Quota\n  errors. Do not use for Apigee, GKE Gateway API, Cloud Load Balancing custom\n  domain setup, or LLM model routing.\n---\n\n# API Gateway Backend Security and Rate Limiting\n\nThis 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).\n\n## Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you\nMUST read [Usage Attribution](references\u002Fattribution.md). For commands executed\ndirectly in the terminal (never in generated scripts, Terraform, or user code),\nprefix `gcloud` with\n`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\u002F1.0 (skill:api-gateway-backend-security-and-rate-limiting)\"`\nand append `agent-skills\u002F1.0 (skill:api-gateway-backend-security-and-rate-limiting)` to `User-Agent` headers.\n\n## Prerequisites\n\n1. **Install the Google Cloud CLI and Python 3.10+ YAML parser:**\n   - Install or update the [Google Cloud SDK](https:\u002F\u002Fdocs.cloud.google.com\u002Fsdk\u002Fdocs\u002Finstall-sdk.md.txt).\n   - Install `PyYAML` for the quota metric validation script:\n     ```bash\n     pip install \"PyYAML>=6.0,\u003C7.0\"\n     ```\n2. **Authenticate your environment:**\n   - Local CLI session: `gcloud auth login`\n   - Application Default Credentials (SDKs): `gcloud auth application-default login`\n   - Service account key file (if required by CI): set `GOOGLE_APPLICATION_CREDENTIALS={key_file_path}`\n3. **Select or create a project, verify billing, and pick a supported gateway location:**\n   - Select an existing project (`gcloud config set project {project_id}`) or create one (`gcloud projects create {project_id}` as an escape hatch).\n   - Verify that an active billing account is linked to `{project_id}` (required even when staying within the [API Gateway pricing free tier](https:\u002F\u002Fcloud.google.com\u002Fapi-gateway\u002Fpricing)).\n   - Use `us-central1` as the default `--location` for API Gateway commands. For the other supported regions, see [API Gateway deployment model](https:\u002F\u002Fdocs.cloud.google.com\u002Fapi-gateway\u002Fdocs\u002Fdeployment-model.md.txt).\n4. **Enable required Google Cloud APIs:**\n   ```bash\n   gcloud services enable \\\n     apigateway.googleapis.com \\\n     servicemanagement.googleapis.com \\\n     servicecontrol.googleapis.com \\\n     iam.googleapis.com \\\n     apikeys.googleapis.com \\\n     --project={project_id}\n   ```\n   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.\n5. **Verify required IAM roles:**\n   - To manage API Gateway resources and enable services: `roles\u002Fapigateway.admin` and `roles\u002Fserviceusage.serviceUsageAdmin`\n   - To create the gateway service account and attach it to an API config: `roles\u002Fiam.serviceAccountAdmin` and `roles\u002Fiam.serviceAccountUser`\n   - To manage API keys in consumer projects: `roles\u002Fserviceusage.apiKeysAdmin`\n   - For the gateway service account to invoke the backend: `roles\u002Frun.invoker` (Cloud Run or 2nd gen functions) or `roles\u002Fcloudfunctions.invoker` (1st gen functions)\n\n## Decision Matrix: Client Authentication, Backend Security, and Quotas\n\nSelect the layer that matches the security requirement:\n\n| Goal | Mechanism to Configure | Key Constraint | Detailed Reference |\n| --- | --- | --- | --- |\n| 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\u002Fclient-authentication.md) |\n| Authenticate end users or calling services | JWT (`oauth2` scheme with `x-google-issuer` \u002F `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\u002Fclient-authentication.md) |\n| Block direct calls to the backend service | Dedicated gateway service account (`--backend-auth-service-account`) + `roles\u002Frun.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\u002Fbackend-security.md) |\n| Rate limit requests per consumer project (`1\u002Fmin\u002F{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\u002Fquotas-and-rate-limiting.md) |\n| Secure MCP `tools\u002Flist` and `tools\u002Fcall` on `\u002Fmcp` (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\u002Fmcp-traffic-security.md) |\n\n## Execution Workflow and Validation Loop\n\nFollow this zero-downtime sequence when authoring or updating an API Gateway security or quota configuration:\n\n1. **Create the gateway service account and grant backend invoker permissions:**\n   - Follow Steps 1–3 of [Backend Security](references\u002Fbackend-security.md) to create `{gateway_sa_name}` and request human approval before granting `roles\u002Frun.invoker` on `{backend_service}`.\n   - Update backend handler code to decode verified user claims from `X-Apigateway-Api-Userinfo` (`base64url`-encoded JSON) instead of `Authorization`.\n2. **Author the OpenAPI authentication and quota definitions:**\n   - Use the OpenAPI 2.0 or OpenAPI 3.0.x templates and provider tables in [Client Authentication](references\u002Fclient-authentication.md) and [Quotas and Rate Limiting](references\u002Fquotas-and-rate-limiting.md).\n   - If the specification enables MCP (`x-google-api-management.mcp`), configure exactly one JWT or API key scheme on `tools-list` (also list a JWT scheme in the root `security` list), and review operation opt-outs using [MCP Traffic Security](references\u002Fmcp-traffic-security.md).\n3. **Run the quota metric validation loop BEFORE running `api-configs create`:**\n   - If neither the active specs nor `{candidate_openapi_spec}` define quota metrics (`x-google-management.metrics` or `x-google-api-management.metrics`), skip this step.\n   - Request human approval before creating an API config that defines or modifies quotas, because `api-configs create` immediately replaces quota definitions across all gateways of the API.\n   - By default, run `scripts\u002Fcheck_quota_metrics.py` against all active gateways deployed for `{api_id}` in `{project_id}`:\n     ```bash\n     python3 scripts\u002Fcheck_quota_metrics.py \\\n       --spec={candidate_openapi_spec} \\\n       --project={project_id} \\\n       --api={api_id}\n     ```\n   - Escape hatch for offline environments without `gcloud` access (pass `--baseline-spec` for every config currently served by a gateway of the API):\n     ```bash\n     python3 scripts\u002Fcheck_quota_metrics.py \\\n       --spec={candidate_openapi_spec} \\\n       --baseline-spec={previous_openapi_spec} \\\n       --dry-run\n     ```\n   - If `scripts\u002Fcheck_quota_metrics.py` exits with code `1` (`status: \"FAIL\"`), add the missing metrics and limits back to `{candidate_openapi_spec}`, move each `x-google-quota` listed in `ignored_quota_extensions` into the operations it applies to, and re-run the script until it exits with code `0` (`status: \"PASS\"`). If the user wants to remove a limit on purpose, confirm the removal with the user, because it removes that limit from every gateway of the API. If `skipped_configs` is not empty, tell the user that the script did not inspect those API configs (for example, gRPC configs), and check their quota metrics and limits manually. If it exits with code `2`, fix the problem printed to stderr: the CLI arguments, `gcloud` authentication, or an API config that the script cannot inspect.\n4. **Create the API config, update the gateway, enable the managed service, and lock down the backend:**\n   - Follow Steps 4–5 of [Backend Security](references\u002Fbackend-security.md) to run `gcloud api-gateway api-configs create` and `gcloud api-gateway gateways update` (request human approval before updating a production gateway), enable the API's `managedService` in consumer projects ([Client Authentication](references\u002Fclient-authentication.md)), and then restrict `{backend_service}` with `--no-allow-unauthenticated`.\n   - Verify that direct calls to the backend `*.run.app` URL return `403`, unauthenticated calls to the gateway `defaultHostname` return `401`, and authenticated calls return `200`.\n\n## Pre-Deployment Checklist\n\n- [ ] Dedicated `{gateway_sa_name}` is granted `roles\u002Frun.invoker` (or `roles\u002Fcloudfunctions.invoker`), and `--no-allow-unauthenticated` is applied after the gateway config is active.\n- [ ] Backend code decodes `X-Apigateway-Api-Userinfo` for user claims.\n- [ ] Security enforcement does not depend solely on a load balancer or Google Cloud Armor in front of the gateway, because the gateway's `defaultHostname` (`*.gateway.dev`) cannot be disabled.\n- [ ] Every quota-enforced operation requires an API key (`api_key: []`), and the API's `managedService` is enabled and allowed on the API key in each consumer project.\n- [ ] `python3 scripts\u002Fcheck_quota_metrics.py` returns `status: \"PASS\"` (exit code `0`) against active gateway configs or all baseline specs before `api-configs create`.\n- [ ] If MCP is enabled, `x-google-api-management.mcp.tools-list.security` names exactly one JWT or API key scheme (a JWT scheme is also in the root `security` list), and administrative endpoints are secured on REST in addition to `x-google-mcp-tool: false`.\n\n## Resource Cleanup\n\nTo avoid ongoing charges when tearing down a test or staging environment, request human approval and delete the gateway, all API configs, the API, and the service account in dependency order:\n\n```bash\ngcloud api-gateway gateways delete {gateway_id} --location={region} --project={project_id}\ngcloud api-gateway api-configs delete {config_id} --api={api_id} --project={project_id}\ngcloud api-gateway apis delete {api_id} --project={project_id}\ngcloud iam service-accounts delete {gateway_sa_name}@{project_id}.iam.gserviceaccount.com --project={project_id}\n```\n","# API Gateway Backend Security and Rate Limiting\n\nThis 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).\n\n## Attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you\nMUST read [Usage Attribution](references\u002Fattribution.md). For commands executed\ndirectly in the terminal (never in generated scripts, Terraform, or user code),\nprefix `gcloud` with\n`CLOUDSDK_METRICS_REQUEST_ATTRIBUTION=\"agent-skills\u002F1.0 (skill:api-gateway-backend-security-and-rate-limiting)\"`\nand append `agent-skills\u002F1.0 (skill:api-gateway-backend-security-and-rate-limiting)` to `User-Agent` headers.\n\n## Prerequisites\n\n1. **Install the Google Cloud CLI and Python 3.10+ YAML parser:**\n   - Install or update the [Google Cloud SDK](https:\u002F\u002Fdocs.cloud.google.com\u002Fsdk\u002Fdocs\u002Finstall-sdk.md.txt).\n   - Install `PyYAML` for the quota metric validation script:\n     ```bash\n     pip install \"PyYAML>=6.0,\u003C7.0\"\n     ```\n2. **Authenticate your environment:**\n   - Local CLI session: `gcloud auth login`\n   - Application Default Credentials (SDKs): `gcloud auth application-default login`\n   - Service account key file (if required by CI): set `GOOGLE_APPLICATION_CREDENTIALS={key_file_path}`\n3. **Select or create a project, verify billing, and pick a supported gateway location:**\n   - Select an existing project (`gcloud config set project {project_id}`) or create one (`gcloud projects create {project_id}` as an escape hatch).\n   - Verify that an active billing account is linked to `{project_id}` (required even when staying within the [API Gateway pricing free tier](https:\u002F\u002Fcloud.google.com\u002Fapi-gateway\u002Fpricing)).\n   - Use `us-central1` as the default `--location` for API Gateway commands. For the other supported regions, see [API Gateway deployment model](https:\u002F\u002Fdocs.cloud.google.com\u002Fapi-gateway\u002Fdocs\u002Fdeployment-model.md.txt).\n4. **Enable required Google Cloud APIs:**\n   ```bash\n   gcloud services enable \\\n     apigateway.googleapis.com \\\n     servicemanagement.googleapis.com \\\n     servicecontrol.googleapis.com \\\n     iam.googleapis.com \\\n     apikeys.googleapis.com \\\n     --project={project_id}\n   ```\n   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.\n5. **Verify required IAM roles:**\n   - To manage API Gateway resources and enable services: `roles\u002Fapigateway.admin` and `roles\u002Fserviceusage.serviceUsageAdmin`\n   - To create the gateway service account and attach it to an API config: `roles\u002Fiam.serviceAccountAdmin` and `roles\u002Fiam.serviceAccountUser`\n   - To manage API keys in consumer projects: `roles\u002Fserviceusage.apiKeysAdmin`\n   - For the gateway service account to invoke the backend: `roles\u002Frun.invoker` (Cloud Run or 2nd gen functions) or `roles\u002Fcloudfunctions.invoker` (1st gen functions)\n\n## Decision Matrix: Client Authentication, Backend Security, and Quotas\n\nSelect the layer that matches the security requirement:\n\n| Goal | Mechanism to Configure | Key Constraint | Detailed Reference |\n| --- | --- | --- | --- |\n| 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\u002Fclient-authentication.md) |\n| Authenticate end users or calling services | JWT (`oauth2` scheme with `x-google-issuer` \u002F `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\u002Fclient-authentication.md) |\n| Block direct calls to the backend service | Dedicated gateway service account (`--backend-auth-service-account`) + `roles\u002Frun.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\u002Fbackend-security.md) |\n| Rate limit requests per consumer project (`1\u002Fmin\u002F{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\u002Fquotas-and-rate-limiting.md) |\n| Secure MCP `tools\u002Flist` and `tools\u002Fcall` on `\u002Fmcp` (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\u002Fmcp-traffic-security.md) |\n\n## Execution Workflow and Validation Loop\n\nFollow this zero-downtime sequence when authoring or updating an API Gateway security or quota configuration:\n\n1. **Create the gateway service account and grant backend invoker permissions:**\n   - Follow Steps 1–3 of [Backend Security](references\u002Fbackend-security.md) to create `{gateway_sa_name}` and request human approval before granting `roles\u002Frun.invoker` on `{backend_service}`.\n   - Update backend handler code to decode verified user claims from `X-Apigateway-Api-Userinfo` (`base64url`-encoded JSON) instead of `Authorization`.\n2. **Author the OpenAPI authentication and quota definitions:**\n   - Use the OpenAPI 2.0 or OpenAPI 3.0.x templates and provider tables in [Client Authentication](references\u002Fclient-authentication.md) and [Quotas and Rate Limiting](references\u002Fquotas-and-rate-limiting.md).\n   - If the specification enables MCP (`x-google-api-management.mcp`), configure exactly one JWT or API key scheme on `tools-list` (also list a JWT scheme in the root `security` list), and review operation opt-outs using [MCP Traffic Security](references\u002Fmcp-traffic-security.md).\n3. **Run the quota metric validation loop BEFORE running `api-configs create`:**\n   - If neither the active specs nor `{candidate_openapi_spec}` define quota metrics (`x-google-management.metrics` or `x-google-api-management.metrics`), skip this step.\n   - Request human approval before creating an API config that defines or modifies quotas, because `api-configs create` immediately replaces quota definitions across all gateways of the API.\n   - By default, run `scripts\u002Fcheck_quota_metrics.py` against all active gateways deployed for `{api_id}` in `{project_id}`:\n     ```bash\n     python3 scripts\u002Fcheck_quota_metrics.py \\\n       --spec={candidate_openapi_spec} \\\n       --project={project_id} \\\n       --api={api_id}\n     ```\n   - Escape hatch for offline environments without `gcloud` access (pass `--baseline-spec` for every config currently served by a gateway of the API):\n     ```bash\n     python3 scripts\u002Fcheck_quota_metrics.py \\\n       --spec={candidate_openapi_spec} \\\n       --baseline-spec={previous_openapi_spec} \\\n       --dry-run\n     ```\n   - If `scripts\u002Fcheck_quota_metrics.py` exits with code `1` (`status: \"FAIL\"`), add the missing metrics and limits back to `{candidate_openapi_spec}`, move each `x-google-quota` listed in `ignored_quota_extensions` into the operations it applies to, and re-run the script until it exits with code `0` (`status: \"PASS\"`). If the user wants to remove a limit on purpose, confirm the removal with the user, because it removes that limit from every gateway of the API. If `skipped_configs` is not empty, tell the user that the script did not inspect those API configs (for example, gRPC configs), and check their quota metrics and limits manually. If it exits with code `2`, fix the problem printed to stderr: the CLI arguments, `gcloud` authentication, or an API config that the script cannot inspect.\n4. **Create the API config, update the gateway, enable the managed service, and lock down the backend:**\n   - Follow Steps 4–5 of [Backend Security](references\u002Fbackend-security.md) to run `gcloud api-gateway api-configs create` and `gcloud api-gateway gateways update` (request human approval before updating a production gateway), enable the API's `managedService` in consumer projects ([Client Authentication](references\u002Fclient-authentication.md)), and then restrict `{backend_service}` with `--no-allow-unauthenticated`.\n   - Verify that direct calls to the backend `*.run.app` URL return `403`, unauthenticated calls to the gateway `defaultHostname` return `401`, and authenticated calls return `200`.\n\n## Pre-Deployment Checklist\n\n- [ ] Dedicated `{gateway_sa_name}` is granted `roles\u002Frun.invoker` (or `roles\u002Fcloudfunctions.invoker`), and `--no-allow-unauthenticated` is applied after the gateway config is active.\n- [ ] Backend code decodes `X-Apigateway-Api-Userinfo` for user claims.\n- [ ] Security enforcement does not depend solely on a load balancer or Google Cloud Armor in front of the gateway, because the gateway's `defaultHostname` (`*.gateway.dev`) cannot be disabled.\n- [ ] Every quota-enforced operation requires an API key (`api_key: []`), and the API's `managedService` is enabled and allowed on the API key in each consumer project.\n- [ ] `python3 scripts\u002Fcheck_quota_metrics.py` returns `status: \"PASS\"` (exit code `0`) against active gateway configs or all baseline specs before `api-configs create`.\n- [ ] If MCP is enabled, `x-google-api-management.mcp.tools-list.security` names exactly one JWT or API key scheme (a JWT scheme is also in the root `security` list), and administrative endpoints are secured on REST in addition to `x-google-mcp-tool: false`.\n\n## Resource Cleanup\n\nTo avoid ongoing charges when tearing down a test or staging environment, request human approval and delete the gateway, all API configs, the API, and the service account in dependency order:\n\n```bash\ngcloud api-gateway gateways delete {gateway_id} --location={region} --project={project_id}\ngcloud api-gateway api-configs delete {config_id} --api={api_id} --project={project_id}\ngcloud api-gateway apis delete {api_id} --project={project_id}\ngcloud iam service-accounts delete {gateway_sa_name}@{project_id}.iam.gserviceaccount.com --project={project_id}\n```\n",{"name":5,"metadata":56,"description":7},{"version":57,"category":58},"1.0.1","Security","main","bb9b3f464aae37af360d079c1d863524955b0363","skills\u002Fcloud\u002Fapi-gateway-backend-security-and-rate-limiting",2014,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills","https:\u002F\u002Fgithub.com\u002Fgoogle","https:\u002F\u002Fopensource.google\u002F","Google ❤️ Open Source","2026-11-14 23:31:00",{"source":9,"skillName":5,"commands":69,"prompt":79,"zipAvailable":80},[70,73,76],{"tool":71,"command":72},"npx","npx skills add google\u002Fskills --skill api-gateway-backend-security-and-rate-limiting",{"tool":74,"command":75},"bunx","bunx skills add google\u002Fskills --skill api-gateway-backend-security-and-rate-limiting",{"tool":77,"command":78},"pnpm","pnpm dlx skills add google\u002Fskills --skill api-gateway-backend-security-and-rate-limiting","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fapi-gateway-backend-security-and-rate-limiting\u002FSKILL.md",true,[82,88,92,96,100,104],{"path":83,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"references\u002Fattribution.md","REFERENCE","参考文档",1986,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fapi-gateway-backend-security-and-rate-limiting\u002Freferences\u002Fattribution.md",{"path":89,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":90,"sourceHtmlUrl":91},"references\u002Fbackend-security.md",8016,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fapi-gateway-backend-security-and-rate-limiting\u002Freferences\u002Fbackend-security.md",{"path":93,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":94,"sourceHtmlUrl":95},"references\u002Fclient-authentication.md",9267,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fapi-gateway-backend-security-and-rate-limiting\u002Freferences\u002Fclient-authentication.md",{"path":97,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":98,"sourceHtmlUrl":99},"references\u002Fmcp-traffic-security.md",9690,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fapi-gateway-backend-security-and-rate-limiting\u002Freferences\u002Fmcp-traffic-security.md",{"path":101,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":102,"sourceHtmlUrl":103},"references\u002Fquotas-and-rate-limiting.md",7704,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fapi-gateway-backend-security-and-rate-limiting\u002Freferences\u002Fquotas-and-rate-limiting.md",{"path":105,"resourceType":106,"resourceTypeDesc":107,"sizeBytes":108,"sourceHtmlUrl":109},"scripts\u002Fcheck_quota_metrics.py","SCRIPT","脚本",16093,"https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fapi-gateway-backend-security-and-rate-limiting\u002Fscripts\u002Fcheck_quota_metrics.py",[111,119,126,133,140,147],{"skillNo":112,"name":113,"nameZh":17,"description":114,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":118},"01M7DQ9K7JF4T7NJZ2K1MQZ44Q","cloud-operator-share-context","Shares Google Cloud operating context the user or their team already have — environments, projects, services and regions, product preferences, best practices, architecture guidance, runbooks — found in agent instruction files, local memory, skills and workflows, and the repository's GCP docs, with the operator agent's memory after the user reviews the list. Use when the user runs this skill, accepts the cloud-operator or cloud-operator-setup skill's offer to share their existing Google Cloud context, or asks to share, import or save that context or a GCP fact for the operator agent. Don't use for ordinary GCP requests, which go to the cloud-operator skill.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fcloud-operator-share-context\u002FSKILL.md",[],[],"2026-11-15 14:19:17",{"skillNo":120,"name":121,"nameZh":17,"description":122,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":123,"categories":124,"keywords":125,"publishedAt":118},"01M7DQ9ERFGGQCFAWQW0KRKYBY","cloud-operator-setup","Sets up the operator agent in a Google Cloud project via the autocloud MCP server: picks the operator project, creates or checks the user's operator agent, saves the project, and offers to share the user's existing Google Cloud operating context with the operator agent's memory. Use when the user runs this skill, asks to set up the operator or create their operator agent, or chooses setup when the cloud-operator skill asks. Don't use for ordinary GCP requests or installing gcloud.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fcloud-operator-setup\u002FSKILL.md",[],[],{"skillNo":127,"name":128,"nameZh":17,"description":129,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":130,"categories":131,"keywords":132,"publishedAt":118},"01M7B4RHQCM0DK2XQ7S7ZXVN8D","developer-device-platform-device-run","Runs automated, non-interactive jobs on remote Android devices with Developer Device Platform (DDP) Device Run using `gcloud beta device-run sessions`: native Android executables or shell scripts (for example CLI tools, custom runners, test harnesses or benchmarks) and Android instrumentation tests, on one or many devices, then waits for completion and collects per-device outputs and logs. Use when running a binary or test suite on remote devices without an interactive connection. Don't use it for interactive device reservations, adb tunnels or screen streaming (use developer-device-platform-basics), or for local devices.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fdeveloper-device-platform-device-run\u002FSKILL.md",[],[],{"skillNo":134,"name":135,"nameZh":17,"description":136,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":137,"categories":138,"keywords":139,"publishedAt":118},"01M7B4R9YXMRW7RZP9Q9FMZJ2P","compute-vm-creation","Guides the planning, configuration, and provisioning of standalone Google Compute Engine virtual machines (VMs) and bare metal (-metal) instances using gcloud CLI commands or direct MCP tool execution. Use ONLY when the user wants to create, configure, or provision a new standalone Compute Engine VM or bare metal instance from conversational intents (hardware sizing, region selection, OS image, networking, security defaults). DO NOT read or use for Google Kubernetes Engine (GKE) Autopilot or Standard clusters, Kubernetes node pools or Pods, container orchestration, managing existing VMs, Managed Instance Groups (MIGs), or Instance Templates.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fcompute-vm-creation\u002FSKILL.md",[],[],{"skillNo":141,"name":142,"nameZh":17,"description":143,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":144,"categories":145,"keywords":146,"publishedAt":118},"01M7B4QD02N0YBVT0838Z5K5VC","agent-platform-autorater-customization","Customizes an autorater (evaluation metric) for an AI agent so its grades match the user's own judgment, starting from the agent's real trajectories. Use when a user wants a metric tailored to their agent, wants to turn failing trajectories into rubrics, says an existing autorater grades their agent wrong, or wants an autorater to agree with human labels (autorater hillclimbing, judge calibration). Don't use for quick evals with built-in metrics or for improving the agent itself (use agent-platform-eval-flywheel).","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fagent-platform-autorater-customization\u002FSKILL.md",[],[],{"skillNo":148,"name":149,"nameZh":17,"description":150,"descriptionZh":17,"repositoryFullName":9,"ownerLogin":10,"ownerAvatarUrl":11,"ownerAccountNo":12,"ownerDisplayName":13,"repositoryNo":14,"starsCount":15,"licenseSpdxId":16,"licenseFileUrl":17,"sourceHtmlUrl":151,"categories":152,"keywords":153,"publishedAt":118},"01M78JP22K73KK96JH0JNDT5C4","iap-agent-platform-troubleshooting","Diagnoses Identity-Aware Proxy (IAP) denials of outbound requests from Gemini Enterprise Agent Platform agents that run on Agent Runtime and send traffic through Agent Gateway. Use when an agent request fails with \"Egress request is not authorized\", when Cloud Audit Logs show an IAP egressViaIAP decision with granted false, when IAP audit entries are missing while debugging agent egress, or when Access policies, IAP allow policies, policy bindings, or Agent Registry entries might block agent egress. Don't use for Gemini model IAM permission errors (such as aiplatform.endpoints.predict), Agent Platform API errors, or Agent Runtime deployment or 500 errors (use agent-platform-troubleshooting instead). Don't use for setting up, creating, or connecting an Agent Gateway, or for IAP web apps, IAP TCP forwarding, or SSH.","https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcloud\u002Fiap-agent-platform-troubleshooting\u002FSKILL.md",[],[]]