Snowflake Cortex brings LLM functions, search services and agents to the data warehouse itself, and several of its access defaults are open to every role in the account until an administrator closes them. Cortex AI functions are callable through the PUBLIC role by default, Cortex Search services run with owner's rights, agents can call remote MCP servers over the public internet, and prompts may be processed in another region. This guide covers the Cortex-specific controls: function and model access, cross-region inference, agent and tool privileges, MCP connectors, guardrails and observability. It builds on the Snowflake Security Guide, which covers authentication, network policies and RBAC for the platform as a whole, and does not repeat it. It is for Snowflake administrators, data platform security engineers and IAM owners. Details are from Snowflake documentation checked 27 October 2026; Cortex changes often, so confirm settings against the current pages.
This is an independent guide from NHI Mgmt Group, based on Snowflake's public documentation as of November 2026. It is not sponsored or reviewed by Snowflake. Product features change, so confirm settings against Snowflake's current documentation.
Key takeaways
- Close the PUBLIC defaults first. The
USE AI FUNCTIONSaccount privilege and theSNOWFLAKE.CORTEX_USERdatabase role are both granted toPUBLICby default; revoke them and grant access through named roles. - Govern models with RBAC. Model access is controlled with
CORTEX-MODEL-ROLE-<model>application roles; the legacyCORTEX_MODELS_ALLOWLISTparameter is being deprecated during 2026. - Know where prompts are processed.
CORTEX_ENABLED_CROSS_REGIONdecides whether prompts and responses may travel to other regions or clouds; organisations created after 9 March 2026 default toANY_REGION. - Agent access is the sum of tool access.
USAGEon an agent is not enough on its own, but by default a run continues silently with whatever tools the caller can use, and Cortex Search answers with the service owner's rights. - Observability content is sensitive. Full prompts, tool inputs and outputs in
SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTSare visible only withREAD UNREDACTED AI OBSERVABILITY EVENTS TABLE; keep that privilege rare.
How identity and access work in Snowflake Cortex AI
Cortex uses ordinary Snowflake RBAC: a user's active role must hold the Cortex privileges and database roles, plus privileges on every object a function, search service or agent touches. The Cortex layer adds four access gates.
| Gate | Object or setting | Default | Recommended setting |
|---|---|---|---|
| Use of AI functions | USE AI FUNCTIONS account privilege, or per-function USE AI FUNCTION <name> | Granted to PUBLIC | Revoke from PUBLIC; grant per function to named roles (blanket and per-function grants work as an OR) |
| Cortex feature access | SNOWFLAKE.CORTEX_USER (all covered AI features), AI_FUNCTIONS_USER (scalar functions only), CORTEX_EMBED_USER (embeddings, search with managed embeddings), CORTEX_AGENT_USER (agents only) | CORTEX_USER granted to PUBLIC; others not | Revoke CORTEX_USER from PUBLIC; grant the narrowest database role to custom roles |
| Model access | CORTEX-MODEL-ROLE-<model> and CORTEX-MODEL-ROLE-ALL application roles in SNOWFLAKE.MODELS | Accounts with allowlist 'All' received CORTEX-MODEL-ROLE-ALL on the SNOWFLAKE.PUBLIC application role | Remove the bootstrap grant; grant approved models per role |
| Processing location | CORTEX_ENABLED_CROSS_REGION | Inherited; ANY_REGION for organisations created after 9 March 2026 | Set explicitly to the geography your data policy allows, or DISABLED |
- Revoking PUBLIC: Snowflake documents
REVOKE USE AI FUNCTIONS ON ACCOUNT FROM ROLE PUBLIC;andREVOKE DATABASE ROLE SNOWFLAKE.CORTEX_USER FROM ROLE PUBLIC;. Its documentation also showsREVOKE IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE FROM ROLE PUBLIC;and warns to run it only if you intend to restrict all of that access, because it affects more than Cortex. - The bootstrap model grant: a plain
REVOKEdoes not removeCORTEX-MODEL-ROLE-ALLfrom theSNOWFLAKE.PUBLICapplication role; Snowflake providesCALL SNOWFLAKE.LOCAL.REVOKE_FROM_PUBLIC_APPLICATION_ROLE('APP_ROLE', 'CORTEX-MODEL-ROLE-ALL');. Access is granted if either RBAC or the allowlist permits a model, andACCOUNTADMINalways has access. - Allowlist deprecation: Snowflake states that from August 2026
CORTEX_MODELS_ALLOWLISTcan only be changed to'None'and that the parameter will be removed later in 2026. Setting it to'None'leaves RBAC as the single model gate. - Data handling: Snowflake states that the LLMs it provides run inside the Snowflake service perimeter, classifies function inputs as Usage Data and outputs as Customer Data, and for cross-region inference sends prompts and responses transiently to the processing region without persisting them there. Within one cloud provider traffic stays on its backbone; across providers it crosses the public internet with mutual TLS.
Admin roles and privileged access
| Privilege or setting | Who holds it | Why it is privileged |
|---|---|---|
CORTEX_ENABLED_CROSS_REGION, CORTEX_MODELS_ALLOWLIST, AI_SETTINGS (guardrails) | ACCOUNTADMIN only (ORGADMIN cannot set cross-region) | Decide data residency, available models and prompt injection protection for the whole account |
CREATE AGENT on schema | Granted per schema | Creates objects that combine data access, tools and external calls |
MODIFY and OWNERSHIP on agents | Creating role owns by default | Change instructions, tools and models of a live agent, or drop it |
CREATE CORTEX SEARCH SERVICE on schema | Granted per schema; creator needs SELECT on sources | The service answers queries with the owner's rights over that data |
CREATE EXTERNAL MCP SERVER and API integrations (API_PROVIDER = external_mcp) | Account admins by default | Open a path from agents to external services and hold OAuth secrets |
READ UNREDACTED AI OBSERVABILITY EVENTS TABLE | Granted at account level | Reveals full conversations, tool inputs and outputs across agents |
- Keep ACCOUNTADMIN for settings, not for agents: because
ACCOUNTADMINalways has model access and owns account AI settings, agents and search services should be owned by dedicated functional roles, never byACCOUNTADMIN. - Separate builders from publishers: developers can hold
CREATE AGENTin a development schema; production agents are created by a deployment role, and business users receive onlyUSAGE. - Owner's rights are a design decision: Snowflake states that Cortex Search services perform searches with owner's rights, and that custom tool procedures run with owner's or caller's rights as defined on the procedure. An owner role with broad
SELECTmakes every user withUSAGEon the service a reader of that data through search. Build each search service from a view that contains only what all its users may see. See the Permission-Aware RAG Guide.
Integrations, API tokens and service accounts
Agents and their tools
- Calling an agent: the caller needs
SNOWFLAKE.CORTEX_USERorSNOWFLAKE.CORTEX_AGENT_USER,USAGEon the agent, its database and schema, andUSAGEon each tool's warehouse. - Tool privileges: Cortex Search needs
USAGEon the service; Cortex Analyst semantic views need access to the referenced database, schema and tables; custom tools needUSAGEon the function or procedure; referenced agents needUSAGEor the reference is skipped silently. - Inaccessible tools: by default (
accept) a missing tool privilege produces a warning and the run continues with the tools the caller can use. Setorchestration.tool_not_accessibletorejectfor agents where a partial answer is misleading, so access gaps surface as failures. - External reach: web search must be enabled at account level and, like MCP connectors, sends requests over the public internet. The code execution tool runs Python in an isolated sandbox. Treat each as a separate approval decision.
- Secure agents: mark agents secure where the specification (instructions, tool configuration) should be hidden from non-owner roles.
REST API authentication
Requests to the Cortex Agents API must carry a programmatic access token (PAT), a key pair JWT or an OAuth token, and the role comes from the X-Snowflake-Role header or the user's default role. Applications that front agents for many users should use OAuth so each call runs as the end user's role, rather than a service user's PAT that gives every caller the same access. Where a service user is unavoidable, follow the Service Accounts in Snowflake Guide: TYPE = SERVICE, key pair or PAT bound to a network policy, a dedicated least-privilege default role, and always set X-Snowflake-Role explicitly.
MCP connectors
- Objects: a
CREATE EXTERNAL MCP SERVERobject points at the remote endpoint and references an API integration withAPI_PROVIDER = external_mcpthat holds the OAuth configuration and secrets;API_ALLOWED_PREFIXESlimits the endpoints it may reach. Agents attach servers withALTER AGENT ... ADD MCP_SERVER. - OAuth only: integrations use
TYPE = OAUTH2orTYPE = OAUTH_DYNAMIC_CLIENT.OAUTH_REFRESH_TOKEN_VALIDITYdefaults to 0, meaning the refresh token never expires; set an explicit value (minimum 3,600 seconds). - Trust: Snowflake states it does not provide, maintain or verify external MCP servers, and that access to a server does not grant access to its tools, which must be granted separately. Only the MCP tools capability is supported.
- Kill switch: disabling an integration immediately invalidates user tokens and calls the provider's revocation endpoint; dropping it deletes the stored OAuth configuration and secrets. Use disable for incidents. See the MCP Security Guide.
Logging and detection
| Source | What it records | Use it for |
|---|---|---|
SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS (via GET_AI_OBSERVABILITY_EVENTS) | Threads, traces and spans for planning, each tool call (Search, Analyst, web search, code execution, MCP, custom tools), SQL execution and responses; user, role and warehouse in RESOURCE_ATTRIBUTES; agent version and alias | Reconstruct what an agent did for whom; requires MONITOR or OWNERSHIP on the agent plus CORTEX_USER; content redacted without the unredacted privilege |
SNOWFLAKE.ACCOUNT_USAGE.CORTEX_AI_FUNCTIONS_USAGE_HISTORY | FUNCTION_NAME, MODEL_NAME, CREDITS, QUERY_ID, USER_ID, ROLE_NAMES, QUERY_TAG, WAREHOUSE_ID, hourly windows, up to five minutes latency | Who used which model, spend per user and role, runaway queries |
SNOWFLAKE.ACCOUNT_USAGE.CORTEX_AI_GUARDRAILS_USAGE_HISTORY | Guardrail scans, flagged requests (GUARDRAILS_SIGNAL = TRUE), credits and tokens | Prompt injection attempts against agents |
ACCOUNT_USAGE.QUERY_HISTORY, LOGIN_HISTORY, ACCESS_HISTORY | Platform activity as in any Snowflake account | Correlate agent SQL and service users with source data reads |
- Detections worth building: grants of
CORTEX_USER, model roles or the unredacted observability privilege; changes toCORTEX_ENABLED_CROSS_REGIONorAI_SETTINGS; new external MCP servers or API integrations; a user whose Cortex credits or distinct models jump above baseline (Snowflake documents alerts and tasks that revoke access above a per-user monthly limit and cancel runaway queries withSYSTEM$CANCEL_QUERY); repeated guardrail flags from one user or agent. - Metrics: roles with Cortex access versus approved list; agents with
tool_not_accessible = rejectwhere required; search services built on restricted views; MCP integrations with refresh token validity set; holders of the unredacted observability privilege; guardrail flag rate.
For spend abuse patterns, see the Denial-of-Wallet and AI Agent Cost Runaway Guide.
Hardening baseline
- Inventory current use: query
CORTEX_AI_FUNCTIONS_USAGE_HISTORYfor 30 days to see which users, roles and models already depend on Cortex before you change grants. - Create the target roles: custom roles holding
AI_FUNCTIONS_USER,CORTEX_AGENT_USERorCORTEX_EMBED_USERas needed, per-functionUSE AI FUNCTIONgrants and approved model roles. Grant them to the users found in step 1. - Revoke the PUBLIC defaults: revoke
USE AI FUNCTIONSandCORTEX_USERfromPUBLIC, remove the bootstrapCORTEX-MODEL-ROLE-ALLgrant, and setCORTEX_MODELS_ALLOWLIST = 'None'. Do this in a test account first; rollback is re-granting toPUBLICfor a fixed window while missing grants are fixed. - Set processing location: choose a
CORTEX_ENABLED_CROSS_REGIONvalue matching your residency policy. Note that Cortex AI Guardrails require cross-region inference to be enabled with one of the supported values, so aDISABLEDaccount cannot use them. - Enable guardrails for Cortex Agents through
AI_SETTINGS(advanced_prompt_injectionenabled), on Enterprise Edition or higher commercial accounts, and review flagged requests periodically for false positives. - Design agents for least privilege: Cortex Search services over restricted views with dedicated owner roles; custom tool procedures with caller's rights unless owner's rights are justified;
tool_not_accessible = rejecton sensitive agents; secure agents in production. - Control external reach: enable web search only if needed; restrict MCP integrations with
API_ALLOWED_PREFIXES, set refresh token validity, and require review before an agent gains a new server. - Protect observability: grant
MONITORper agent to support roles and keepREAD UNREDACTED AI OBSERVABILITY EVENTS TABLEto a small investigation role. - Cap spend: build the documented monthly credit alert and per-user limit task.
Common misconfigurations
- PUBLIC left in place: every role, including service users built for unrelated pipelines, can call LLM functions on any data it can read.
- Allowlist treated as the model control: the bootstrap application role grant still gives every role every model even after the allowlist is narrowed, because either path grants access.
- Search service owned by a broad role: a search service built from a whole table by an engineering role answers questions for every user with
USAGE, regardless of their own table access. - Silent partial agents: the default
acceptbehaviour hides privilege gaps, so users get confident answers built from a subset of tools. - Non-expiring MCP refresh tokens: leaving
OAUTH_REFRESH_TOKEN_VALIDITYat 0 creates long-lived third-party access stored in the account. - Shared PAT behind an app: an internal chat application calls the Agents API with one service user's PAT and default role, so every employee inherits that role. Give each app its own service user with a narrow role, a network policy and key-pair or OAuth authentication.
- Cross-region by inheritance: nobody set
CORTEX_ENABLED_CROSS_REGION, so prompts containing regulated data may be processed outside the expected geography.
Framework mapping
| Area | NIST SP 800-53 Rev. 5 | NIST CSF 2.0 |
|---|---|---|
| PUBLIC revocation, database and model roles | AC-6 Least Privilege, AC-3 Access Enforcement | PR.AA-05 |
| Service users and API authentication | IA-5 Authenticator Management, IA-9 Service Identification and Authentication | PR.AA-01 |
| Cross-region processing, MCP egress | AC-4 Information Flow Enforcement, SC-7 Boundary Protection | PR.AA-05 |
| Observability and usage history | AU-2 Event Logging, AU-12 Audit Record Generation, SI-4 System Monitoring | DE.CM-03 |
Practitioner checklist
- Revoke
USE AI FUNCTIONSandSNOWFLAKE.CORTEX_USERfromPUBLICafter granting named roles. - Remove the bootstrap
CORTEX-MODEL-ROLE-ALLgrant and govern models with model application roles. - Set
CORTEX_ENABLED_CROSS_REGIONexplicitly to your residency policy. - Build Cortex Search services over restricted views with dedicated owner roles.
- Set
orchestration.tool_not_accessibletorejecton sensitive agents and mark production agents secure. - Use OAuth for applications that call the Agents API for end users; never a shared PAT.
- Restrict MCP integrations with allowed prefixes and finite refresh token validity.
- Enable Cortex AI Guardrails for agents where the account qualifies.
- Limit unredacted observability access and alert on its grant.
- Monitor Cortex usage history for per-user spend and model anomalies.
Standards and references
- Snowflake: Cortex AI Functions privileges and model access
- Snowflake: Cross-region inference
- Snowflake: Cortex Agents access control and authentication
- Snowflake: Cortex Agents MCP connectors
- Snowflake: Monitor Cortex Agent requests
- Snowflake: Cortex AI Guardrails
- Snowflake: Cortex Search overview
- Snowflake: Managing AI Function costs with Account Usage
Related NHI Mgmt Group resources: Snowflake Security Guide · Service Accounts in Snowflake Guide · Permission-Aware RAG Guide · MCP Security Guide