Agent Gateway extends Gemini Enterprise Agent Platform governance to AI agents that you build and deploy on Cloud Run. By routing outbound requests from your Cloud Run services through a self-managed Agent Gateway backed by Secure Web Proxy, you can enforce unified access policies, inspect prompts and tool payloads for content safety, and capture logs and traces without changing your agent application code.
For complete step-by-step setup instructions, see Govern agents with Agent Gateway in the Cloud Run documentation.
Benefits
Using Agent Gateway with Cloud Run provides the following capabilities for your agent workloads:
- Enforce least-privilege access rules on outbound calls to Model Context Protocol (MCP) servers, tools, and external endpoints based on each service's cryptographic Agent Identity.
- Attach Model Armor templates through Service Extensions extension bindings to scan prompts and responses for prompt injection, jailbreaks, and sensitive data leakage.
- Route outbound container traffic with Cloud Run ambient networking and Direct VPC egress without building custom proxy logic into your agent framework.
- Host your gateway in the same Google Cloud project as your Cloud Run service, or share a central gateway across multiple service projects using Shared VPC.
- Monitor policy decisions, MCP tool invocations, and request latency in Cloud Logging and Cloud Trace.
Key components
A self-managed Agent Gateway deployment for Cloud Run combines the following components:
- Cloud Run ambient networking: Runs a Google-managed Envoy sidecar alongside your agent container to intercept outbound connections and forward them over mTLS.
- Secure Web Proxy: Runs inside your Virtual Private Cloud (VPC) network as the outbound policy enforcement point, performing TLS inspection and evaluating authorization rules and extension bindings.
- Agent Identity and Agent Registry: Assigns a workload-bound SPIFFE identity to your Cloud Run agent and registers agents, MCP servers, and tools in your organization's central inventory.
- Identity-Aware Proxy (IAP) and Identity and Access Management (IAM) Unified Access Policies: Evaluates whether a specific Cloud Run agent identity is authorized to call target MCP servers, tools, or endpoints.
- Extension bindings: Binds IAP and Model Armor to your Agent Gateway resource to evaluate outbound requests and responses.
How it works
When you deploy a Cloud Run service with --ambient-networking,
--vpc-egress=all, --functional-type=agent, and
--identity-type=agent-identity, Cloud Run provisions an
ambient Envoy sidecar and assigns an Agent Identity principal to
the service.
You create a Network Services API EgressRouting policy that directs outbound traffic
from your Cloud Run service to a Secure Web Proxy instance
associated with your self-managed Agent Gateway resource. The
ambient sidecar sends outbound connections over Direct VPC egress through an
mTLS CONNECT tunnel that carries your agent's identity to Secure Web Proxy.
Secure Web Proxy terminates outbound TLS sessions using a certificate
authority from Certificate Authority Service or your private PKI, evaluates ALLOW
authorization policies for MCP methods and model endpoints, and calls
IAP and Model Armor through extension bindings
before forwarding approved requests to their destination.
Supported regions
You can use Agent Gateway on Cloud Run in the following regions:
europe-west1us-central1
What's next
- Set up outbound governance for single-project or Shared VPC deployments in Govern agents with Agent Gateway.
- Diagnose routing, xDS permission, TLS inspection, and policy errors in Troubleshoot Agent Gateway.
- Learn about Agent Identity and automatic registration in Configure Agent Platform features for Cloud Run.
- Configure the underlying proxy resource in Deploy Secure Web Proxy as an Agent Gateway.
- View telemetry across runtimes in Monitor Agent Gateway traffic.