agentleFS
Google CloudKnown publisherGoogleCloudPlatform/training-data-analyst/self-paced-labs/agents/secure-agent-egress-gateway/.agents/skills/agent-platform-debugger/SKILL.md

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

Jan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 0 mentionsJul 2026: 0 mentionsAug 2026: 0 mentionsSep 2026: 0 mentionsOct 2026: 0 mentionsNov 2026: 0 mentionsDec 2026: 0 mentions
Jan 2026Jul 2026Dec 2026
Mentions a month of the GoogleCloudPlatform/training-data-analyst repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about GoogleCloudPlatform/training-data-analyst

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

11 more on GitHub

On Hacker News · 1

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
  1. Distinctive:

    When *not* to use:

    line 26
  2. Distinctive:

    Before doing anything else, pin down the basics.

    line 33
  3. Distinctive:

    If only some are known, proceed but call out the unknowns in the report.

    line 45
  4. Distinctive:

    Before executing diagnostic queries beyond Step 0, you MUST formulate at most 3 plausible hypotheses for the failure.

    line 49
  5. Distinctive:

    Before running any operational diagnostics, perform the following baseline checks to verify project access:

    line 139
  6. Distinctive:

    Verify Target Project Access: Verify if you have direct ambient permissions on the target GCP project:

    line 141
  7. Distinctive:

    If this fails, you cannot proceed with log gathering.

    line 145
  8. Distinctive:

    Run independent log queries in parallel if supported.

    line 156
  9. Distinctive:

    Read the smallest set that answers the question.

    line 169
  10. Distinctive:

    Always produce a structured report.

    line 173
  11. Distinctive:

    Hostname mismatch is the #1 cause: When in doubt, get the *exact* hostname from gateway logs and grep for it in the registry.

    line 221
  12. Very specific:

    Default-deny is the model with multiple layers: Every layer must allow the call: registry → gateway (with an authz_policy actually …

    line 222
  13. Very specific:

    DRY_RUN changes everything: If IAP is in dry-run, denials are logged but not enforced.

    line 224
  14. Distinctive:

    Stay in diagnosis mode: Don't apply Terraform changes or run destructive gcloud commands.

    line 228

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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_DENIED for 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.

ItemWhy it's needed
PROJECT_ID and PROJECT_NUMBERMost 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 identifierTo filter agent logs
AGENT_GATEWAY_NAMETo filter gateway logs
Agent identity (service account email or principal-set ID)To check IAM bindings
Symptom: exact error text + when it startedAnchors hypothesis; "started after Terraform apply X" is gold
The destination the agent was trying to reachE.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:

  1. Verify Target Project Access: Verify if you have direct ambient permissions on the target GCP project:
    gcloud projects describe $PROJECT_ID
    If this fails, you cannot proceed with log gathering. Prompt the user for correct permissions or coordinates.

Tools to use

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.

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_policy actually targeting it) → authz extension → IAP/IAM → PAB.
  • PAB beats IAM Allow. A correct roles/iap.egressor binding 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.