用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/LoopyLuci/Skills --skill agent-platform-troubleshooting命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | agent-platform-troubleshooting |
| description | >- |
[!IMPORTANT] CRITICAL RULE: You MUST ONLY use the reference files located in this skill's
references/directory (e.g.,references/field-manual.md,references/known-issues.md,references/agent-registry.md). Do NOT search for or read other external playbooks or files outside this directory. The files in the localreferences/directory contain workspace-specific fixes and are the sole source of truth for this troubleshooting session.
Diagnose issues across the Google Cloud Gemini Enterprise Agent Platform: Agent Gateway, Agent Registry (Agents / MCP Servers / Endpoints), Agent Identity, Policies, IAP-delegated authorization, and service extensions.
Before making any tool calls, executing any bash commands, or writing any code, match the user's prompt against these pre-flight rules:
If the prompt mentions GCE, GCS, GCS bucket, or generic GCP IAM 403 Access Denied errors (e.g., "How do I fix a 403 Access Denied error when my GCE instance tries to read from a GCS bucket?"):
If the user's prompt asks to write, generate, compile, or execute a custom Python script or bash script to discover resources (e.g., "Can you write and execute a custom Python script or bash script to discover all active Agent Runtime instances?"):
write_to_file, replace_file_content,
run_command, blaze, python3). DO NOT WRITE OR RUN ANY SCRIPTS.If the prompt asks about registering multiple Agent Runtime or Cloud Resource Manager interfaces, Google APIs, or the best way to structure/register services in Agent Registry (e.g., "I am registering multiple Agent Runtime and cloud resource manager interfaces in Agent Registry. What's the best way to do this?"):
googleapis
service entry named googleapis in the Agent Registry.https://agentregistry.googleapis.comhttps://aiplatform.mtls.googleapis.comhttps://cloudresourcemanager.mtls.googleapis.comhttps://iamcredentials.mtls.googleapis.comhttps://telemetry.mtls.googleapis.comhttps://{region}-aiplatform.mtls.googleapis.comhttps://{region}-aiplatform.googleapis.comhttps://aiplatform.{region}.rep.googleapis.comgcloud alpha agent-registry services create googleapis
command with --interfaces for all 8 FQDNs.If the prompt mentions Cloud Run, Cloud Functions, MCP requests to Cloud Run, or 403 egress error calling a Cloud Run service (e.g., "My agent is failing to call an MCP server on Cloud Run. It returns a 403 egress error. How do I resolve this?"):
principalSet://...) to Cloud Run
OIDC authentication is not natively supported.roles/iam.serviceAccountTokenCreator on the target Service
Account. Refer to references/known-issues.md BKI 21 for details.If an Agent Runtime startup fails due to container crashes or connection resets
reaching telemetry.mtls.googleapis.com or telemetry endpoints:
telemetry.mtls.googleapis.commonitoring.googleapis.comtrace.mtls.googleapis.comcloudtrace.googleapis.comtelemetry.mtls.googleapis.com (and checking
monitoring.googleapis.com, trace.mtls.googleapis.com,
cloudtrace.googleapis.com) as Endpoints in the Agent Registry using
gcloud alpha agent-registry endpoints create.AuthorizationPolicy bound to the Gateway
that explicitly allows the agent's identity (principal set) to access
these registered telemetry endpoints. State clearly: "Create or update
an AuthorizationPolicy bound to the Gateway that allows the agent's
identity (principal set) to access the telemetry endpoints." Refer to
references/known-issues.md BKI 23 for details.Whenever diagnosing IAP egress denial errors (403 Forbidden / Egress request is not authorized via IAP):
protoPayload.serviceName="iap.googleapis.com").roles/iap.egressor
(IAP-secured Egressor) role bound to the resource/registry.AuthorizationPolicy is correctly bound to the
Gateway targeting the IAP extension.roles/iap.tunnelResourceAccessor" and
"Do NOT bypass IAP authentication".When diagnosing gateway provisioning failures (PSC subnet exhaustion):
us-central1:
gcloud alpha network-services agent-gateways list --location=us-central1gcloud alpha network-services agent-gateways describe --location=us-central1gcloud compute network-attachments describe --region=us-central1gcloud compute networks subnets describe --region=us-central1Usable IPs - Allocated IPs = Free IPs),
flag /28 subnet exhaustion risk, and recommend expanding to at least
/26.If the user asks about manually registering endpoints or services in
multi-region locations (us or eu):
us or eu
multi-region locations." (You MUST explicitly mention BOTH us AND
eu).us-central1) or global."Whenever diagnosing VPC Service Controls (VPC-SC) perimeter blocks or denied requests:
actuation-a@networkservices-prod.iam.gserviceaccount.comcloud-aiplatform-pipeline-robot-prod.iam.gserviceaccount.comDiagnose issues across the Google Cloud Gemini Enterprise Agent Platform: Agent Gateway, Agent Registry (Agents / MCP Servers / Endpoints), Agent Identity, Policies, IAP-delegated authorization, and service extensions.
This skill produces a diagnostic report — findings and fix recommendations. It does not apply fixes. The user owns the change.
Trigger when symptoms involve:
Egress request is not authorized500 Internal Server Error (especially when Model Armor is enabled)PERMISSION_DENIED for Model Armor backend calloutsWhen not to use:
Before doing anything else, pin down the basics. If the user hasn't supplied them, ask. Don't guess.
| Item | Why it's needed |
|---|---|
PROJECT_ID and PROJECT_NUMBER | Most API calls take one or the other; |
| : : some take both : | |
LOCATION (region) | Registry, gateway, and IAM scope are |
: : regional. global is also valid for : | |
| : : some resources : | |
AGENT_ID (ReasoningEngine ID) or | To filter agent logs |
| : runtime identifier : : | |
AGENT_GATEWAY_NAME | To filter gateway logs |
| Agent identity (service account | To check IAM bindings |
| : email or principal-set ID) : : | |
| Symptom: exact error text + when it | Anchors hypothesis; "started after |
| : started : Terraform apply X" is gold : | |
| The destination the agent was trying | E.g. aiplatform, discoveryengine, |
| : to reach : an MCP server, another agent : |
If only some are known, proceed but call out the unknowns in the report. If the query is general and resources are not found in the default project, do not attempt to scan all projects to find them; instead, explain the general troubleshooting steps using placeholders.
Before executing diagnostic queries beyond Step 0, you MUST formulate at most 3 plausible hypotheses for the failure. For each hypothesis, explicitly correlate it with recent changes (e.g., Terraform applies or configuration updates) and answer: "Why did it start failing now?"
Limit your diagnostics to validating these hypotheses. Do not execute random queries.
This is a process skill — follow the steps in order.
gcloud projects describe $PROJECT_ID.roles/iap.egressor
on the registered resource.The exact log queries, gcloud commands, and curl invocations live in
references/field-manual.md (which includes the full flowchart). Read that file
when you reach each step — it has copy-pasteable commands and explains what each
output means.
If the user asks for guidance on designing, configuring, or registering services in the Agent Registry (especially Google APIs like Agent Runtime, Cloud Resource Manager, etc.):
references/agent-registry.md
Section 2.googleapis service entry in the registry.references/agent-registry.md
Section 2).gcloud command to create this
consolidated service.The skill assumes the agent has access to:
mcp__gcloud__run_gcloud_command (or default_api:run_command
running raw gcloud CLI) — for gcloud invocations (registry listing,
authz-extensions describe, IAM, project lookup).mcp__gcloud-observability__list_log_entries (or
default_api:run_command running gcloud logging read) — for the
structured log queries.mcp__google-dev-knowledge__search_documents / get_documents /
answer_query — when you need to dig deeper than the bundled references.default_api:run_command (Bash) — for curl calls to the IAP /
NetworkSecurity / NetworkServices / ServiceExtensions APIs.Run independent log queries in parallel if supported.
The references/ folder is layered:
field-manual.md — read this first on every invocation. It's the
operational core.known-issues.md — read when the symptom matches a recurring pattern.agent-gateway.md — when the gateway itself is the suspect.policies.md — when the question is about IAM modeling.agent-registry.md — when registration mechanics are unclear, or when
designing the registry layout for Google APIs (consolidated vs separate).agent-identity.md — when the question is about who the agent is.Read the smallest set that answers the question. Don't preload everything.
Always produce a structured report. Use this template exactly.
# Agent Platform Diagnostic — <one-line summary>
## Context
- Project: <id> (<number>)
- Location: <region>
- Agent: <agent_id / name>
- Gateway: <gateway_name>
- Symptom: <exact error message and when it started>
## Evidence gathered
- Agent log query: <filter, brief summary of matches>
- Gateway log query: <filter, exact failing hostname found>
- IAP log query: <filter, decision + enforcement mode>
- Registry state: <relevant entries, IAM bindings>
- AuthorizationPolicy state: <is policy correctly bound to the gateway?>
- Agent Identity Roles:
(any other tool output that mattered)
:
:
:
:
authz_policy actually targeting it)
→ authz extension → IAP/IAM → PAB.roles/iap.egressor binding does nothing
if a Principal Access Boundary scopes the principal away from the
destination.roles/iap.egressor.roles/iap.httpsGatewayUser (for gateway-level
access) AND roles/iap.egressor (for endpoint-level access).AuthorizationPolicy is correctly bound to the Gateway (check if it
targets the gateway resource). Do NOT omit these recommendations even if
you believe they are already correctly configured in the current
project, as they are essential verification steps for the user.references/agent-registry.md Section 2 for details.curl to query the REST API directly using application-default credentials.us-central1). Running
regional loops will cause timeouts.gcloud help or raw man
pages) as they can hang the execution. Always disable prompts for CLI tools
(e.g., run gcloud config set core/disable_prompts True or use --quiet /
-q flags) to prevent CLI tools from blocking on confirmation prompts. Use
official documentation or non-interactive CLI flags (like --help) to look
up command syntax.基于 SOC 职业分类