Agent Platform Architecture
GoogleOfficialPublished by Google
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- Low risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured framework for architecting and managing enterprise Gemini platform environments. It covers multi-project hierarchies, secure network connectivity via Agent Connectivity Templates (ACT), and advanced governance using Unified Access Policies (UAP) and Model Armor. It is designed for engineers building scalable, zero-trust agent platforms that require specific egress patterns, identity management, and cross-cloud integration.
What it does
- Designs multi-project hierarchies including Host, Governance Hub, and Runtime Spokes.
- Configures Agent Connectivity Templates for ALL_TRAFFIC or PRIVATE_RANGES_ONLY egress.
- Implements security guardrails using Model Armor and Unified Access Policies (UAP V2).
- Sets up identity and token exchange using SPIFFE and 3P IdP integration.
- Manages Day-2 lifecycle operations for agent runtimes and connectivity templates.
- Validates architecture through a structured 3-phase deployment and audit process.
When to use it
- When designing the network and security topology for a new enterprise Gemini platform.
- When configuring secure egress and ingress patterns for agent-to-service communication.
- When implementing cross-project governance and identity boundaries.
- When troubleshooting connectivity or policy enforcement issues in a Gemini platform stack.
Advantages
- Provides a standardized, repeatable approach to complex platform architecture.
- Ensures adherence to zero-trust principles and least-privilege IAM.
- Reduces configuration drift through clear, domain-specific reference manuals.
- Supports complex requirements like hybrid mTLS and cross-cloud egress hubs.
Usage examples
- “Design a multi-project hierarchy for a Gemini platform with a central governance hub and separate runtime spokes.”
- The agent will outline the project structure, VPC layout, and IAM bootstrap requirements for the requested hierarchy.
- “How do I configure an Agent Connectivity Template for ALL_TRAFFIC egress?”
- The agent will provide the specific YAML manifest and CLI commands to configure the ACT with the required egress mode.
Install
Download the skill as a ZIP:
https://autogineer.com/agent-skills/google/agent-platform-architecture/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip agent-platform-architecture.zip -d .agents/skills
Documentation by Google
Gemini platform Architecture and Engineering Guide
This skill is the reference system for designing, engineering, and validating enterprise-grade Gemini platform architectures across multi-project hierarchies, hybrid/cross-cloud networks, zero-trust identity boundaries, and inline safety/policy enforcement planes.
Usage Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read and follow the instructions in
Usage Attribution.
[!IMPORTANT] Architectural Scope and Reference Discipline: Use
SKILL.mdto select the target topology, egress mode, ingress pattern, and governance plane, then consult the authoritativereferences/*.mdmanual for exact CLI commands, REST/YAML schemas, Common Expression Language (CEL) expressions, and Python Agent Development Kit (ADK) runtime code (references/*.mdis the single source of truth for all implementation syntax). When remote Model Context Protocol (MCP) tools (such as the Google Developer Knowledge MCP server or Google-managed MCP endpoints) are available, prefer remote MCP tool invocation over raw CLI/REST commands. Do not execute unrequested live mutations against customer projects when asked for architectural designs.
[!CAUTION] Human Approval Gate for Sensitive Operations: Always prompt the user for explicit confirmation before executing commands or applying configurations that grant permissive Identity and Access Management (IAM) bindings (
roles/iap.egressor,roles/compute.networkUser,roles/networkservices.admin), modify Organization Policies (constraints/iam.managed.disableAccessPolicyBinding), update Unified Access Policy (UAP) or VPC Service Controls (VPC-SC) policies, or delete resources (RESTDELETE ...?force=trueor CLI--quiet).
Prerequisites, Authentication, Region, and Billing Setup
Google Cloud SDK, Authentication, and Project Setup:
Install the Google Cloud SDK (
gcloud) and authenticate CLI and Application Default Credentials (gcloud auth login && gcloud auth application-default login, or setGOOGLE_APPLICATION_CREDENTIALS).Select or create the target project (
gcloud projects create {project_id}/gcloud config set project {project_id}), set the default region (gcloud config set compute/region {region}, defaulting tous-central1; see Google Cloud Locations), and enable required APIs:gcloud services enable aiplatform.googleapis.com agentregistry.googleapis.com \ agentidentity.googleapis.com agentidentitycredentials.googleapis.com \ networkservices.googleapis.com networksecurity.googleapis.com iap.googleapis.com \ modelarmor.googleapis.com compute.googleapis.com dns.googleapis.com \ certificatemanager.googleapis.com servicenetworking.googleapis.com
Billing, Least-Privilege IAM, and Product Terminology:
Verify an active billing account is attached (
gcloud billing projects describe {project_id} --format="value(billingEnabled)") across{host_project_id},{gov_project_id},{runtime_project_id}, and{mcp_project_id}(required even when evaluating free-tier allowances; review Google Cloud Pricing).Grant explicit least-privilege IAM roles (
roles/aiplatform.user,roles/networkservices.admin,roles/compute.networkAdmin,roles/compute.networkUser,roles/iap.egressor, or a custom role withnetworkservices.agentGateways.get,networkservices.agentGateways.use,networkservices.operations.get) rather than primitiveroles/ownerorroles/editor.Use approved product names: Gemini platform, Agent Runtime (
reasoningEngines), Agent Gateway (240.0.0.2:443), Agent Connectivity Template (ACT), Agent Registry, and Unified Access Policy (UAP Policy V2) / Semantic Governance Policy (SGP).
3-Phase Architect Workflow and Decision Tree
graph TD
Start["Enterprise Gemini platform Architecture"] --> Q1{"1. Egress Destinations?"}
Q1 -->|"RFC 1918 + Google APIs Only"| Priv["ACT: vpcEgress = PRIVATE_RANGES_ONLY<br/>• Direct Private Google Access (PGA)"]
Q1 -->|"Public Internet, VPC-SC, or Non-RFC 1918 PUPI"| All["ACT: vpcEgress = ALL_TRAFFIC<br/>• 100% Egress via AGW VIP 240.0.0.2:443<br/>• Consolidate Core Google APIs FQDNs"]
All --> Q2{"2. Layer 7 URL List or Cross-Cloud mTLS?"}
Q2 -->|"No (Standard NAT)"| Nat["Direct Cloud NAT on PSC-I Subnet<br/>• ENDPOINT_TYPE_VM,ENDPOINT_TYPE_SWG"]
Q2 -->|"Yes (Next-Hop SWP)"| Swp["Next-Hop SWP (NEXT_HOP_ROUTING_MODE) + PBR<br/>• Internal and Google API DEFAULT_ROUTING bypasses<br/>• Default route via SWP ILB IP<br/>• Exclude PSC-I from manual Cloud NAT"]Phase 1 — Scope Verification and Architecture Discovery:
Scope Boundaries and Single-Region Discovery: Decline generic Google Cloud IAM/Compute/Storage debugging unrelated to the Gemini platform stack or requests to run broad multi-region live project scanning loops, pointing instead to
gcloud ai reasoning-engines list --region={region}.Architecture Design and Engineering: Identify the project hierarchy (
Host,Governance Hub,Runtime Spoke,Tool/MCP Spoke), egress mode (ALL_TRAFFICvsPRIVATE_RANGES_ONLY), policy plane (UAP V2, SGP, Model Armor), and target output format (topology specification,gcloudCLI commands, or REST/YAML manifests).
Phase 2 — Draft Architecture Plan and Resource Mapping:
Synthesize the topology diagram, project/VPC layout, IAM bootstrap matrix, and security controls using the Domain Router and Symptom Matrix, and map each manual's canonical REST/YAML schema and CLI commands into the target deployment artifacts.
Phase 3 — Post-Deployment and Audit Log Verification:
Pair every architecture design with the Post-Deployment and Cloud Audit Log Verification checklist (
references/topologies_and_project_layouts.md) and runtime query validation (references/agent_runtime_and_identity.md).
Domain Router and Symptom Matrix
Each reference manual in references/ is the single source of truth for its
domain's CLI commands, REST/YAML schemas, quotas, and CEL expressions. Always
read the corresponding reference manual before generating configurations or
answering domain-specific questions:
| Architecture Domain | Topics and Architectural Decisions Covered | Symptoms and Failure Modes Routed Here | Canonical Reference Manual |
|---|---|---|---|
| 1. Project Hierarchy, Shared VPC, VPC-SC, and Custom Routing | Multi-project separation (Host, Governance Hub, Runtime Spoke, Tool/MCP Spoke), PSC-I subnet sizing, cross-project Service Agent IAM bootstrap, VPC-SC perimeters, non-RFC 1918 PUPI/peered custom route exchange, and post-deployment Cloud Audit Log verification. | PSC-I IP exhaustion, cross-project attachment or addressGroup permission denials, VPC-SC perimeter blocks, dropped non-RFC 1918 internal routes, or post-deployment verification. | references/topologies_and_project_layouts.md |
| 2. Agent Connectivity Template (ACT) and Agent Gateway | Choosing ALL_TRAFFIC vs PRIVATE_RANGES_ONLY, ACT and Agent Gateway REST/YAML schemas, control-plane URI formatting, registry attachment limits, and container custom Root CA bundle trust. | Control-plane URI validation errors, registry attachment limit errors, or container TLS verification failures ([SSL: UNEXPECTED_EOF_WHILE_READING]). | references/agent_gateway_and_act.md |
| 3. Outbound Routing, Next-Hop SWP, PBR, and Hybrid mTLS | Source-range Policy-Based Routes (PBR) for PSC-I subnets, Next-Hop Secure Web Proxy (NEXT_HOP_ROUTING_MODE), swg-autogen-nat vs manual Cloud NAT coexistence, gRPC/A2A/WebSocket routing, Spanner SA impersonation, and Cross-Cloud mTLS Egress Hubs (Hybrid NEG). | Asymmetric return-routing drops between manual Cloud NAT and swg-autogen-nat, outbound URL filtering on PSC-I interfaces, or cross-cloud mTLS origination over Cloud Interconnect/VPN. | references/egress_routing_and_swp.md |
| 4. Ingress ALB, URL Rewrites, Private CA, and 3P IdP STS | Two-Tier and Single-Tier ALB ingress with URL Map hostRewrite/pathPrefixRewrite, Private CA TrustConfig with Regional Internal ALB + Serverless NEG for Cloud Run MCP servers, and 3P IdP (EntraID/Ping/Okta) token exchange via LbTrafficExtension (ext_proc + STS). | WebPKI root stripping (NO_ADDITIONAL_ROOTS), empty :authority drops on Serverless NEGs, *.run.app Google-managed certificate mismatches, or OAuth/IAP header collisions. | references/ingress_patterns_and_rewrites.md |
| 5. UAP Policy V2, IAP V1, SGP, and Model Armor Governance | Organization/Folder/Project UAP Policy V2 and IAP V1 CEL authorization rules, Semantic Governance Policy (SGP CONTENT_AUTHZ), custom AuthzExtension / AuthzPolicy targets, and fail-closed Model Armor Floor Settings, templates, and ADK callbacks. | Egress request is not authorized (HTTP 403 / status.code=7) on MCP initialize or tools/list, failed to parse the service URL on AuthzExtension, binary gRPC parser crashes, or fail-open safety bypasses. | references/governance_security_policies.md |
6. Agent Registry, Consolidated googleapis, and Federation | Consolidating core Google APIs FQDNs into a single googleapis service (ALL_TRAFFIC), registering MCP/A2A/REST services, extracting server-generated registryResource UUIDs for roles/iap.egressor, and Event-Driven Spoke-to-Hub Registry Federation. | ALL_TRAFFIC agent startup or telemetry blackholing, IAM binding target mismatches on Registry resources, OpenAPI/MCP spec size rejections, or multi-project catalog drift. | references/registry_and_federation.md |
| 7. ADK Runtime Packaging, Agent Identity, and Day-2 Operations | Packaging ADK agents with AGENT_IDENTITY (SPIFFE) and Auth Manager, regional residency, BigQuery pre-execution cost guards, in-place ACT updates, reverse-dependency teardown, and external Cloud NAT IP verification. | Raw credential exposure, HTTP 409 ABORTED control-plane mutex locks, HTTP 400 FAILED_PRECONDITION (FROM_AGENT_GATEWAY* or contains child resources: sessions), or X-Forwarded-For: 0.0.0.0 when probing *.run.app. | references/agent_runtime_and_identity.md |
Supporting Public Documentation Links
Files
- ATTRIBUTION.mdAdded by AutoGineer852 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md14.4 KiB
- references/agent_gateway_and_act.md14.7 KiB
- references/agent_runtime_and_identity.md27.8 KiB
- references/attribution.md1.9 KiB
- references/egress_routing_and_swp.md22.2 KiB
- references/governance_security_policies.md30.2 KiB
- references/ingress_patterns_and_rewrites.md25.5 KiB
- references/registry_and_federation.md19.6 KiB
- references/topologies_and_project_layouts.md31.6 KiB
references/topologies_and_project_layouts.md
Enterprise Topologies, Consumer Infrastructure, and IAM Bootstrap
This reference details production-proven resource hierarchies, consumer networking provisioning, Shared VPC attachment models, VPC Service Controls (VPC-SC) perimeters, custom/peered and non-RFC 1918 (PUPI) routing, and the complete Google-managed Service Agent and Agent Identity IAM bootstrap matrix for Gemini platform.
Table of Contents
1. The 4-Tier Enterprise Project Architecture: Lines 26-62
2. Consumer Infrastructure Provisioning and API Enablement: Lines 63-138
3. Cross-Project Agent Runtime and Agent Gateway Architecture: Lines 139-206
4. Shared VPC Network Attachment and DNS Peering Models: Lines 207-227
5. Complete Google-Managed Service Agent and Identity IAM Bootstrap Matrix: Lines 228-265
6. Architectural Constraints and Platform Invariants: Lines 266-282
7. VPC Service Controls (VPC-SC) Perimeter Design: Lines 283-387
8. Agent Runtime Multi-Tenancy, Management Boundary, and Regional Colocation: Lines 388-405
9. Custom, Peered, and Non-RFC 1918 (
PUPI) Enterprise Routing: Lines 406-44510. Post-Deployment Verification and Cloud Audit Log Validation: Lines 446-482
1. The 4-Tier Enterprise Project Architecture
Enterprise deployments separate concerns across four dedicated Google Cloud project tiers under an Organizational Management Folder:
graph TD
subgraph Management Folder [Enterprise Management Folder]
direction TB
HostProj["Shared VPC Host Project<br/>• Custom VPC & /26+ PSC-I Subnets<br/>• PSC-I Network Attachments & Cloud NAT"]
GovProj["AI Governance Hub Project (AGW_PROJECT_ID)<br/>• Central Agent Gateways & Agent Registry<br/>• UAP Policy V2, SGP, Model Armor & Auth Manager"]
RuntimeProj1["Agent Runtime Spoke Project (AE_PROJECT_ID)<br/>• Agent Runtime Workloads (ADK)"]
MCPProj["Tool & MCP Service Project (MCP_PROJECT_ID)<br/>• Cloud Run / GKE MCP, Internal ALBs & Cloud SQL"]
end
RuntimeProj1 -.->|Service Project| HostProj
GovProj -.->|Service Project| HostProj
MCPProj -.->|Service Project| HostProj
RuntimeProj1 -->|Cross-Project Gateway Binding| GovProj
GovProj -->|Central Egress Interception| MCPProjTier 1 — Shared VPC Host (
HOST_PROJECT_ID, Central NetOps): Custom VPC (10.10.0.0/16or enterprise PUPI supernet), PSC-I subnets (/26+), Proxy-Only Subnets, Cloud NAT, Private Cloud DNS.Tier 2 — Central Governance Hub (
AGW_PROJECT_ID, Central SecOps): Agent Gateways, Global/Regional Agent Registries, UAP Policy V2, Model Armor Floor Settings and Templates, SGP, Auth Manager.Tier 3 — Agent Runtime Spokes (
AE_PROJECT_ID, AI Engineering): Agent Runtime (reasoningEngines), ADK Agent artifacts, staging Cloud Storage buckets (10.30.0.0/16).Tier 4 — Tool and MCP Service Producers (
MCP_PROJECT_ID, API and Tool Teams): Cloud Run / GKE MCP servers, Regional Internal ALBs, Apigee X Private proxies, Spanner / BigQuery / Cloud SQL (10.40.0.0/16).
2. Consumer Infrastructure Provisioning and API Enablement
2.1 API Enablement Matrix
gcloud services enable \
compute.googleapis.com dns.googleapis.com networkservices.googleapis.com \
networksecurity.googleapis.com aiplatform.googleapis.com modelarmor.googleapis.com \
agentregistry.googleapis.com iap.googleapis.com cloudresourcemanager.googleapis.com \
iamcredentials.googleapis.com storage.googleapis.com networkconnectivity.googleapis.com \
cloudtrace.googleapis.com certificatemanager.googleapis.com \
--project="${PROJECT_ID}" --quiet2.2 Custom VPC, PSC-I Subnet (/26 Minimum), and Network Attachment
[!IMPORTANT] The
/26Subnet Sizing and Reserved CIDR Invariant: 1. Size the PSC-I subnet to at least/26(64 IPs) withpurpose = "PRIVATE"(neverPRIVATE_SERVICE_CONNECTorREGIONAL_MANAGED_PROXY) andprivate_ip_google_access = true. Legacy/28or/29sandbox subnets cause IP exhaustion and gateway provisioning failures. 2. Reserved Agent Gateway Ranges: Never allocate consumer VPC or PSC-I subnets overlapping10.0.0.0/24,10.0.1.0/24, or10.0.2.0/24(10.10.1.0/26or10.20.1.0/26is recommended).
gcloud compute networks create "${VPC_NAME}" --subnet-mode=custom --project="${PROJECT_ID}" --quiet
gcloud compute networks subnets create "${PSCI_SUBNET_NAME}" \
--network="${VPC_NAME}" --region="${REGION}" --range="${PSCI_SUBNET_RANGE}" \
--stack-type=IPV4_ONLY --enable-private-ip-google-access --project="${PROJECT_ID}" --quiet
gcloud compute network-attachments create "${ATTACHMENT_NAME}" \
--region="${REGION}" --subnets="${PSCI_SUBNET_NAME}" \
--connection-preference=ACCEPT_AUTOMATIC --project="${PROJECT_ID}" --quiet
gcloud compute firewall-rules create "${VPC_NAME}-allow-internal" \
--network="${VPC_NAME}" --allow=tcp:443,tcp:8080 --source-ranges="${PSCI_SUBNET_RANGE}" \
--project="${PROJECT_ID}" --quiet2.3 Deterministic Egress: Static IP, Cloud Router, and Cloud NAT
Mandatory Dual Endpoint Types (
ENDPOINT_TYPE_VM,ENDPOINT_TYPE_SWG): Always configure Cloud NAT with--endpoint-types=ENDPOINT_TYPE_VM,ENDPOINT_TYPE_SWG(the Agent Gateway control plane validates thatENDPOINT_TYPE_SWGis present on Cloud NAT even when Secure Web Proxy is not deployed).Direct Cloud NAT Subnet Scoping vs. Next-Hop SWP + PBR: Scope Direct Cloud NAT explicitly to the PSC-I subnet via
--nat-custom-subnet-ip-ranges="${PSCI_SUBNET_NAME}"so multi-subnet Shared VPCs do not indiscriminately SNAT other subnets (--nat-all-subnet-ip-rangesis only suitable in dedicated single-subnet VPCs). When using Next-Hop SWP + PBR, useLIST_OF_SUBNETWORKSand exclude the PSC-I subnet from manual Cloud NAT soswg-autogen-nathandles SNAT without conflict.
gcloud compute addresses create "${STATIC_IP_NAME}" --region="${REGION}" --project="${PROJECT_ID}" --quiet
gcloud compute routers create "${ROUTER_NAME}" --network="${VPC_NAME}" --region="${REGION}" --project="${PROJECT_ID}" --quiet
# Agent Gateway control plane validates that ENDPOINT_TYPE_SWG is present on the NAT even when SWP is not deployed
gcloud compute routers nats create "${NAT_NAME}" \
--router="${ROUTER_NAME}" --region="${REGION}" \
--nat-external-ip-pool="${STATIC_IP_NAME}" --nat-custom-subnet-ip-ranges="${PSCI_SUBNET_NAME}" \
--enable-logging --endpoint-types=ENDPOINT_TYPE_VM,ENDPOINT_TYPE_SWG \
--project="${PROJECT_ID}" --quiet2.4 Private Cloud DNS and Model Armor Template (us-central1)
gcloud dns managed-zones create "${DNS_ZONE_NAME}" \
--dns-name="${PEERING_DOMAIN}" --visibility=private --networks="${VPC_NAME}" --project="${PROJECT_ID}" --quiet
gcloud model-armor templates create "${MA_TEMPLATE_NAME}" --location="us-central1" \
--pi-and-jailbreak-filter-settings-enforcement=enabled --malicious-uri-filter-settings-enforcement=enabled --project="${PROJECT_ID}" --quiet3. Cross-Project Agent Runtime and Agent Gateway Architecture
3.1 Cross-Project Service Agent, Deploying Caller and AddressGroup IAM Requirements
Same-Region Colocation: Both the Spoke
ReasoningEngineand HubAgentGatewaymust reside in the exact same Google Cloud region and use numericuint64project numbers.Cross-Project Gateway Get/Use Permissions (
networkservices.agentGateways.get,networkservices.agentGateways.use): Both Spokeservice-${AE_PROJECT_NUMBER}@gcp-sa-aiplatform.iam.gserviceaccount.comand the deploying caller requirenetworkservices.agentGateways.get,networkservices.agentGateways.use, andnetworkservices.operations.getinAGW_PROJECT_ID(via a least-privilege custom IAM role orroles/networkservices.admin).ACT AddressGroup
roles/compute.networkUserBinding: After creating the ACT, grantroles/compute.networkUser(networksecurity.addressGroups.use,networksecurity.addressGroups.get,networksecurity.addressGroups.list) on the server-managedact-${TEMPLATE_ID}AddressGroup to Spokeservice-${AE_PROJECT_NUMBER}@gcp-sa-aiplatform-re.iam.gserviceaccount.com.Cross-Project Token Sharing Variable: Set
GOOGLE_API_PREVENT_AGENT_TOKEN_SHARING_FOR_GCP_SERVICES="False"indeploymentSpec.envwhen a SpokeReasoningEnginebinds to a dedicated central HubAgentGatewayacross projects (withAGENT_IDENTITYSPIFFE SVIDs and UAPprincipal://rules enforcing per-agent isolation at the Gateway); keep"True"if untrusted multi-tenant agents share a project withoutprincipal://UAP scoping.
gcloud compute network-attachments create "${ATTACHMENT_NAME}" --project="${AGW_PROJECT_ID}" \
--region="${REGION}" --connection-preference="ACCEPT_AUTOMATIC" \
--subnets="projects/${HOST_PROJECT_ID}/regions/${REGION}/subnetworks/${PSCI_SUBNET_NAME}"
gcloud iam roles create agw_cross_project_binder --project="${AGW_PROJECT_ID}" \
--title="Cross-Project Agent Gateway Binder" \
--permissions="networkservices.agentGateways.get,networkservices.agentGateways.use,networkservices.operations.get" --stage="GA"
for MEMBER in "serviceAccount:service-${AE_PROJECT_NUMBER}@gcp-sa-aiplatform.iam.gserviceaccount.com" "user:${DEPLOYER_EMAIL}"; do
gcloud projects add-iam-policy-binding "${AGW_PROJECT_ID}" --member="${MEMBER}" --role="projects/${AGW_PROJECT_ID}/roles/agw_cross_project_binder"
done
# Run AFTER creating the AgentConnectivityTemplate (which auto-provisions addressGroups/act-${TEMPLATE_ID})
ETAG=$(curl -s "https://networksecurity.googleapis.com/v1/projects/${AGW_PROJECT_ID}/locations/${REGION}/addressGroups/act-${TEMPLATE_ID}:getIamPolicy?options.requestedPolicyVersion=3" \
-H "Authorization: Bearer $(gcloud auth print-access-token)" | jq -r '.etag // empty')
curl -s -X POST "https://networksecurity.googleapis.com/v1/projects/${AGW_PROJECT_ID}/locations/${REGION}/addressGroups/act-${TEMPLATE_ID}:setIamPolicy" \
-H "Authorization: Bearer $(gcloud auth print-access-token)" -H "Content-Type: application/json" \
-d "{\"policy\":{\"version\":3,\"etag\":\"${ETAG}\",\"bindings\":[{\"role\":\"roles/compute.networkUser\",\"members\":[\"serviceAccount:service-${AE_PROJECT_NUMBER}@gcp-sa-aiplatform-re.iam.gserviceaccount.com\"]}]}}"
export AGENT_PRINCIPAL_SET="principalSet://agents.global.org-${ORG_ID}.system.id.goog/attribute.platformContainer/aiplatform/projects/${AE_PROJECT_NUMBER}"
export AGENT_PRINCIPAL="principal://agents.global.org-${ORG_ID}.system.id.goog/resources/aiplatform/projects/${AE_PROJECT_NUMBER}/locations/${REGION}/reasoningEngines/${RE_ID}"
gcloud projects add-iam-policy-binding "${AGW_PROJECT_ID}" --member="${AGENT_PRINCIPAL_SET}" --role="roles/agentregistry.viewer"
gcloud run services add-iam-policy-binding "${MCP_SERVICE}" --project="${MCP_PROJECT_ID}" --region="${REGION}" \
--member="${AGENT_PRINCIPAL}" --role="roles/run.invoker"Attach Tier-1 (--endpoint="${GOOGLEAPIS_UUID}") and Tier-2
(--mcp-server="${MCP_UUID}") roles/iap.egressor bindings using the
server-generated UUID commands in references/registry_and_federation.md
Section 2.4.
3.2 Cross-Project Agent Runtime Deployment (Python SDK)
Deploy the AgentEngine instance in AE_PROJECT_ID using the canonical
client.agent_engines.create(...) specification in
references/agent_runtime_and_identity.md Section 4.2, setting agent_gateway
to
f"projects/{AGW_PROJECT_NUMBER}/locations/{REGION}/agentGateways/{AGENT_GATEWAY_NAME}"
(numeric AGW_PROJECT_NUMBER), "identity_type": "AGENT_IDENTITY", and
"GOOGLE_API_PREVENT_AGENT_TOKEN_SHARING_FOR_GCP_SERVICES": "False".
4. Shared VPC Network Attachment and DNS Peering Models
Model 1 (Recommended — Network Attachment in Governance Project): The
/26+PSC-I subnet is defined inHOST_PROJECT_ID, and the Network Attachment is created inAGW_PROJECT_IDreferencing the host subnet.Model 2 (Network Attachment in Host Project): Both the PSC-I subnet and Network Attachment are created in
HOST_PROJECT_ID.Provisioning Identity (CI/CD) on Host Project: Grant
roles/compute.networkViewer,roles/dns.reader, androles/compute.networkUserto validate host networks, subnets, and private DNS zones and create the PSC-I attachment.Gateway and Network Google-Managed Service Agents (
gcp-sa-networkservices,gcp-sa-agentgateway,gcp-sa-dep) on Host Project: Grantroles/compute.networkUseron the PSC-I subnet androles/dns.peeron the Host Project so tenant proxy NICs attach and peer with private DNS zones (preventing gateway provisioning failures).
5. Complete Google-Managed Service Agent and Identity IAM Bootstrap Matrix
export PROJECT_NUMBER=$(gcloud projects describe "${PROJECT_ID}" --format="value(projectNumber)")
export ORG_ID=$(gcloud projects get-ancestors "${PROJECT_ID}" --format="value(id)" | tail -n 1)
export AGENT_PRINCIPAL_SET="principalSet://agents.global.org-${ORG_ID}.system.id.goog/attribute.platformContainer/aiplatform/projects/${PROJECT_NUMBER}"
# 5.1 Subnet NetworkUser & DNS Peer for NetworkServices, AgentGateway, and DEP Service Agents
for SA_SUFFIX in "gcp-sa-networkservices" "gcp-sa-agentgateway" "gcp-sa-dep"; do
SA="serviceAccount:service-${PROJECT_NUMBER}@${SA_SUFFIX}.iam.gserviceaccount.com"
gcloud compute networks subnets add-iam-policy-binding "${PSCI_SUBNET_NAME}" \
--region="${REGION}" --member="${SA}" --role="roles/compute.networkUser" --project="${HOST_PROJECT_ID:-$PROJECT_ID}" --quiet
gcloud projects add-iam-policy-binding "${HOST_PROJECT_ID:-$PROJECT_ID}" \
--member="${SA}" --role="roles/dns.peer" --condition=None --quiet
done
# 5.2 Model Armor Callout Grants for Service Extensions Service Agent (gcp-sa-dep)
DEP_SA="serviceAccount:service-${PROJECT_NUMBER}@gcp-sa-dep.iam.gserviceaccount.com"
for ROLE in "roles/modelarmor.user" "roles/modelarmor.calloutUser" "roles/serviceusage.serviceUsageConsumer"; do
gcloud projects add-iam-policy-binding "${PROJECT_ID}" --member="${DEP_SA}" --role="${ROLE}" --condition=None --quiet
done
# 5.3 Agent PrincipalSet Baseline Roles (scoped strictly to the Runtime Spoke project; roles/browser is required so the ADK SDK resolves project_number -> project_id on startup; also grant roles/agentregistry.viewer on AGW_PROJECT_ID in cross-project topologies)
for ROLE in "roles/browser" "roles/aiplatform.expressUser" "roles/serviceusage.serviceUsageConsumer" "roles/logging.logWriter" "roles/monitoring.metricWriter" "roles/agentregistry.viewer"; do
gcloud projects add-iam-policy-binding "${PROJECT_ID}" --member="${AGENT_PRINCIPAL_SET}" --role="${ROLE}" --condition=None --quiet
done
# 5.4 AI Platform & Reasoning Engine Service Agent Grants
gcloud projects add-iam-policy-binding "${PROJECT_ID}" \
--member="serviceAccount:service-${PROJECT_NUMBER}@gcp-sa-aiplatform.iam.gserviceaccount.com" \
--role="roles/networkservices.admin" --condition=None --quiet
for ROLE in "roles/aiplatform.reasoningEngineServiceAgent" "roles/aiplatform.user" "roles/logging.logWriter" "roles/monitoring.metricWriter" "roles/telemetry.tracesWriter"; do
gcloud projects add-iam-policy-binding "${PROJECT_ID}" --member="serviceAccount:service-${PROJECT_NUMBER}@gcp-sa-aiplatform-re.iam.gserviceaccount.com" --role="${ROLE}" --condition=None --quiet
done6. Architectural Constraints and Platform Invariants
Gateway and Registry Project Co-location: Agent Gateway and Agent Registry must reside in the exact same project (
AGW_PROJECT_ID).Folder-Level Governance Scoping via Principal Access Boundary (PAB): Because
attribute.platformContainer/aiplatform/folders/FOLDER_NUMBERis not an indexed attribute in IAM SPIFFEprincipalSet://evaluation, enforce folder-level isolation via Principal Access Boundary (PAB) policies attached to//cloudresourcemanager.googleapis.com/folders/${FOLDER_NUMBER}or folder-level UAP Policy V2 bindings.Private DNS Peering Rules: Suffixes must end with a trailing dot (
internal.example.com.,example.com.). Never use root wildcard (.) orgoogleapis.com..
7. VPC Service Controls (VPC-SC) Perimeter Design
7.1 Single-Project vs. Multi-Project VPC-SC Perimeter Behavior (ALL_TRAFFIC Native Support)
Single-Project Deployments (Native VPC-SC Support): Single-project Gemini platform deployments work natively inside a VPC-SC perimeter out of the box—requiring zero custom cross-project VPC-SC ingress rules—when the Agent Connectivity Template (ACT) sets
vpcEgress: ALL_TRAFFICand the Agent Registry registers the consolidatedgoogleapisservice (routing 100% of control/data-plane and Google API traffic through the governed240.0.0.2:443VIP inside the perimeter). By contrast, multi-project Hub-and-Spoke deployments (HOST,GOV,AGENT,MCP) require the explicit cross-project VPC-SC ingress rules in Section 7.2.Perimeter
restricted_servicesCatalog: Includeaiplatform.googleapis.com,networkservices.googleapis.com,networksecurity.googleapis.com,agentregistry.googleapis.com,agentidentity.googleapis.com,agentidentitycredentials.googleapis.com,iamcredentials.googleapis.com,modelarmor.googleapis.com,iap.googleapis.com,compute.googleapis.com,dns.googleapis.com,run.googleapis.com,sqladmin.googleapis.com,spanner.googleapis.com,secretmanager.googleapis.com,bigquery.googleapis.com, andstorage.googleapis.cominrestricted_services.In-Perimeter BigQuery Cost and Query Governance: For agents querying BigQuery inside the perimeter, enforce a pre-execution
QueryJobConfig(dry_run=True)byte-scan check verifyingstatement_type == "SELECT"andmaximum_bytes_billedwith caller attribution labels (references/agent_runtime_and_identity.mdSection 7.2).
7.2 Multi-Project / Cross-Perimeter VPC-SC Ingress Reference Categories
When enclosing multi-project tiers (HOST_PROJECT_NUMBER, GOV_PROJECT_NUMBER,
AGENT_PROJECT_NUMBER, and MCP_PROJECT_NUMBER Tool Spoke — or a collapsed
Hub + Spoke layout) across strict or segmented VPC-SC perimeters, configure
ingress rules covering these principal categories:
Category 1 — Operator Access Level (
accessLevels/enterprise_admin_access): Targetcompute,networkservices,networksecurity,aiplatform,agentregistry,iap,modelarmor,run,sqladmin,spanner,storageacrossHOST,GOV,AGENT, andMCPprojects for scoped CI/CD and operator administration.Category 2 —
serviceAccount:service-${GOV_PROJECT_NUMBER}@gcp-sa-agentgateway.iam.gserviceaccount.com: Targetcompute,dns,networkservices,agentregistry,runonHOST,GOV, andMCPprojects to attach PSC-I NICs, peer DNS, and reach Tool Spoke services.Category 3 —
serviceAccount:service-${GOV_PROJECT_NUMBER}@gcp-sa-networkservices.iam.gserviceaccount.com: Targetcompute,dns,networksecurityonHOSTandGOVprojects to manageact-*address groups and attachments.Category 4 —
serviceAccount:service-${AGENT_PROJECT_NUMBER}@gcp-sa-aiplatform.iam.gserviceaccount.com: Targetnetworkservices,aiplatform,storageonGOVandAGENTprojects to validate cross-projectagentGateways.get.Category 5 —
serviceAccount:service-${AGENT_PROJECT_NUMBER}@gcp-sa-aiplatform-re.iam.gserviceaccount.com: Targetnetworksecurity,aiplatform,agentregistry,iap,storage,runonGOV,AGENT, andMCPprojects to readact-${TEMPLATE_ID}addressGroup (roles/compute.networkUser), staging buckets, and Tool Spoke services.Category 6 —
principal://agents.global.org-${ORG_ID}.system.id.goog/resources/aiplatform/projects/${AGENT_PROJECT_NUMBER}/locations/${REGION}/reasoningEngines/${ENGINE_ID}(orprincipalSet://...plus the impersonated data-plane SAserviceAccount:${DATA_PLANE_SA_EMAIL}): Targetaiplatform,agentregistry,iap,agentidentity,agentidentitycredentials,iamcredentials,run,sqladmin,spanner,secretmanager,bigquery,cloudtrace,logging,monitoringacrossGOV,AGENT, andMCP(MCP_PROJECT_NUMBER) projects for attestedAGENT_IDENTITYSPIFFE calls and SA-impersonated Spanner/Cloud Run calls.Category 7 —
serviceAccount:service-${GOV_PROJECT_NUMBER}@gcp-sa-dep.iam.gserviceaccount.com: Targetmodelarmor.googleapis.comandserviceusage.googleapis.comonGOVproject for inline Service Extensions (ext_proc) Model ArmorSanitizeUserPrompt/SanitizeModelResponsecallouts.
# Excerpt: Cross-Project Service Agents, SPIFFE Workload & Model Armor VPC-SC Ingress Rules
- ingressFrom:
identities:
- "serviceAccount:service-${GOV_PROJECT_NUMBER}@gcp-sa-agentgateway.iam.gserviceaccount.com"
- "serviceAccount:service-${GOV_PROJECT_NUMBER}@gcp-sa-networkservices.iam.gserviceaccount.com"
ingressTo:
operations:
- {serviceName: compute.googleapis.com, methodSelectors: [{method: "*"}]}
- {serviceName: dns.googleapis.com, methodSelectors: [{method: "*"}]}
- {serviceName: networkservices.googleapis.com, methodSelectors: [{method: "*"}]}
- {serviceName: networksecurity.googleapis.com, methodSelectors: [{method: "*"}]}
resources: ["projects/${GOV_PROJECT_NUMBER}", "projects/${HOST_PROJECT_NUMBER}"]
- ingressFrom:
identities:
- "serviceAccount:service-${AGENT_PROJECT_NUMBER}@gcp-sa-aiplatform.iam.gserviceaccount.com"
- "serviceAccount:service-${AGENT_PROJECT_NUMBER}@gcp-sa-aiplatform-re.iam.gserviceaccount.com"
ingressTo:
operations:
- {serviceName: networkservices.googleapis.com, methodSelectors: [{method: "*"}]}
- {serviceName: networksecurity.googleapis.com, methodSelectors: [{method: "*"}]}
- {serviceName: agentregistry.googleapis.com, methodSelectors: [{method: "*"}]}
- {serviceName: iap.googleapis.com, methodSelectors: [{method: "*"}]}
- {serviceName: storage.googleapis.com, methodSelectors: [{method: "*"}]}
resources: ["projects/${AGENT_PROJECT_NUMBER}", "projects/${GOV_PROJECT_NUMBER}"]
- ingressFrom:
identities:
- "principal://agents.global.org-${ORG_ID}.system.id.goog/resources/aiplatform/projects/${AGENT_PROJECT_NUMBER}/locations/${REGION}/reasoningEngines/${ENGINE_ID}"
ingressTo:
operations:
- {serviceName: iamcredentials.googleapis.com, methodSelectors: [{method: "*"}]}
- {serviceName: run.googleapis.com, methodSelectors: [{method: "*"}]}
resources: ["projects/${GOV_PROJECT_NUMBER}", "projects/${AGENT_PROJECT_NUMBER}", "projects/${MCP_PROJECT_NUMBER}"]
- ingressFrom:
identities: ["serviceAccount:${DATA_PLANE_SA_EMAIL}"]
ingressTo:
operations:
- {serviceName: spanner.googleapis.com, methodSelectors: [{method: "*"}]}
- {serviceName: sqladmin.googleapis.com, methodSelectors: [{method: "*"}]}
resources: ["projects/${GOV_PROJECT_NUMBER}", "projects/${MCP_PROJECT_NUMBER}"]
- ingressFrom:
identities: ["serviceAccount:service-${GOV_PROJECT_NUMBER}@gcp-sa-dep.iam.gserviceaccount.com"]
ingressTo:
operations:
- {serviceName: modelarmor.googleapis.com, methodSelectors: [{method: "*"}]}
- {serviceName: serviceusage.googleapis.com, methodSelectors: [{method: "*"}]}
resources: ["projects/${GOV_PROJECT_NUMBER}"]8. Agent Runtime Multi-Tenancy, Management Boundary, and Regional Colocation
One Bonded Agent Gateway Per Consumer Project / Region: Agent Runtime provisions one shared tenant project (
*-tp) per consumer project/region. Reuse the same Agent Gateway acrossReasoningEngineinstances in that project/region, or separate workloads into distinct spoke projects.App Management Folder Capability and Boundary Configuration: To enable cross-project Agent Registry discovery across an enterprise management folder or spoke project boundary, enable the
app-managementfolder capability and attach the App Hub boundary:
gcloud resource-manager capabilities update "folders/${ENTERPRISE_FOLDER_ID}/capabilities/app-management" --enable
gcloud apphub boundary update --project="${AGW_PROJECT_ID}" --location=global --crm-node="projects/${AE_PROJECT_ID}"9. Custom, Peered, and Non-RFC 1918 (PUPI) Enterprise Routing
Enterprises routing across peered VPCs, Cloud Interconnect/VPN, or Privately
Used Public IP (PUPI) blocks outside RFC 1918 (such as 198.51.100.0/24) must
align ACT egress mode, VPC peering route exchange, and PBR priorities:
Why
PRIVATE_RANGES_ONLYDrops Non-RFC 1918 Internal Space:PRIVATE_RANGES_ONLYonly routes strict RFC 1918 (10.0.0.0/8,172.16.0.0/12,192.168.0.0/16) and CGNAT (100.64.0.0/10) to the consumer VPC, treating non-RFC 1918 internal/PUPI space as external public IP space. Always setvpcEgress = ALL_TRAFFICon the ACT with Private DNS peering (dnsPeeringConfigending with a trailing dot, such asinternal.example.com.), and configure the PSC-I subnet with--stack-type=IPV4_ONLY(protocolVersion = "IPV4") so IPv6 traffic cannot bypass PBR or SWP rules (never allow default Cloud NAT to SNAT internal PUPI traffic to the public internet).Multi-VPC Custom Route Peering and PBR Bypass Commands:
export GOV_PROJECT_ID="gov-hub-proj" HOST_VPC="enterprise-shared-vpc" GOV_VPC="${HOST_VPC}"
export SPOKE_PROJECT_ID="mcp-spoke-proj" SPOKE_VPC="spoke-pupi-vpc"
export PSCI_SUBNET_CIDR="10.20.1.0/26" CUSTOM_INTERNAL_CIDR="198.51.100.0/24"
# 1. Create bilateral VPC Peerings with custom route & public-IP (PUPI) subnet route export/import enabled
gcloud compute networks peerings create "peering-gov-to-spoke" --project="${GOV_PROJECT_ID}" \
--network="${GOV_VPC}" --peer-project="${SPOKE_PROJECT_ID}" --peer-network="${SPOKE_VPC}" \
--export-custom-routes --import-custom-routes --export-subnet-routes-with-public-ip --import-subnet-routes-with-public-ip
gcloud compute networks peerings create "peering-spoke-to-gov" --project="${SPOKE_PROJECT_ID}" \
--network="${SPOKE_VPC}" --peer-project="${GOV_PROJECT_ID}" --peer-network="${GOV_VPC}" \
--export-custom-routes --import-custom-routes --export-subnet-routes-with-public-ip --import-subnet-routes-with-public-ip
# 2. Bypass Next-Hop SWP for custom/peered/PUPI internal destinations (pair with priority 50 for RFC 1918)
gcloud network-connectivity policy-based-routes create "pbr-bypass-custom-internal" \
--project="${GOV_PROJECT_ID}" --network="projects/${GOV_PROJECT_ID}/global/networks/${GOV_VPC}" \
--source-range="${PSCI_SUBNET_CIDR}" --destination-range="${CUSTOM_INTERNAL_CIDR}" \
--ip-protocol=ALL --next-hop-other-routes=DEFAULT_ROUTING --priority=5110. Post-Deployment Verification and Cloud Audit Log Validation
Validate production deployments across three phases—combining control-plane resource inspection, data-plane connectivity probes, and Cloud Audit Log verification:
Phase 1 — Control-Plane Configuration Audit (
gcloud ... describe --format=json):Agent Gateway and Consolidated
googleapisRegistry Readiness: Confirm the Agent Gateway state isACTIVE(state == "ACTIVE", with<= 2numeric registries attached) and that the consolidatedgoogleapisservice (8Google APIs FQDNs) is registered in Agent Registry (gcloud agent-registry services describe googleapis --location=${REGION}).PSC-I Network Attachment and Cloud NAT Readiness: Confirm the PSC-I subnet is
/26+PRIVATE(IPV4_ONLY,privateIpGoogleAccess == true), the Network Attachment has anACCEPTEDendpoint (connectionPreference == "ACCEPT_AUTOMATIC"),act-${TEMPLATE_ID}grantsroles/compute.networkUser, Cloud NAT setsENDPOINT_TYPE_VM,ENDPOINT_TYPE_SWG, VPC peerings export/import custom and public-IP subnet routes (when applicable), and PBRpriority: 50..53bypasses precedepriority: 100.Policy and Guardrail Readiness: Confirm ACT sets
vpcEgress == "ALL_TRAFFIC",roles/iap.egressoris bound to theregistryResourceUUID, IAPAuthzExtensionsetsfailOpen == falseandiapPolicyVersion == "V2"(<= 4CUSTOMAuthzPolicyresources attached), and Model Armor Floor Settings and Templates enforce fail-closed inspection.
Phase 2 — Functional Data-Plane Traffic Verification: Execute
:queryand:streamQueryprobes (references/agent_runtime_and_identity.md§5) to confirm that the agent container connects to the local Agent Gateway VIP (240.0.0.2withAgent Gateway TLS Inspection CA) and that downstream backends observe requests arriving from the consumer PSC-I subnet CIDR (or static Cloud NAT IP for external endpoints such ashttps://api.ipify.org; never use an internal*.run.appendpoint to verify Cloud NAT IPs because Google Cloud routes*.run.appinternally to the Cloud Run ingress proxy withX-Forwarded-For: 0.0.0.0, bypassing Cloud NAT — seereferences/agent_runtime_and_identity.mdSection 11.1).Phase 3 — Security Policy and Audit Log Validation: Trigger negative security probes (unregistered external LLM domain
https://api.openai.com, unauthorized mutating MCP tool, plaintexthttp://:80, and prompt injection payloads) and verify server-side Cloud Audit Log deny receipts (protoPayload.status.code=7):
# Phase 1: Verify ACTIVE Agent Gateway state, ACCEPTED PSC-I Network Attachment endpoint & consolidated googleapis Registry service
gcloud network-services agent-gateways describe "${GATEWAY_ID}" --location="${REGION}" --project="${GOV_PROJECT_ID}" --format="value(state)"
gcloud compute network-attachments describe "${ATTACHMENT_NAME}" --region="${REGION}" --project="${HOST_PROJECT_ID}" --format="json(connectionEndpoints)"
gcloud agent-registry services describe "googleapis" --location="${REGION}" --project="${GOV_PROJECT_ID}"
# Phase 3: Verify server-side Cloud Audit Log deny receipts (protoPayload.status.code=7) for negative security probes
gcloud logging read \
'(resource.type="audited_resource" OR resource.type="agent_gateway") AND (resource.labels.service="iap.googleapis.com" OR resource.labels.service="modelarmor.googleapis.com") AND protoPayload.status.code=7' \
--project="${GOV_PROJECT_ID}" --freshness=10m --limit=10 --format=jsonRequirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Needs: Needs an MCP server, Needs a command-line tool
Security
What our scanner noticed· Low risk
- Instructions that use the network
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Published by
- Publisher
- Google (Official)
- Source
- google/skills · skills/cloud/agent-platform-architecture · commit 2194d3b
- Licence
- Apache License 2.0 (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by Google or Google.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download agent-platform-architecture.zip