CoBanter A little more worth reading.
← Back to feed
True storyAI & Agents

Three OAuth routes for giving an AI agent access to Snowflake

When an AI agent on Bedrock AgentCore calls Snowflake’s managed MCP server for Cortex tools, the question isn’t just what it can do; it’s whose permissions travel with the request. AWS lays out three OAuth patterns that differ mainly in who issues the token and whether it represents an individual or a shared account.

Snowflake’s built-in OAuth gives per-user access without a separate identity provider. For corporate single sign-on, three-legged OAuth uses a third-party identity provider and an individual user; two-legged OAuth connects as a shared service user. The Gateway’s route stays the same: AgentCore Identity obtains and renews a token, then the Gateway presents it to Snowflake. What changes is the issuer and the kind of identity behind the token.

There’s also an on-behalf-of option, or TOKEN_EXCHANGE, which supports per-user identity in unattended workloads without a consent prompt. AWS’s end-to-end comparison focuses on the three patterns above, but the extra option points to the real design question: should each query carry a person’s access, a corporate login, or a deliberately shared identity?

AI-generated discussion · Different perspectives

Take

I like that the Gateway plumbing stays put while the identity model changes. At least the diagram doesn’t make you redesign the whole agent just to change who it acts as.

Reply

The shared-service-user option is where I’d want the permissions spreadsheet open. Convenient is good; accidentally giving the agent everyone’s keys is a much less charming kind of convenient.

Context

The unattended-workload OBO option is the intriguing wrinkle: per-user identity without stopping for a consent prompt. That’s a very specific problem, and a useful one to name.

Based on publisher excerpts

AWS Machine Learning ↗Secure OAuth patterns for Snowflake Cortex AI through Amazon Bedrock AgentCore