Google Cloud Solution Multi Agent Security
GoogleOfficialPublished by Google
- Skill
- Tool integration
- Cloud and DevOps
- Apache-2.0
- Low risk
- Has scripts
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a structured approach to designing, deploying, and securing Google Cloud Agent Gateway solutions. It covers the configuration of ingress (CLIENT_TO_AGENT) and egress (AGENT_TO_ANYWHERE) patterns, integrating essential security components such as Model Armor, Identity-Aware Proxy (IAP), and Agent Registry. The skill includes templates for configuration files, infrastructure deployment scripts, and validation procedures to ensure secure communication between agents and external services.
What it does
- Generates configuration files for Agent Gateway ingress and egress policies.
- Provides infrastructure deployment commands for Google Cloud services.
- Configures Model Armor guardrails for content authorization and filtering.
- Sets up IAP and Authz policies to manage agent identity and access.
- Offers troubleshooting steps for common ingress and egress connectivity issues.
- Supports complex routing scenarios including Hybrid VPN and GKE internal load balancing.
When to use it
- When you need to secure multi-agent communication patterns in Google Cloud.
- When configuring ingress or egress gateways for Agent Engine workloads.
- When implementing Model Armor guardrails to filter agent prompts and responses.
- When setting up private connectivity between agents and internal MCP tool backends.
Advantages
- Ensures consistent security posture across multi-agent architectures.
- Provides ready-to-use configuration templates and deployment scripts.
- Includes specific validation steps to verify security policy enforcement.
- Addresses complex networking requirements like PSC and DNS peering.
Usage examples
- “Design a secure ingress and egress architecture for my multi-agent system.”
- The agent provides a Mermaid diagram of the architecture and generates the necessary YAML configuration files for ingress and egress gateways.
- “How do I configure Model Armor for my Agent Gateway?”
- The agent generates the model-armor-config.yaml file with required filters and provides the commands to apply it to the gateway.
- “My agent is getting a 403 error when accessing an egress tool.”
- The agent provides troubleshooting steps to verify IAM bindings for roles/iap.egressor and checks the CEL conditions on the tool metadata.
- “Generate the configuration for a multi-agent Cloud Run egress setup.”
- The agent creates the specific egress gateway configuration, registers the services in the Agent Registry, and provides the updated IAP policy.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/google/google-cloud-solution-multi-agent-security/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip google-cloud-solution-multi-agent-security.zip -d .agents/skills
Documentation by Google
Agent Gateway multi-agent security
Attribution
MUST READ: Before executing any gcloud, REST API, or MCP command, you
MUST read and follow the instructions in
Usage Attribution.
Critical Enforcement Rules & Rationale
Gcloud Release Tracks: Always use the exact release tracks specified in the commands (e.g.,
gcloud beta network-services agent-gateways). Omitting these prefixes causes commands to fail because Agent Gateway features are located in specialized, non-default namespaces.API Enablement: Include
modelarmor.googleapis.comin the API enablement list when setting up guardrails. Excluding it prevents Model Armor policies and filters from successfully attaching to the Gateway.Egress Verification: Egress policy verification requires using the Python script (scripts/verify_egress_policies.py), not
curl. Egress gateways rely on runtime SDK lifecycle handling and JWT context that a standard curl command cannot simulate correctly.Model Armor Keys: In
model-armor-config.yaml, always include bothpiAndJailbreakFilterSettingsandsdpFilterSettings(filterEnforcement: ENFORCE). Invalid or missing filters cause deployment validation failures or lead to silent bypasses of the guardrails.Subnet Private Access: Any subnet hosting a Private Service Connect network attachment for Egress Gateways must have
private_ip_google_access = trueenabled in Terraform. Disabling this blocks connectivity to Google-managed endpoints, causing total routing failures for agents.Direct Delivery: Immediately provide the requested architecture, configuration files, CLI commands, scripts, and diagrams in full. Do not stop at a planning phase, do not generate a plan artifact, and do not ask for user confirmation before delivering outputs.
No Infrastructure Execution: Do not attempt to run deployment or verification commands (such as
gcloud,kubectl,terraform, orcurl) against real cloud resources during design. You are generating plan configurations, not executing them.
[!IMPORTANT] Just-In-Time (JIT) Resource Loading Protocol: Inspect template files in assets/ and executable scripts in scripts/ using
view_fileas needed for extended configurations, deployment scripts, and test suites.
Quick Reference: Required Filenames
Always generate files with these exact names when requested:
agw-ingress-config.yaml(assets/agw-ingress-config.yaml)agw-egress-config.yaml(assets/agw-egress-config.yaml)agw-authz-extension.yaml(assets/agw-authz-extension.yaml)agw-authz-policy.yaml(assets/agw-authz-policy.yaml)model-armor-config.yaml(assets/model-armor-config.yaml)sgp-policy.yaml(assets/sgp-policy.yaml)iap-policy.json(assets/iap-policy.json)model-armor-payload.json(assets/model-armor-payload.json)
1. Dual Ingress & Egress Architecture Design (dual_ingress_egress_architecture_design)
Ingress Pattern:
CLIENT_TO_AGENTfronted by Ingress Control Plane (Agent Gateway, Model Armor).Egress Pattern:
AGENT_TO_ANYWHEREutilizing Egress Control Plane (Agent Gateway,roles/iap.egressorCEL policies, Cloud DNS) and Egress Data Plane (PSC Interface, Cloud Run, PSC Google APIs Global Endpoint), coordinated via Agent Registry & Agent Engine runtime.Mermaid Diagram:
graph TD Client["External Clients"] -->|HTTPS / MCP| GLB["Global Load Balancer"] GLB --> Ingress["Ingress Agent Gateway (CLIENT_TO_AGENT)"] Ingress --> MA["Model Armor (CONTENT_AUTHZ)"] MA --> Agent["Agent Engine Agents (BillingAgent, SupportAgent, FraudAgent)"] Agent --> Egress["Egress Agent Gateway (AGENT_TO_ANYWHERE)"] Egress --> PSC["Private Service Connect Network Attachment"] PSC --> Tools["Private MCP Tool Backends"]
2. Ingress & Egress Guardrail Policy Config (ingress_and_egress_guardrail_policy_config)
When requested for Ingress & Egress guardrail policy configs, you MUST generate and create all required files in the workspace:
agw-ingress-config.yaml(assets/agw-ingress-config.yaml): DeclaresgovernedAccessPath: CLIENT_TO_AGENTwith protocolsHTTPandMCP.agw-egress-config.yaml(assets/agw-egress-config.yaml): DeclaresgovernedAccessPath: AGENT_TO_ANYWHEREwith protocolMCP.agw-authz-extension.yaml(assets/agw-authz-extension.yaml): Configures AuthzExtension service for IAP authorization.agw-authz-policy.yaml(assets/agw-authz-policy.yaml): ConfiguresAuthzPolicyactionALLOWtargeting both Ingress and Egress gateways.iap-policy.json(assets/iap-policy.json): Bindsroles/iap.egressorwith CEL condition checkingiap.googleapis.com/mcp.toolName == 'get_account_balance' && iap.googleapis.com/mcp.tool.isReadOnly == true.model-armor-config.yaml(assets/model-armor-config.yaml): EnablespiAndJailbreakFilterSettingsandsdpFilterSettingswithfilterEnforcement: ENFORCE.sgp-policy.yaml(assets/sgp-policy.yaml): Implements Natural Language Constraints blocking transactions > $1000 and sanitizing PII.
3. Ingress & Egress Infrastructure Deployment (ingress_and_egress_infrastructure_deployment)
Inspect and provide the step-by-step gcloud CLI commands from
scripts/deploy_infrastructure.sh:
Enable Required APIs:
compute,networkservices,networksecurity,modelarmor,iap,agentregistry,serviceextensions, andaiplatform.Import Agent Gateways: Ingress (
agw-ingress-config.yaml) and Egress (agw-egress-config.yaml) viagcloud alpha network-services agent-gateways import.Import Authz Extension:
agw-authz-extension.yamlviagcloud beta service-extensions authz-extensions import.Import Authz Policy:
agw-authz-policy.yamlviagcloud beta network-security authz-policies import.
4. Ingress & Egress Security Validation (ingress_and_egress_security_validation)
When validating security for Ingress and Egress:
Ingress 403 Unauthenticated Test: Provide the copy-pasteable verification curl command from scripts/validate_ingress_unauth.sh sending an unauthenticated POST request to the Reasoning Engine endpoint expecting HTTP 403 Forbidden.
Python Egress Verification Script (MUST use Python script snippet, NOT curl): Provide the Python verification script snippet from scripts/verify_egress_policies.py sending JSON-RPC
tools/callrequests (get_account_balance) through the Egress Gateway to verify HTTP 200 for allowed tools.Model Armor Test Payload: Generate
model-armor-payload.json(assets/model-armor-payload.json) containing prompt injection/jailbreak instructions.
5. Troubleshooting Ingress & Egress Failures (troubleshooting_ingress_and_egress_failures)
Ingress 403 (Client-to-Agent):
Root Cause: Unauthenticated client requests or missing/invalid OAuth 2.0 / IAP identity tokens.
OAuth Configuration Steps:
Configure OAuth 2.0 Client ID credentials in Google Cloud Console.
Grant the client identity / service account
roles/iap.httpsResourceAccessorpermission.Exchange credentials with Google OAuth to acquire an OIDC / OAuth ID token.
Pass the token in the
Authorization: Bearer <TOKEN>header.
Verification Command: Provide the curl command from scripts/verify_ingress_auth.sh.
Egress 403 (Agent-to-Anywhere):
Root Cause: Missing
roles/iap.egressorIAM bindings on the Agent Identity, malformed principal ID, or mismatched CEL condition on tool metadata.Fix Command: Provide the exact
gcloudcommand from scripts/fix_egress_iap.sh.
6. Hybrid VPN Connectivity & Egress Routing (hybrid_vpn_connectivity_egress_routing)
Terraform HCL: Refer to baseline Terraform config in assets/main.tf for VPC, subnets (
private_ip_google_access = true), PSC network attachment, Cloud DNS private forwarding foraws.internal., and HA VPN gateway/router.Egress Gateway Config (
agw-egress-config.yaml): Generate configuration declaringgovernedAccessPath: AGENT_TO_ANYWHERE, pointing to the PSC network attachment, and referencingaws.internal.indnsPeeringConfig(see assets/agw-egress-config.yaml).Python SDK Deployment Script: Refer to scripts/hybrid_vpn_agent.py for the complete script initializing Vertex AI with
agent_to_anywhere_configreferencing the Egress Gateway, enabling telemetry, and deployingHybridAgentusingtypes.IdentityType.AGENT_IDENTITY.
7. Private Egress GKE Internal Load Balancer (private_egress_gke_internal_load_balancer)
Expose GKE internal MCP tool server via an Internal Load Balancer (ILB) at literal IP
10.0.1.50, connecting via Agent Gateway PSC Interface + Cloud DNS Private zone.Cloud DNS Record Mapping: Provide the command from scripts/create_gke_dns_record.sh mapping the private domain to GKE's private ILB IP
10.0.1.50.Explicit TLS Warning: Agent Gateway egress does not natively trust self-signed certificates or private enterprise CAs. You must use publicly trusted TLS certificates signed by a trusted Certificate Authority (e.g., Let's Encrypt).
8. Governance Controls Model Armor SGP (governance_controls_model_armor_sgp)
When configuring dual safety layers with Model Armor on Ingress and SGP on Egress:
Model Armor Config: Generate
model-armor-config.yaml(assets/model-armor-config.yaml) withpiAndJailbreakFilterSettingsandsdpFilterSettings(filterEnforcement: ENFORCE).Semantic Governance Policy: Generate
sgp-policy.yaml(assets/sgp-policy.yaml) with Natural Language Constraints blocking transactions > $1000 and sanitizing PII.Curl PATCH Command: Provide the curl command from scripts/enforce_sgp_patch.sh to update
authzExtensionswithsgpEnforcementModeset toENFORCE.
9. Multi-Agent Cloud Run Egress Routing (multi_agent_cloud_run_egress_routing)
Do NOT produce a plan artifact or stop at planning. When configuring multi-agent Cloud Run egress routing, you MUST directly provide and generate ALL required components:
Egress Gateway Config (
agw-egress-config-run.yaml): Generate configuration declaringgovernedAccessPath: AGENT_TO_ANYWHERE, PSC network attachment, and DNS peering for*.run.app(see assets/agw-egress-config-run.yaml).Register Cloud Run Services in Agent Registry: Provide the registration commands from scripts/register_cloud_run_services.sh registering all 3 Cloud Run services (
marketing-tool-service,sales-tool-service,support-tool-service) in theus-east4Agent Registry.iap-policy.json(Multi-Agent): Generateiap-policy.json(assets/iap-policy-multi-agent.json) containing all 3principal://bindings in thememberslist underroles/iap.egressor.Python SDK Deployment Script: Refer to scripts/multi_agent_cloud_run.py for the complete GenAI SDK deployment script.
10. Advanced Model Armor Filtering (advanced_model_armor_filtering)
For custom keyword matching, configure userDefinedFilterSettings (see
assets/model-armor-advanced.yaml).
11. Known Traps & Gotchas (known_traps_and_gotchas)
network_attachmentisForceNew: Enabling Semantic Governance Policies (SGP) or modifying network attachments after the initial Terraform apply will force-recreate the gateway resource. If not managed carefully, this can cause dependency deadlocks during destroy operations. Plan infrastructure sequencing accordingly.Authz Policy Limit: An Agent Gateway allows at most 4 custom authorization policies attached concurrently. Ensure your security posture consolidates rules within this limit.
Files
- ATTRIBUTION.mdAdded by AutoGineer902 B
- LICENSELicence file added by AutoGineer11.1 KiB
- SKILL.md14.6 KiB
- assets/agw-authz-extension.yaml275 B
- assets/agw-authz-policy.yaml325 B
- assets/agw-egress-config-run.yaml530 B
- assets/agw-egress-config.yaml247 B
- assets/agw-ingress-config.yaml255 B
- assets/iap-policy-multi-agent.json590 B
- assets/iap-policy.json469 B
- assets/main.tf2.4 KiB
- assets/model-armor-advanced.yaml386 B
- assets/model-armor-config.yaml353 B
- assets/model-armor-payload.json101 B
- assets/sgp-policy.yaml311 B
- references/attribution.md1.9 KiB
- scripts/create_gke_dns_record.shScript287 B
- scripts/deploy_infrastructure.shScript1.0 KiB
- scripts/enforce_sgp_patch.shScript548 B
- scripts/fix_egress_iap.shScript226 B
- scripts/hybrid_vpn_agent.pyScript1.2 KiB
- scripts/multi_agent_cloud_run.pyScript1.7 KiB
- scripts/register_cloud_run_services.shScript1.0 KiB
- scripts/validate_ingress_unauth.shScript433 B
- scripts/verify_egress_policies.pyScript797 B
- scripts/verify_ingress_auth.shScript483 B
LICENSE
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Requirements 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 Python
Security
What our scanner noticed· Low risk
- Scripts that your agent may run
This skill includes scripts that your agent may run. Read them before you use it.
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/google-cloud-solution-multi-agent-security · 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.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download google-cloud-solution-multi-agent-security.zip