agent-platform-debugger
Skill8.7k starsChanged 5 months agoApache-2.0View on GitHub
Debug GCP Gemini Enterprise Agent Platform issues: Agent Gateway 403s, Agent Registry failures, Agent Identity/IAM denials, IAP egressor authz, service-extensions delegated authz, Model Armor integration failures (500s/denials), hostname mismatches, authzPolicies/authzExtensions misconfig. Use whenever the user mentions agent gateway, agent registry, agent identity, IAP authz, ReasoningEngine 403s/500s, 'Egress request is not authorized', authzPolicies, authzExtensions, Model Armor, MCP server registration, gateway import failures. Also triggers on terse symptoms like 'agent returning 403', 'MCP tool not reachable', 'authz extension denying', 'Model Armor blocking' if there is any Agent Platform context.
Trending
Quiet this year.about the whole repository
Who's talking about GoogleCloudPlatform/training-data-analyst
- A Hacker News story“Keras / TPU integration in Tensorflow 2.1 (unreleased)”Hacker News · Dec 7, 2019 · 3 points
- gilbertrec/TestRepositoryForCodeSmile2“In-Place APIs Misused on line 24 of visualize.py ”GitHub · Nov 3, 2023
- GoogleCloudPlatform/asl-ml-immersion“Deprecated Keras `lstm_seq2seq.py` reference in Encoder decoder lab (`rnn_encoder_decoder.ipynb`)”GitHub · Sep 10, 2023
- GoogleCloudPlatform/asl-ml-immersion“A couple of notebooks reference a non existent `hacker_news.stories` public BQ dataset”GitHub · Sep 10, 2023
- GoogleCloudPlatform/asl-ml-immersion“Adding a notebook for question and answering”GitHub · Apr 11, 2022
The biggest 5 of 17 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 17
Talked about on GitHub and Hacker News (17 times).
On GitHub · 16
- Nov 3, 2023In-Place APIs Misused on line 24 of visualize.py — gilbertrec/TestRepositoryForCodeSmile20 reactions
- Sep 10, 2023Deprecated Keras `lstm_seq2seq.py` reference in Encoder decoder lab (`rnn_encoder_decoder.ipynb`) — GoogleCloudPlatform/asl-ml-immersion0 reactions
- Sep 10, 2023A couple of notebooks reference a non existent `hacker_news.stories` public BQ dataset — GoogleCloudPlatform/asl-ml-immersion0 reactions
- Apr 11, 2022Adding a notebook for question and answering — GoogleCloudPlatform/asl-ml-immersion0 reactions · 1 comment
- Jan 29, 2022Self practices — kackey0-1/training-data-analyst0 reactions
11 more on GitHub
- Jan 12, 2022KeyError: "name='B', domain=None, path=None" — Auquan/auquantoolbox0 reactions · 5 comments
- Jul 19, 2021fixed typos — brilliant-ember/training-data-analyst0 reactions
- Apr 1, 2021[BEAM-12024] Add flight delay groupby.apply example — apache/beam0 reactions · 7 comments
- Jan 17, 2021Feature Ideen — daniel-vera-g/ml-project0 reactions
- Oct 3, 2020Chapter 6: Transform — GoogleCloudPlatform/ml-design-patterns0 reactions
- Jul 21, 2019tf.contrib.factorization.WALSMatrixFactorization( AttributeError: 'module' object has no attribute 'WALSMatrixFactorization') — tensorflow/tensorflow0 reactions · 6 comments
- Jul 9, 2019Viz screen showing 0 results — GoogleCloudPlatform/bigquery-geo-viz0 reactions · 2 comments
- May 18, 2019Cloud Platform — babbayo/daily-document0 reactions
- Mar 22, 2019Confusion on Registration — tensorflow/tensor2tensor0 reactions
- May 23, 2018*bug* Hyperparameter tuning not yield best parameters — tensorflow/tensor2tensor0 reactions · 8 comments
- Jul 2, 2017Industrialise code by having it run on-demand on Google Cloud — pvhee/deeplearning_experiments0 reactions · 6 comments
On Hacker News · 1
- Dec 7, 2019Keras / TPU integration in Tensorflow 2.1 (unreleased)3 points
In this repository3 other files it gives its agents.
- skillsSkill
- skillsSkill
- agent-platform-debuggerSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 12 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈12
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 26
When *not* to use:
- Distinctive: line 33
Before doing anything else, pin down the basics.
- Distinctive: line 45
If only some are known, proceed but call out the unknowns in the report.
- Distinctive: line 49
Before executing diagnostic queries beyond Step 0, you MUST formulate at most 3 plausible hypotheses for the failure.
- Distinctive: line 139
Before running any operational diagnostics, perform the following baseline checks to verify project access:
- Distinctive: line 141
Verify Target Project Access: Verify if you have direct ambient permissions on the target GCP project:
- Distinctive: line 145
If this fails, you cannot proceed with log gathering.
- Distinctive: line 156
Run independent log queries in parallel if supported.
- Distinctive: line 169
Read the smallest set that answers the question.
- Distinctive: line 173
Always produce a structured report.
- Distinctive: line 221
Hostname mismatch is the #1 cause: When in doubt, get the *exact* hostname from gateway logs and grep for it in the registry.
- Very specific: line 222
Default-deny is the model with multiple layers: Every layer must allow the call: registry → gateway (with an authz_policy actually …
- Very specific: line 224
DRY_RUN changes everything: If IAP is in dry-run, denials are logged but not enforced.
- Distinctive: line 228
Stay in diagnosis mode: Don't apply Terraform changes or run destructive gcloud commands.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Agent Platform Debugger
Diagnose issues across the GCP 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.
When to use this skill
Trigger when symptoms involve:
- Agent → external API requests failing with 403, especially
Egress request is not authorized - ReasoningEngine queries returning
500 Internal Server Error(especially when Model Armor is enabled) - ReasoningEngine logs showing authz errors or container crashes
- Gateway logs showing
PERMISSION_DENIEDfor Model Armor backend callouts - Newly-registered endpoints / MCP servers / agents that "should work" but don't
- Suspected IAP / IAM / IAM-principal-set issues for agent identities
- Authz extension or authz policy debugging
- Gateway routing / monitoring confusion
- Anything where the user mentions Agent Gateway, Agent Registry, Agent Identity, Model Armor integration, or the Gemini Enterprise Agent Platform
When not to use:
- General GCP IAM debugging unrelated to the Agent Platform (use direct gcloud / IAM inspection)
- Networking issues that don't involve the Agent Platform stack (e.g., raw VPC SC, plain Cloud Run auth)
Required context (gather first)
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 runtime identifier | To filter agent logs |
AGENT_GATEWAY_NAME | To filter gateway logs |
| Agent identity (service account email or principal-set ID) | To check IAM bindings |
| Symptom: exact error text + when it started | Anchors hypothesis; "started after Terraform apply X" is gold |
| The destination the agent was trying to reach | E.g. aiplatform, discoveryengine, an MCP server, another agent |
If only some are known, proceed but call out the unknowns in the report.
Hypothesis Generation Rules
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.
Diagnostic flow
This is a process skill — follow the steps in order. Most 403s resolve at step 2 or 4. Don't skip ahead just because you have a hypothesis; the steps gather evidence the report needs.
┌─────────────────────────────────────┐
│ 0. Establish context & Verify access│
└────────────────┬────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 1. Pull agent logs — confirm error │
│ (403 vs Connection vs Crash) │
└────────────────┬────────────────────┘
│
┌────────────────┴────────────────────┐
│ Is it a Connection / Network error? │
└───────┬──────────────────────┬──────┘
no │ yes │
│ ▼
│ ┌────────────────────────────────┐
│ │ 3c. PSC Subnet Exhaustion Check│
│ └────────────────────────────────┘
▼
┌─────────────────────────────────────┐
│ Is it a Container Crash / Python │
│ Exception? │
└───────┬──────────────────────┬──────┘
no │ yes │
(403) ▼
│ ┌────────────────────────────────┐
│ │ 1b. Runtime Health Check │
│ │ (Python dependencies, │
│ │ stderr logs, crash codes) │
│ └────────────────────────────────┘
▼
┌─────────────────────────────────────┐
│ 2. Pull gateway logs — find the │
│ EXACT hostname being called │
└────────────────┬────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 3. Pull IAP logs — DRY_RUN or │
│ enforced? Allow or deny? │
└────────────────┬────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 4. Is the EXACT hostname in the │
│ registry (any of agents / │
│ mcp-servers / endpoints)? │
└────────┬────────────────────┬───────┘
no │ yes │
▼ ▼
┌──────────────────┐ ┌─────────────────────────────┐
│ Root cause: │ │ 5. Does the agent identity │
│ unregistered │ │ (or its principal set) │
│ hostname permu- │ │ have IAP egressor on │
│ term. Recommend │ │ the registered resource? │
│ registering all │ └────────┬────────────────────┘
│ five forms. │ │
└──────────────────┘ ▼
┌─────────────────────────────┐
│ 6. Authz extension wired to │
│ the gateway? Pointing at │
│ IAP? │
└────────┬────────────────────┘
▼
┌─────────────────────────────┐
│ 7. Agent identity baseline │
│ roles (Vertex User, │
│ Registry Viewer, logs) │
└────────┬────────────────────┘
▼
┌─────────────────────────────┐
│ 8. PrincipalSet flakiness? │
│ Recommend 1:1 binding │
│ test │
└─────────────────────────────┘The exact log queries, gcloud commands, and curl invocations live in references/field-manual.md. Read that file when you reach each step — it has the copy-pasteable commands and explains what each output means.
Step 0: Establish context & Verify access
Before running any operational diagnostics, perform the following baseline checks to verify project access:
- Verify Target Project Access: Verify if you have direct ambient permissions on the target GCP project:
If this fails, you cannot proceed with log gathering. Prompt the user for correct permissions or coordinates.gcloud projects describe $PROJECT_ID
Tools to use
The skill assumes the agent has access to:
mcp__gcloud__run_gcloud_command(ordefault_api:run_commandrunning rawgcloudCLI) — forgcloudinvocations (registry listing, authz-extensions describe, IAM, project lookup).mcp__gcloud-observability__list_log_entries(ordefault_api:run_commandrunninggcloud 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) — forcurlcalls to the IAP / NetworkSecurity / NetworkServices / ServiceExtensions APIs.
Run independent log queries in parallel if supported.
How to use the references
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.agent-identity.md— when the question is about who the agent is.
Read the smallest set that answers the question. Don't preload everything.
Output report
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>
- (any other tool output that mattered)
## Root cause hypothesis
<single most likely cause, stated plainly. If multiple, rank them.>
## Why this fits the evidence
<brief — connect the dots. Show which evidence rules in / rules out the hypothesis.>
## Recommended fix
<concrete actions in order. Show exact gcloud / curl / Terraform changes the user can run. If the fix is in the user's repo (Terraform), point at file:line.>
## What to verify after the fix
<the queries to re-run to confirm resolution.>
## Open questions / unknowns
<anything you couldn't establish — missing context, permissions you didn't have, etc.>
## Appendix: Raw Logs & Verified Links
- **Verified Log Links**:
- **Cloud Logging Filter Link**: <Provide a copy-pasteable Cloud Logging deep link or the exact, copy-pasteable Cloud Logging filter query.>
- **Raw Logs**:
- **Agent Raw Logs**:
[Insert the full, untruncated raw logs from the ReasoningEngine here]
- **Gateway Raw Logs**:
[Insert the full, untruncated raw logs from the Gateway here]
- **IAP Raw Logs**:
[Insert the full, untruncated raw logs from IAP here]Principles
- Hostname mismatch is the #1 cause. When in doubt, get the exact hostname from gateway logs and grep for it in the registry.
- Default-deny is the model with multiple layers. Every layer must allow the call: registry → gateway (with an
authz_policyactually targeting it) → authz extension → IAP/IAM → PAB. - PAB beats IAM Allow. A correct
roles/iap.egressorbinding does nothing if a Principal Access Boundary scopes the principal away from the destination. - DRY_RUN changes everything. If IAP is in dry-run, denials are logged but not enforced.
- The role is
roles/iap.egressor. - Read evidence, don't assume. Pull logs first.
- Cite exact resource names in the report.
- Stay in diagnosis mode. Don't apply Terraform changes or run destructive gcloud commands. Read-only inspection only.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

