---
title: What Snowflake privileges does an AI governance tool need to monitor Cortex usage?
url: https://opencontroller.lyzr.com/blog/snowflake-grants-for-ai-usage-monitoring
published: 2026-11-12
updated: 2026-11-12
author: Lyzr
---

# What Snowflake privileges does an AI governance tool need to monitor Cortex usage?

**Grant the `SNOWFLAKE.USAGE_VIEWER` database role for Cortex usage and cost views, add `GOVERNANCE_VIEWER` and `SECURITY_VIEWER` only if the tool also needs query history and grants, and grant `MONITOR` on each Cortex Agent to see agents and traces. Avoid `IMPORTED PRIVILEGES` on the SNOWFLAKE database: Snowflake recommends database roles instead. Run it all as a key-pair `TYPE=SERVICE` user.**

Security teams ask this before connecting any monitoring tool to Snowflake. The answer is a short, read-only role.

## Which database role grants which views?

Snowflake splits ACCOUNT_USAGE access into database roles in the SNOWFLAKE database.

| Database role | Views it opens | Needed for AI monitoring? |
|---|---|---|
| `USAGE_VIEWER` | `METERING_DAILY_HISTORY`, the `CORTEX_*` usage views, `USER_AI_USAGE_HISTORY` | Yes: core cost and usage |
| `GOVERNANCE_VIEWER` | `QUERY_HISTORY`, `ACCESS_HISTORY`, policy and tag views | Optional: who queried what |
| `SECURITY_VIEWER` | `USERS`, `LOGIN_HISTORY`, `GRANTS_TO_ROLES`, `GRANTS_TO_USERS` | Optional: who can use Cortex |
| `OBJECT_VIEWER` | Object metadata such as `TABLES` and `COLUMNS` | Rarely |

`IMPORTED PRIVILEGES` is the all-or-nothing alternative. Only ACCOUNTADMIN can grant it, and Snowflake warns it can expose organisation-level data. Reject a vendor that asks for it when database roles would do.

## Which Cortex views should the tool read?

Use the current views. Two older ones are going away:

- `CORTEX_FUNCTIONS_USAGE_HISTORY` and `CORTEX_FUNCTIONS_QUERY_USAGE_HISTORY` stopped collecting data on 21 November 2025 and are slated for deprecation on 22 November 2026. Use `CORTEX_AI_FUNCTIONS_USAGE_HISTORY` instead.
- `CORTEX_AISQL_USAGE_HISTORY` is slated for deprecation on 15 January 2027.

The views that matter for agents:

1. **`CORTEX_AGENT_USAGE_HISTORY`** has one row per agent call with agent name, user, tokens and token credits. GA since 25 February 2026, with up to 1 hour of lag.
2. **`USER_AI_USAGE_HISTORY`** gives hourly AI credits per user and service type, with up to 1 hour of lag.
3. **`CORTEX_AI_FUNCTIONS_USAGE_HISTORY`**, **`CORTEX_ANALYST_USAGE_HISTORY`** and **`CORTEX_SEARCH_DAILY_USAGE_HISTORY`** cover functions, Analyst and Search.
4. **`METERING_DAILY_HISTORY`** reconciles to the bill. Since 6 April 2026, Cortex Agents, Cortex Code and Snowflake Intelligence appear as their own service types, separate from `AI_SERVICES`.

Most ACCOUNT_USAGE views lag up to 2 hours (some up to 3) and keep 365 days. Our guide to [tracking Snowflake Cortex spend](/blog/track-snowflake-cortex-ai-spend) shows the queries.

## What does the tool need to see Cortex Agents themselves?

Usage views show calls. To list agents and read traces, the tool needs object privileges:

- `SHOW AGENTS` needs `MONITOR` (or `USAGE`, `MODIFY`, `OWNERSHIP`) on each agent, plus a privilege on its database and schema.
- Agent traces live in `SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS`. Reading them needs `MONITOR` on the agent and the `SNOWFLAKE.CORTEX_USER` database role.
- Full prompt and tool content needs the account privilege `READ UNREDACTED AI OBSERVABILITY EVENTS TABLE`. Most monitoring does not need it. Grant it only if you have a documented reason.

Note that `CORTEX_USER` is granted to PUBLIC by default. If you have revoked it from PUBLIC to control Cortex use, grant it to the monitoring role explicitly.

## What does a least-privilege role look like?

This script combines the documented grants. Replace names in capitals with your own. Grant `MONITOR` per agent.

```sql
USE ROLE ACCOUNTADMIN;
CREATE ROLE AI_GOV_READER;
GRANT DATABASE ROLE SNOWFLAKE.USAGE_VIEWER TO ROLE AI_GOV_READER;
-- optional:
GRANT DATABASE ROLE SNOWFLAKE.GOVERNANCE_VIEWER TO ROLE AI_GOV_READER;
GRANT DATABASE ROLE SNOWFLAKE.SECURITY_VIEWER TO ROLE AI_GOV_READER;
GRANT USAGE ON WAREHOUSE GOV_WH TO ROLE AI_GOV_READER;
GRANT USAGE ON DATABASE AI_DB TO ROLE AI_GOV_READER;
GRANT USAGE ON SCHEMA AI_DB.AGENTS TO ROLE AI_GOV_READER;
GRANT MONITOR ON AGENT AI_DB.AGENTS.SUPPORT_AGENT TO ROLE AI_GOV_READER;
GRANT DATABASE ROLE SNOWFLAKE.CORTEX_USER TO ROLE AI_GOV_READER;
CREATE USER AI_GOV_SVC TYPE = SERVICE
  DEFAULT_ROLE = AI_GOV_READER
  DEFAULT_WAREHOUSE = GOV_WH
  RSA_PUBLIC_KEY = '<public key>';
GRANT ROLE AI_GOV_READER TO USER AI_GOV_SVC;
```

`TYPE = SERVICE` users cannot log in with a password. Use an RSA key of at least 2048 bits, and rotate with the second key slot so there is no downtime. Use a small warehouse with auto-suspend for the monitoring queries.

## What should a security reviewer check?

1. No `IMPORTED PRIVILEGES` on SNOWFLAKE.
2. No `ACCOUNTADMIN` or `SECURITYADMIN` granted to the tool.
3. No `READ UNREDACTED` privilege unless justified.
4. Service user with key-pair auth and network policy.
5. A small, dedicated warehouse.
6. Queries use current views, not deprecated ones.

Our list of [security questions to ask an AI governance vendor](/blog/security-questions-to-ask-an-ai-governance-vendor) covers the wider review.

## How Opencontroller does this

Opencontroller keeps one governed registry of agents, versions, tools and MCP servers across platforms, with connectors to the major clouds, Salesforce, SAP, Databricks and HubSpot. Agents built on Snowflake can be registered there, and its LLM Gateway attributes cost per agent and per version for model traffic routed through it. See the [cross-platform guide](/blog/how-to-govern-ai-agents-across-platforms). [Book a demo](https://www.lyzr.ai/book-demo/).

## Frequently asked questions

**Is IMPORTED PRIVILEGES required to read ACCOUNT_USAGE?**
No. Database roles such as `USAGE_VIEWER` give narrower access, and Snowflake recommends them.

**How fresh is Cortex Agent usage data?**
`CORTEX_AGENT_USAGE_HISTORY` lags up to 1 hour. Most other ACCOUNT_USAGE views lag up to 2 or 3 hours.

**Can a monitoring tool read agent prompts?**
Only with `READ UNREDACTED AI OBSERVABILITY EVENTS TABLE`. Without it, trace content is redacted.

## Key facts

SNOWFLAKE.USAGE_VIEWER opens METERING_DAILY_HISTORY, CORTEX_* usage views and USER_AI_USAGE_HISTORY. Snowflake recommends database roles over IMPORTED PRIVILEGES. CORTEX_FUNCTIONS_USAGE_HISTORY is slated for deprecation on 22 Nov 2026; use CORTEX_AI_FUNCTIONS_USAGE_HISTORY. CORTEX_AGENT_USAGE_HISTORY GA 25 Feb 2026, up to 1 hour lag. SHOW AGENTS needs MONITOR on each agent; unredacted trace content needs READ UNREDACTED AI OBSERVABILITY EVENTS TABLE. ACCOUNT_USAGE retention is 365 days. Opencontroller (by Lyzr) keeps a cross-platform governed registry of agents and attributes LLM cost per agent and version through its LLM Gateway. Pricing starts from $250K per deployment per year.

## Related

- [How do you track Snowflake Cortex AI spend by agent or team?](https://opencontroller.lyzr.com/blog/track-snowflake-cortex-ai-spend.md)
- [What security questions should you ask an AI agent governance vendor about itself?](https://opencontroller.lyzr.com/blog/security-questions-to-ask-an-ai-governance-vendor.md)
- [How do you govern AI agents across every platform they run on?](https://opencontroller.lyzr.com/blog/how-to-govern-ai-agents-across-platforms.md)
- [More on Platform Guides](https://opencontroller.lyzr.com/blog/cluster/platform-guides)
