To enable Agent Security prompt analysis and AI discovery for Snowflake Cortex, Cyera needs read-only visibility into your Cortex usage - the agents and search services that exist, the AI telemetry Snowflake records about them, and the prompt text sent to your Cortex Agents.
Notes:
- This process must be completed separately for each Snowflake account. Grants are account-scoped - an organization with several accounts needs one deployment per account.
- Prompt-level analysis depends on Snowflake's AI Observability already producing events for your Cortex Agents. Cyera reads what Snowflake has written; it does not intercept traffic.
This is achieved by granting the Cyera role (CYERA_ROLE) a small set of read-only privileges in your Snowflake account:
-
Account telemetry -
ACCOUNT_USAGEviews covering AI/Cortex invocations, AISQL usage, Cortex Search and Agent usage history, classifications, and AI credit spend. -
Cortex object inventory -
USAGEon the databases and schemas that hold your Cortex Agents and Cortex Search Services. -
Agent prompt access - read access to
SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS, where Snowflake stores the prompts sent to your Cortex Agents.
Cyera does not modify data, agents, services, or settings in your account, and does not request SELECT on your business tables.
Prerequisites
Before you begin, ensure you have:
- A Cyera tenant with Agent Guardian enabled, and the Snowflake account already onboarded to Cyera DSPM. For details, see Onboarding a Snowflake Account.
- An operator with the
ACCOUNTADMINrole (or a role that can create roles and apply account-wide andFUTUREgrants). - A warehouse you can use in a Snowflake worksheet
Deployment options
There are two ways to grant the access. Both produce the same end state.
-
Option A - Deployment script (automatic) - recommended. Run the attached
deploy.sqlasACCOUNTADMIN. It applies every grant toCYERA_ROLE, verifies them, and reports the result back to Cyera. GrantsUSAGEon all standard databases in the account. - Option B - Manual grants - run the statements yourself, one section at a time. Use this if you want to review each grant, or scope the deployment to specific databases.
Option A - Deployment script (automatic)
What the script does
-
Runs the deployment - applies the account-level grants (
IMPORTED PRIVILEGES,GOVERNANCE_VIEWER,USAGE_VIEWER, and the AI Observability grants for prompt access) and the per-database grants (USAGEon the database, and on all current and future schemas, Cortex Search Services, and Agents) for every standard database exceptSNOWFLAKEandSNOWFLAKE_SAMPLE_DATA. -
Verifies and reports - checks that each grant landed, runs read-only
COUNT(*)queries asCYERA_ROLEagainst the telemetry views, and postsstarted/finished/failedevents to Cyera.
Run the script
- Download deploy.sql from the Attachments section.
- Open a Snowflake worksheet, select
ACCOUNTADMINas the role and select a warehouse. - Paste the entire contents of
deploy.sqland Run All. -
Read the summary the procedure returns - for example:
Granted CYERA_ROLE read access across 12/12 databases. Permissions: 6/6 verified. Data access: 11/12 checks passed.
Option B - Manual
Run all statements below as ACCOUNTADMIN. Step 1 is required; Step 2 is optional and adds prompt-level analysis.
USE ROLE ACCOUNTADMIN;
Step 1 - Core grants
These grants let Cyera read Snowflake telemetry about your AI usage, inventory your Cortex Agents and Search Services, and surface sensitive-data classifications.
ACCOUNT_USAGE telemetry
Unlocks Snowflake's ACCOUNT_USAGE views - Cyera reads AI/Cortex SQL invocation logs, AISQL usage, Cortex Search/Agent usage history, classifications, and AI credit spend.
GRANT IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE TO ROLE CYERA_ROLE;
Built-in viewer roles
Two ACCOUNT_USAGE views are gated behind built-in database roles under the SNOWFLAKE database.
GRANT DATABASE ROLE SNOWFLAKE.GOVERNANCE_VIEWER TO ROLE CYERA_ROLE; -- DATA_CLASSIFICATION_LATEST (Horizon) GRANT DATABASE ROLE SNOWFLAKE.USAGE_VIEWER TO ROLE CYERA_ROLE; -- METERING_DAILY_HISTORY (AI credits)
Per-database grants (Cortex objects)
First, find which databases contain Cortex Agents or Search Services:
SHOW AGENTS IN ACCOUNT; SHOW CORTEX SEARCH SERVICES IN ACCOUNT;
Then for each of those databases, run this block:
-- The database itself GRANT USAGE ON DATABASE <db_name> TO ROLE CYERA_ROLE; -- All schemas in the database (current + future) GRANT USAGE ON ALL SCHEMAS IN DATABASE <db_name> TO ROLE CYERA_ROLE; GRANT USAGE ON FUTURE SCHEMAS IN DATABASE <db_name> TO ROLE CYERA_ROLE; -- All Cortex Search Services in the database (current + future) GRANT USAGE ON ALL CORTEX SEARCH SERVICES IN DATABASE <db_name> TO ROLE CYERA_ROLE; GRANT USAGE ON FUTURE CORTEX SEARCH SERVICES IN DATABASE <db_name> TO ROLE CYERA_ROLE;
Step 2 - Cortex Agent prompt access (optional)
This step lets Cyera inspect the prompt text sent to your Cortex Agents
USE ROLE ACCOUNTADMIN; GRANT APPLICATION ROLE SNOWFLAKE.AI_OBSERVABILITY_READER TO ROLE CYERA_ROLE; GRANT APPLICATION ROLE SNOWFLAKE.AI_OBSERVABILITY_EVENTS_LOOKUP TO ROLE CYERA_ROLE; GRANT READ UNREDACTED AI OBSERVABILITY EVENTS TABLE ON ACCOUNT TO ROLE CYERA_ROLE;
Verification
Option A runs these checks for you and reports the results to Cyera. Run them manually if you used Option B, or any time you want to re-confirm the access.
Run as CYERA_ROLE with secondary roles disabled. This ensures the test reflects only what CYERA_ROLE itself can do - without it, an admin user's other roles can mask whether the grants actually landed.
USE ROLE CYERA_ROLE; USE SECONDARY ROLES NONE; USE WAREHOUSE <warehouse_name>;
Core access
-- a) ACCOUNT_USAGE telemetry SELECT COUNT(*) FROM SNOWFLAKE.ACCOUNT_USAGE.CORTEX_AGENT_USAGE_HISTORY; -- b) GOVERNANCE_VIEWER works SELECT COUNT(*) FROM SNOWFLAKE.ACCOUNT_USAGE.DATA_CLASSIFICATION_LATEST; -- c) USAGE_VIEWER works SELECT COUNT(*) FROM SNOWFLAKE.ACCOUNT_USAGE.METERING_DAILY_HISTORY WHERE SERVICE_TYPE = 'AI_SERVICES'; -- d) Inventory + per-object describe SHOW AGENTS IN ACCOUNT; SHOW CORTEX SEARCH SERVICES IN ACCOUNT; DESCRIBE AGENT <db>.<schema>.<agent_name>; DESCRIBE CORTEX SEARCH SERVICE <db>.<schema>.<service_name>; -- e) Per-object grant inspection + account-level Cortex parameters SHOW GRANTS ON AGENT <db>.<schema>.<agent_name>; SHOW GRANTS ON CORTEX SEARCH SERVICE <db>.<schema>.<service_name>; SHOW PARAMETERS LIKE 'CORTEX%' IN ACCOUNT;
Prompt access
SELECT COUNT(*) FROM SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS WHERE timestamp >= DATEADD(day, -7, CURRENT_TIMESTAMP());
All queries should return without error. A count of 0 means the grant works but Snowflake has recorded no events - see Is prompt data being captured? below. If any query fails, paste the error to your Cyera contact.
Is prompt data being captured?
Prompt-level analysis depends on Snowflake's AI Observability writing agent events in your account. These two checks tell you whether it is. Run them as ACCOUNTADMIN.
Are agent events being saved?
SELECT COUNT(*) FROM SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS WHERE scope:"name"::string = 'snow.cortex.agent' AND timestamp >= DATEADD(day, -30, CURRENT_TIMESTAMP());
-
> 0→ observability is producing events. ✅ -
= 0→ no Cortex Agents are running, or AI Observability isn't enabled.
Are prompts captured inside those events?
SELECT COUNT(*) FROM SNOWFLAKE.LOCAL.AI_OBSERVABILITY_EVENTS WHERE scope:"name"::string = 'snow.cortex.agent' AND record:"name"::string = 'CORTEX_AGENT_REQUEST' AND value:"snow.ai.observability.request_body":messages[0].content[0].text IS NOT NULL AND timestamp >= DATEADD(day, -30, CURRENT_TIMESTAMP());
-
> 0→ prompts are present and our scanner can read them. ✅ -
= 0→ events exist but prompt bodies aren't captured.
If counts are 0
AI Observability is enabled by default for Cortex Agents in modern Snowflake editions - there is no account-wide toggle to flip.
- Confirm Cortex Agents exist:
SHOW AGENTS IN ACCOUNT; - For each agent, run
DESCRIBE AGENT <db>.<schema>.<agent>;and verify observability isn't disabled in its definition. - Trigger a new agent invocation and re-run the checks above after ~30 seconds.
- If still
0, escalate to Snowflake support.
Revoking access
To remove Cyera's access, run as ACCOUNTADMIN:
-- Core grants REVOKE IMPORTED PRIVILEGES ON DATABASE SNOWFLAKE FROM ROLE CYERA_ROLE; REVOKE DATABASE ROLE SNOWFLAKE.GOVERNANCE_VIEWER FROM ROLE CYERA_ROLE; REVOKE DATABASE ROLE SNOWFLAKE.USAGE_VIEWER FROM ROLE CYERA_ROLE; -- Prompt access (if granted) REVOKE APPLICATION ROLE SNOWFLAKE.AI_OBSERVABILITY_READER FROM ROLE CYERA_ROLE; REVOKE APPLICATION ROLE SNOWFLAKE.AI_OBSERVABILITY_EVENTS_LOOKUP FROM ROLE CYERA_ROLE;
The per-database USAGE grants (databases, schemas, search services, agents) can be left in place - they only expose object existence, not data - or revoked with the matching REVOKE USAGE ON … statements.
If you deployed with Option A, you can also remove the objects the script created:
DROP PROCEDURE IF EXISTS DEPLOY_CYERA_CORTEX_ACCESS(STRING, STRING, STRING, BOOLEAN); DROP PROCEDURE IF EXISTS CYERA_VERIFY_DATA_ACCESS(STRING); DROP EXTERNAL ACCESS INTEGRATION IF EXISTS cyera_webhook_access; DROP SECRET IF EXISTS cyera_webhook_secret; DROP NETWORK RULE IF EXISTS cyera_webhook_rule; -- Optional: remove the role entirely DROP ROLE IF EXISTS CYERA_ROLE;
Attachments
-
deploy.sql - the deployment script used in Option A. Creates
CYERA_ROLE, applies all grants, verifies them, and reports deployment status to Cyera.