When deploying enterprise AI agents that interact with sensitive corporate data, security teams frequently demand internal network isolation to prevent exposing proprietary databases to the public internet. To resolve this architectural challenge, Google published a specialized developer guide on November 20, 2026, authored by Google Cloud Forward Deployed Engineer Neeraj Agrawal, outlining a secure recipe for connecting Model Context Protocol (MCP) servers hosted on Cloud Run directly to Gemini Enterprise.
Routing Traffic Privately with Private Service Connect
To bypass public endpoints entirely, Google's architecture routes Gemini Enterprise traffic through an Egress Agent Gateway that leverages a Private Service Connect network attachment. This mechanism allows incoming requests to land safely inside a company's internal Virtual Private Cloud network without traversing external IPs. Because Cloud Run services can be configured with internal-only ingress, external public calls are automatically blocked and return standard HTTP 404 errors. Developers must carefully plan their infrastructure regions, as the Agent Gateway is currently restricted to specific locations such as us-central1 and europe-west1.
Isolating Routing with FQDN-Scoped DNS Zones
Configuring private routing requires careful DNS management to prevent unintended disruptions across other cloud workloads. Utilizing a broad wildcard zone can inadvertently catch and redirect lookups meant for unrelated server instances. To prevent collateral damage, Google recommends creating an FQDN-scoped private Cloud DNS zone tailored exclusively to the exact hostname of the target MCP server. Because standard domain name resolution prioritizes the longest matching suffix, this precise targeting ensures that only the intended server resolves to the private internal address while neighboring services continue operating normally.
Implementing Dual-Layer Identity Verification
Security enforcement relies on a two-tier validation workflow that authenticates both the calling service and the individual human user. Every tool invocation carries a Google-signed service token transmitted via the X-Serverless-Authorization header, validated upstream when the Cloud Run Invoker role is assigned to the Gemini Enterprise service agent. Simultaneously, the end user's identity is passed down through a standard Bearer token in the Authorization header. Application middleware inspects this token, rejecting unauthorized requests with an HTTP 401 response and injecting user states so tools can properly filter data permissions.
Why This Architectural Pattern Matters for Enterprise AI Adoption
This architectural recipe directly addresses the most critical barrier to enterprise AI adoption: the tension between granting autonomous agents access to deep institutional data and maintaining strict corporate perimeter security. By decoupling network transport via Private Service Connect and enforcing strict dual-token validation, organizations avoid the severe risk of privilege escalation where a generalized service identity could otherwise allow low-level employees to access executive-tier database rows. Furthermore, by establishing clear hard constraints—such as requiring StreamableHTTP transport while barring older server-sent events, mandating publicly trusted TLS certificates, and capping servers at 100 enabled actions—Google provides a rigorous engineering baseline rather than a loose proof-of-concept. For platform engineers and security officers, adopting this pattern shifts the trust boundary away from vulnerable client-side applications and places it firmly at the tool server interface, ensuring that as enterprise AI agents scale across global organizations, data governance remains intact without sacrificing functional capabilities.

Cover: Asoundd · CC BY-SA 4.0 · Wikimedia Commons. Layout and headline text by Signal Titans. Logo: Google, via Wikimedia Commons (Public domain).
Source: Connect Cloud Run MCP Server to Gemini Enterprise: Google's Private Recipe · Connect Cloud Run MCP Server to Gemini Enterprise in 2026

Leave a Reply