Guide on OAuth patterns for secure integration of AI agents in Amazon Bedrock AgentCore with Snowflake
AWS has published a guide on three OAuth configurations for communication between AI agents in Amazon Bedrock AgentCore and Snowflake via the Model Context Protocol. The patterns cover scenarios without an external identity provider, with corporate SSO, and with a shared service account, with token management and per-user authentication.
AWS has published a guide on the Machine Learning Blog on OAuth security for AI agents communicating with Snowflake. It focuses on how agents running in Amazon Bedrock AgentCore communicate with Snowflake via the Model Context Protocol (MCP) and how to authenticate these communications. The guide covers three tested OAuth configurations: Snowflake OAuth without an external identity provider (with the authorization_code grant), three-legged OAuth (3LO) with corporate Single Sign-On via Okta or Microsoft Entra ID, and two-legged OAuth (2LO) with a shared service user (with the client_credentials grant). It also includes support for the on-behalf-of (OBO) grant for per-user identity in unattended workloads without a consent prompt.
The Amazon Bedrock AgentCore Identity service acts as a credential broker – managing the token vault, token refresh, and bindings between users and tokens. The Gateway component aggregates the capabilities of the Snowflake-managed MCP server (exposing tools such as Cortex Search and Cortex Analyst) into a unified catalog presented to agents. The outbound OAuth path has the same structure across all three patterns: the Gateway resolves the token via Amazon Bedrock AgentCore Identity, which obtains and refreshes it from the authorization server, and the Gateway then passes the token to the Snowflake MCP server.
Each OAuth pattern uses a specific credential provider (CustomOauth2, OktaOauth2, or MicrosoftOauth2) and a corresponding security integration on the Snowflake side. The first pattern is specific to Snowflake due to its built-in OAuth authorization server. The second and third patterns follow the standard OAuth flow and can be extended to other OAuth-protected MCP servers, provided token claims, scopes, and audience settings are verified.
According to the AWS material, the configuration was tested with Okta and Microsoft Entra ID as the third identity provider. The text specifies a comparison table of the patterns, including grant types and identity query mapping in Snowflake.
Why it matters
Companies can securely delegate AI agents to Snowflake without needing broad service account permissions. Per-user identity and automatic token refresh reduce security risk, improve audit compliance, and enable per-user query attribution. Developers and DevOps teams get a clear schema for choosing the right OAuth pattern for a given scenario (interactive versus unattended, with an internal or external identity provider), which speeds up implementation and reduces the risk of security mistakes during configuration.
Two audiences, two different impacts
What this means
For individuals
A developer or DevOps engineer working with AI agents in AWS now has a concrete mapping of three OAuth patterns to Amazon Bedrock AgentCore and Snowflake components, including credential provider selection for a given scenario, which speeds up configuration and reduces the risk of security mistakes.
For a business
Companies can securely implement per-user authentication for AI agents in Snowflake, eliminating the need for broad service account permissions and improving the audit trail and compliance – especially for scenarios with an external identity provider enabling corporate SSO.
Risks and complianceCheck the original
Event sources
only one source so far · 1 publisher, 0 independent. We count feeds from the same owner only once.