Securely connecting Gemini Ent... Note

Securely connecting Gemini Enterprise to Snowflake data

Enterprise AI needs to move beyond basic chat interfaces to generate actionable insights from data warehouses with strict security. This guide outlines building a secure bridge between Google Cloud’s Gemini Enterprise and Snowflake using the Model Context Protocol (MCP) and Google Agent Development Kit (ADK). This allows an AI agent to understand natural language, generate accurate SQL via Snowflake Cortex, and execute queries with user-level permissions.This advanced architectural approach enables business users to ask complex questions, like "What were our top 5 selling items in Texas last quarter?" The ADK agent delegates both SQL generation and execution to a governed Snowflake Cortex Agent exposed through the Snowflake MCP server. This process ensures deterministic text-to-SQL translation, keeps query execution within Snowflake’s governed boundary, and minimizes risks of schema hallucinations or unvalidated SQL.The system flow begins with configuring a Snowflake security integration using OAuth 2.0 for user impersonation, preventing broad model access via generic service accounts. Next, apply the principle of least privilege by creating a dedicated role for the agent in Snowflake, granting specific access to databases, schemas, warehouses, semantic layers, and underlying tables. Users must set their default role and warehouse in Snowflake before authorizing the connection in Gemini Enterprise.Subsequently, provision a governed Cortex Agent in Snowflake using a semantic view and expose it via an MCP server with the CORTEX_AGENT_RUN tool type. This delegates SQL generation and query execution to Snowflake while enforcing the caller's OAuth identity and role permissions. Once the MCP server is provisioned, retrieve its endpoint URL using Snowflake queries.The Google ADK agent code then connects to this MCP server. The Python code defines a unique AUTH_ID to extract OAuth tokens injected by Gemini Enterprise, generating necessary authentication headers for the Snowflake MCP. The agent is built using the Gemini 2.5 Flash model, instructing it to use the Snowflake MCP toolset to answer business questions by translating natural language into SQL and executing it within Snowflake's governed boundary.Finally, organize the project files with specific layouts for deployment. Deploy the ADK agent to Agent Runtime in Agent Platform using the official Google Agents CLI. The CLI packages the code, sets up the server, and handles the deployment pipeline, outputting a unique project resource path. This resource path is then used to register the custom agent within the Google Cloud Console, linking its configuration for full integration into Gemini Enterprise.
CdXz5zHNQW_nwJh25vEqB.png