Tool Reviews

Cortex AI Gateway gives your AI spending a clear owner where it previously had none.

Snowflake Cortex AI Gateway gives AI spending a clear owner by replacing scattered provider keys, personal tokens, and notebook calls with one governed endpoint. It supports OpenAI and Anthropic request formats, traced requests, budgets, roles, and showback queries. A production rollout should use deny-by-exception access, separate inference and monitoring roles, managed-as-code specifications, and careful payload capture controls. The result is accountable AI cost, prompt visibility, and centralized security without adding a second path for model traffic.

Cortex AI Gateway gives your AI spending a clear owner where it previously had none.

Key Takeaways

  • Snowflake Cortex AI Gateway centralizes AI access through one governed endpoint per account, replacing scattered provider keys, proxies, and notebooks with unified identity, logging, limits, and cost attribution.
  • It supports OpenAI and Anthropic request formats while adding tracing, budgets, showback queries, and role separation, but teams must move from open default access to deny-by-exception grants.
  • The gateway specification should be managed as code because ALTER AI GATEWAY FROM SPECIFICATION replaces the full configuration; production use requires model allowlists and careful payload-capture governance.
  • Programmatic access tokens only work when bound to a user with a network policy; without it, calls fail as a bare HTTP/2 401 with no trace, making network policy a key enforcement layer.
  • Observability and billing are joined through trace tables and request IDs, allowing teams to attribute spend, analyze reliability, and connect client-side agent steps to gateway traces when telemetry is enabled.

Meta description: A live production review of Snowflake Cortex AI Gateway shows how governed endpoints, tracing, token network policies, budgets, and showback queries work.

Cortex AI Gateway gives your AI spending a clear owner where it previously had none.

Tags: Snowflake Cortex AI Gateway, AI governance, LLM observability, cost attribution, programmatic access tokens

Featured image: abstract friendly illustration style, one gateway path, traced request lines, credit tags, no real people, no logos, no text.

For platform engineers, security teams, and finance owners who have watched model access spread across continuous integration secrets, personal tokens, and notebooks, Snowflake made Cortex AI Gateway generally available on Nov 3, 2026. A hands-on deployment in a live account shows what the gateway changes: one governed endpoint per account, OpenAI and Anthropic request formats, traced requests, and credits tied to users, if teams close the gaps hidden by the happy path.

A single path replaces scattered model keys

Before, each team found its own way to a model: one group stored an OpenAI key in a continuous integration secret, another ran Claude Code with personal tokens, and another called Cortex from a notebook. Finance saw one bill without knowing which team drove it, security could not say which prompts left the environment, and platform engineering was asked to govern AI without a control point. The friction was not the models themselves. It was that traffic had many paths, so identity, logging, and limits had nowhere to attach.

The gateway does not create a new way to call models. It creates the path that traffic must take. It removes provider keys from secret stores, replaces logging-only large language model proxies, and replaces chargeback spreadsheets with a specification managed as code, a sensitive trace table, and one dependency for all AI traffic.

The release, described as three capabilities generally available and two in preview, gives each account one gateway named SNOWFLAKE. There is nothing to provision. The endpoint is available through DESCRIBE AI GATEWAY, while private-connectivity accounts use a different host. The path is open by default because USAGE goes to PUBLIC, so revoking that grant is the first action. It is also a path, not an entitlement: gateway USAGE alone does not grant model access; requests still need the SNOWFLAKE.CORTEX_USER database role. That separation is what makes a single chokepoint safe. It is separate from the Snowflake ML GATEWAY object used for traffic splitting.

What the live rollout exposed

The practical rollout begins by replacing the open default with a deny-by-exception model. A live test revoked PUBLIC, created AI_GW_USER for inference and AI_GW_MONITOR for read-only oversight, and granted model access separately. SHOW GRANTS confirmed only OWNERSHIP, USAGE to the user role, and MONITOR to the monitor role remained. That split lets finance teams read everyone's spend and traces without generating calls, while a USAGE-only role sees only its own spans.

Payload exclusion is a governance trap. A tag such as GOVERNANCE.TAGS.PAYLOAD_CAPTURE_EXEMPT can be set directly on a user; only direct user tags count, the value is irrelevant, and exclusion fails closed. The ability to apply that tag should stay with security because it disables prompt auditing.

Cortex AI Gateway gives your AI spending a clear owner where it previously had none.

The gateway specification should be managed as code because ALTER AI GATEWAY SNOWFLAKE FROM SPECIFICATION replaces the whole specification. Omitted fields revert to defaults, so apply the full object and verify it with DESCRIBE. In the live round-trip, the applied specification matched the returned specification. It listed schema_version 1 and three models: claude-sonnet-4-6, claude-haiku-4-5, and claude-opus-5. Logging was enabled, client telemetry was enabled, request and response payload capture was enabled, and the exclusion tag was referenced.

Three choices matter. First, production needs an allowlist, not a wildcard, because a wildcard exposes every model the account can reach, including models added later. Second, request and response capture is a data-classification decision: full prompts and responses are stored in an event table in the customer account, so classification, restrictions, and retention must be set before enabling it. Third, enabling client telemetry lets clients send OpenTelemetry Protocol spans to the telemetry/v1/traces path, joining client-side agent steps to gateway spans under one trace_id through the World Wide Web Consortium traceparent header.

Traces, cost, and enforcement

Clients point to the account host endpoint /api/v2/aigateways/snowflake and use a path for each interface: /v1/chat/completions for all models except Claude, /v1/messages for Claude only, and /v1/responses for OpenAI only as a preview path. Supported clients include OpenAI Python and JavaScript for chat completions and responses, and Anthropic Python for messages. Authentication accepts an Open Authorization token, a key-pair JavaScript Object Notation Web Token, or a programmatic access token.

The live finding was that a programmatic access token works only for a user bound to a network policy. Without that policy, the caller receives a bare Hypertext Transfer Protocol version 2 401 response with an empty body and no trace. The fix is to create a network policy with the client address range and assign it to the token's user. A syntax catch also matters: token creation uses DAYS_TO_EXPIRY, not EXPIRES_IN_DAYS. After setting a one-day token for svc_agent, a live call to claude-haiku-4-5 with max_tokens 32 returned pong 1, 15 input tokens, 7 output tokens, and an x-snowflake-request-id header. That header is the join key from client logs to billing.

The observability layer is AGENT_TRACE_TABLE, a table function over a standard event table. The live span for the test call showed chat claude-haiku-4-5 with STATUS_CODE_OK for user SATISH and token counts that matched the API response. A reliability query groups by the requested model, counts requests, calculates failure rate from STATUS_CODE_ERROR or Hypertext Transfer Protocol status codes of 400 and above, and estimates p95 latency with APPROX_PERCENTILE over the last 24 hours for chat operations.

Three accounting traps appeared. Cache tokens are subsets: input_tokens already includes cache reads and writes, so adding them double-counts spend. Payload attributes are opt-in and never populate for excluded users. Empty Snowsight Overview or Cost pages before traffic do not mean the gateway is broken; they show No usage. Analytics charts also exclude client telemetry spans and are approximate, so alerting should use queries while the interface is used for exploration.

For alerting, the deployment used two native alert-and-procedure pairs and avoided third-party application performance management tools, scheduled agents, and read-only tradeoffs. Hourly AI_GW_WATCHER checks specification drift, failure-rate spikes, and 429 bursts, logs every run, and emails only on anomaly, naming failing models inline. Daily AI_GW_DAILY_DIGEST sends a web-formatted dashboard email with a health pill, key metric cards, a 7-day trend chart, per-model latency, top errors, and showback data. Each message carries account, region, user, role, and warehouse headers.

The Snowsight cost view answers routine questions, filterable by date range and user. Summary cards show gateway spend, median user spend at p50, model spend, and tool spend, which remains Not available until Model Context Protocol tools are used. Charts cover spend trend, spend by model, spend by Model Context Protocol server, and per-user p50, p90, and p99 distributions with a histogram. Tables show model breakdown, credits, credits per request, top 20 users, and period-over-period deltas grouped by model.

Cortex AI Gateway gives your AI spending a clear owner where it previously had none.

For chargeback or audit, the system of record is AI_GATEWAY_USAGE_HISTORY. Its OPERATION_DETAILS and CREDITS_GRANULAR fields are keyed by model name, so claude-haiku-4-5 can map to fields such as input_tokens 15; a LATERAL FLATTEN is required to make rows usable. USER_ID joins to ACCOUNT_USAGE.USERS, METADATA carries role_id, and REQUEST_ID equals the x-snowflake-request-id response header. A live correlation verified that one request tied client logs, trace spans, and a billing row with CREDITS equal to 0.000025. The working showback pattern queried the last 30 days and joined usage history to user names.

CREDITS is per-request, so if a request fans out across models during an agent turn, the same credit repeats on each flattened row. Teams should deduplicate by REQUEST_ID when summing credits and sum tokens per flattened row.

Enforcement needs to distinguish notification from blocking. Budgets notify; quotas block. The tested cutoff used a budget, a stored procedure, and a REVOKE action. The revoke applied, a role outside the allowlist was refused, and the re-grant was logged. Before any dynamic query, validate the role against an allowlist because IDENTIFIER inside EXECUTE IMMEDIATE does not bind. Quotas are the backstop because budgets can overshoot for hours while quotas block within minutes. In the test account, CREATE BUDGET was unsupported, and budgets and quotas were managed in Snowsight under AI Gateway and Cost.

Common mistakes teams should check first

The happy path hides five gaps. The first is leaving the gateway open: USAGE ships to PUBLIC, so a fresh account can expose the path before any team intends to use it. The second is editing the gateway specification without treating it as a full replacement. The third is issuing a programmatic access token without a network policy, producing a silent 401 and no trace. The fourth is reading AI_GATEWAY_USAGE_HISTORY as flat rows when model-keyed objects need flattening. The fifth is treating budgets as hard stops; they notify, while quotas block.

The companion repository, cortex-ai-gateway-starter on GitHub, includes role-based access control, specifications, queries, client configurations, continuous integration workflows, and runbooks, all executed in a live account.

Who should use it and who should wait

Teams that need one governed endpoint, request-level tracing, and per-user credit attribution should use Cortex AI Gateway now, provided they treat the specification, tags, telemetry, and cost view as production systems rather than optional add-ons. It is especially useful where finance needs showback, security needs prompt audit trails, and platform engineering needs a control point without running a separate logging-only proxy. Teams should not confuse the gateway with an entitlement system; model access still requires SNOWFLAKE.CORTEX_USER, and payload capture must be classified and retained before it is enabled.

Model Context Protocol governance should be planned, not relied on as a finished control. The Tools feature connects agents to GitHub, Slack, Salesforce, Google Workspace, and 100+ other systems over Model Context Protocol through the same governed path. In Snowsight under Model Context Protocol and Tools, every server starts disabled, but enabling one server without configuring its tools exposes all of them. Allowlist specific tools, use read-only access where possible, and avoid all current and future tools because provider updates can grow the attack surface. Per-user Open Authorization means the agent can do only what the authorizing user can do. Discovery is not authorization: clients see servers only with the SNOWFLAKE$OPS.MCP$USER database role. The feature is limited to AWS commercial regions and administered by ACCOUNTADMIN.

Organizations that cannot yet classify prompt payloads, cannot manage the gateway specification in source control, or have not defined who may apply payload-exclusion tags should wait on full production enablement until those controls exist.

Comments (0)

  1. No comments yet. Be the first to share what worked for you.

Leave a comment

Comments are reviewed before they appear. Your email address is not published.