Live
Cloudflare Images Analytics Dashboard Adds 30‑Day Delivery VisibilityAmazon ECS Adds Native Blue/Green, Canary, and Linear Deployments for Safer Container RolloutsGemini agentic tools add LLM‑driven automation to Partner Marketing StudioGitHub Actions makes RHEL 9/10 runner images generally available for larger workloadsIntegrating Decider Models to Reduce Latency and Cost in AI Agent WorkflowsAWS Emulator Enables Local Testing of 200+ Services, but Lacks IAM ValidationSageMaker AI monitoring adds automatic latency drift, idle GPU, and configuration gap detection for inference endpointsEmbedding Proactive Governance into Enterprise‑Scale Agentic AICloudflare Images Analytics Dashboard Adds 30‑Day Delivery VisibilityAmazon ECS Adds Native Blue/Green, Canary, and Linear Deployments for Safer Container RolloutsGemini agentic tools add LLM‑driven automation to Partner Marketing StudioGitHub Actions makes RHEL 9/10 runner images generally available for larger workloadsIntegrating Decider Models to Reduce Latency and Cost in AI Agent WorkflowsAWS Emulator Enables Local Testing of 200+ Services, but Lacks IAM ValidationSageMaker AI monitoring adds automatic latency drift, idle GPU, and configuration gap detection for inference endpointsEmbedding Proactive Governance into Enterprise‑Scale Agentic AI
AWS

Implementing Snowflake Cortex OAuth with Amazon Bedrock AgentCore: Patterns and Ops

AI SummaryPowered by AI

Amazon Bedrock AgentCore now supports three distinct OAuth configurations for accessing Snowflake Cortex via the Model Context Protocol. Practitioners must choose the right pattern to preserve per‑user attribution, automate token refresh, and avoid unnecessary service‑account permissions.

Amazon Bedrock AgentCore has added built‑in support for three OAuth flows that let an AI agent call the Snowflake‑managed MCP server used by Snowflake Cortex tools. The change introduces a credential‑broker layer that fetches, caches, and refreshes tokens on behalf of the agent, eliminating the need for static service‑account keys and enabling per‑user attribution.

OAuth patterns supported for Snowflake Cortex

AgentCore Identity can be configured with one of three grant types:

  1. Snowflake‑hosted OAuth (3‑legged Authorization Code) – Snowflake acts as the authorization server. Each user authenticates directly to Snowflake using the authorization_code grant. No external IdP is required.
  2. Three‑legged OAuth with a corporate IdP – Users sign in through an existing SSO provider (Okta, Microsoft Entra ID, etc.) using the authorization_code grant. Snowflake trusts the IdP‑issued JWT via an External OAuth security integration.
  3. Two‑legged OAuth with a corporate IdP – A shared service account authenticates using the client_credentials grant. No interactive consent is needed, making it suitable for machine‑to‑machine workloads.

All three patterns rely on a credential provider in AgentCore Identity (CustomOauth2, OktaOauth2, or MicrosoftOauth2) and a matching Snowflake security integration. An optional on‑behalf‑of (OBO) grant (TOKEN_EXCHANGE) can deliver per‑user identity for unattended jobs without a consent prompt.

Token acquisition flow inside AgentCore

The outbound authentication sequence is fixed:

  1. The Bedrock AgentCore Gateway receives a request from the agent, authenticated inbound with a JWT.
  2. AgentCore Identity calls GetWorkloadAccessTokenForJWT to obtain a workload token tied to the inbound JWT.
  3. Using that workload token, AgentCore Identity invokes GetResourceOauth2Token against the configured OAuth provider.
  4. The returned access token is stored in the internal token vault, automatically refreshed, and presented to the Snowflake MCP server.

This separation keeps inbound identity (the agent’s JWT) distinct from outbound credentials (the OAuth token) and centralises token lifecycle management.

Security and operational implications

Choosing a pattern influences both security posture and operational overhead:

  • Snowflake‑only OAuth simplifies the trust chain but ties user management to Snowflake’s built‑in OAuth server. It requires configuring the OAUTH_AUTHORIZATION_SERVER issuer lock, session role/scope grammar, and mapping of LOGIN_NAME or EMAIL_ADDRESS to Snowflake identities. Query history attribution is automatically linked to the authenticated user.
  • External IdP (3‑legged) leverages existing corporate SSO, reducing duplicate user stores. However, Snowflake must be configured to accept the IdP’s JWT claims, scopes, and audience. Practitioners need to verify that the IdP’s token contains the claims expected by Snowflake’s External OAuth integration.
  • External IdP (2‑legged) removes interactive consent, which is ideal for batch jobs or services. The trade‑off is loss of per‑user attribution unless an OBO flow is added. Token rotation is handled by AgentCore, but the service account’s client secret or certificate must be protected.

All patterns benefit from AgentCore’s automatic token refresh, but operators should monitor the token vault for expiration anomalies and ensure that the underlying IdP’s token lifetimes align with Snowflake’s session expectations.

Related CloudNinjas coverage: AWS.

What This Means For Practitioners

When integrating Bedrock agents with Snowflake Cortex, select the OAuth flow that matches your identity strategy: use Snowflake‑hosted OAuth for isolated Snowflake environments, adopt three‑legged OAuth to reuse corporate SSO, or employ two‑legged OAuth for service‑to‑service calls. Validate claim mappings, audience values, and role‑scope settings in Snowflake’s security integration. Leverage AgentCore Identity’s token vault to offload refresh logic, but keep an eye on token lifetimes and vault health. Finally, consider the OBO grant if you need per‑user context for unattended workloads without prompting users.

Originally published atAWS Machine Learning Blog