Snowflake CoWork (Cortex Agents)
Connect Snowflake Cortex Agents to Monte Carlo for Agent Trust: a self-improving loop, Bayes finds what's failing in real conversations, diagnoses why, and proposes the fix.
Monte Carlo's Agent Trust gives you self-improving Snowflake Cortex Agents. Bayes, Monte Carlo's AI teammate, finds what's going wrong in real user conversations, traces each problem to its cause in the agent's setup, and hands your team a fix to review. Setup takes a few grants. There's nothing to deploy and no agent code to change.
What is Snowflake CoWork?
Snowflake CoWork is Snowflake's managed platform for building and deploying AI agents powered by Cortex. Teams can create agents that answer questions, execute SQL, search internal data, and interact with tools — all within Snowflake's environment. Cortex Agents log detailed trace data natively, including conversation history, tool execution, LLM planning, and response generation.
Why Connect Snowflake Cortex Agents to Monte Carlo?
Snowflake records what your agent did. Monte Carlo tells you what's going wrong and how to fix it.
- Finds failures in real conversations. Bayes analyzes and surfaces recurring problems, including quiet ones that return a normal-looking response: retry loops, repeated tool calls, empty answers. You don't need to build a golden dataset first.
- Names the cause in your agent's setup. Bayes checks each problem against the agent's configuration, semantic views, Cortex Search services, and skills, so a finding points to the exact thing to change.
- Hands you a fix, then checks that it worked. Each finding comes with a proposed change for your team to review. After it ships, Bayes watches new conversations to confirm the problem stopped.
- Separates agent problems from data problems. Monte Carlo already monitors your Snowflake data, so a bad answer can be traced back to the tables behind it.
Connecting Snowflake Cortex Agents
Now that we know the value connecting a Snowflake Cortex Agent to Monte Carlo can bring, here are the necessary steps to set up the integration.
- Grant permissions to Monte Carlo's service account in Snowflake.
- Add the agent in Monte Carlo.
PrerequisitesAn existing Snowflake integration in Monte Carlo. Your Snowflake account must be connected to Monte Carlo with a service account configured. If you haven't set this up yet, see our Snowflake integration guide.
You will need permissions to use the
ACCOUNTADMINrole on Snowflake to grant the required access.
Required Snowflake permissions
Monte Carlo's service account needs the following privileges to read your Cortex Agents' trace data and the semantic views, Cortex Search services, and skills they use. See Snowflake's access control documentation for details.
On the agent, to read trace data:
-
MONITORon each agent you want to observe -
The
SNOWFLAKE.CORTEX_USERdatabase role -
READ UNREDACTED AI OBSERVABILITY EVENTS TABLEon the account. Without it, prompts and completions are redacted (Snowflake BCR, April 24, 2026). -
USE AI FUNCTIONSon the account, for Agent Evaluation monitors and Clustering. Only needed if your account has revoked it fromPUBLIC.
On the semantic views and Cortex Search services the agent uses, so Reinforcement Loop can read how they're configured:
-
REFERENCESon each semantic view -
USAGEon each Cortex Search service -
USAGEon their databases and schemas
On the stages and Git repositories that hold the agent's skills, so Reinforcement Loop can read each skill's SKILL.md:
-
READon each stage or Git repository that aSTAGEorGITskill points to. For an external stage, grantUSAGEinstead. -
USAGEon their databases and schemas
Skills with a source of INLINE or SYSTEM need no grant, because their content is in the agent spec or built into Snowflake.
Only the grants on the agent are needed to observe its traces. Monte Carlo also tries to describe the semantic views and Cortex Search services every hour, but only Reinforcement Loop uses what it reads, and traces work without those grants. Access to the agent doesn't include the semantic views, Cortex Search services, or skill stages, so grant them separately. Monte Carlo only describes the semantic views and Cortex Search services. It never queries them or the data underneath. For skills, it reads only each skill's SKILL.md file.
Grant permissions
Run the following to grant everything above, replacing <monte_carlo_role> with your Monte Carlo service account's role. To find the agent's semantic views and Cortex Search services, run DESCRIBE AGENT and check tool_resources for each semantic_view and search_service, and the skills section of the spec for the stage or Git repository behind each skill.
USE ROLE ACCOUNTADMIN;
-- On the agent
GRANT MONITOR ON AGENT <database>.<schema>.<agent_name> TO ROLE <monte_carlo_role>;
GRANT DATABASE ROLE SNOWFLAKE.CORTEX_USER TO ROLE <monte_carlo_role>;
GRANT READ UNREDACTED AI OBSERVABILITY EVENTS TABLE ON ACCOUNT TO ROLE <monte_carlo_role>;
GRANT USE AI FUNCTIONS ON ACCOUNT TO ROLE <monte_carlo_role>;
-- On each semantic view and Cortex Search service
GRANT USAGE ON DATABASE <resource_database> TO ROLE <monte_carlo_role>;
GRANT USAGE ON SCHEMA <resource_database>.<resource_schema> TO ROLE <monte_carlo_role>;
GRANT REFERENCES ON SEMANTIC VIEW <resource_database>.<resource_schema>.<semantic_view_name> TO ROLE <monte_carlo_role>;
GRANT USAGE ON CORTEX SEARCH SERVICE <resource_database>.<resource_schema>.<service_name> TO ROLE <monte_carlo_role>;
-- On each stage or Git repository that holds a skill
GRANT USAGE ON DATABASE <skill_database> TO ROLE <monte_carlo_role>;
GRANT USAGE ON SCHEMA <skill_database>.<skill_schema> TO ROLE <monte_carlo_role>;
-- For a skill with a STAGE source (use USAGE instead of READ for an external stage):
GRANT READ ON STAGE <skill_database>.<skill_schema>.<stage_name> TO ROLE <monte_carlo_role>;
-- For a skill with a GIT source:
GRANT READ ON GIT REPOSITORY <skill_database>.<skill_schema>.<repository_name> TO ROLE <monte_carlo_role>;To cover objects created later in the same schema:
GRANT MONITOR ON FUTURE AGENTS IN SCHEMA <database>.<schema> TO ROLE <monte_carlo_role>;
GRANT REFERENCES ON FUTURE SEMANTIC VIEWS IN SCHEMA <resource_database>.<resource_schema> TO ROLE <monte_carlo_role>;
GRANT USAGE ON FUTURE CORTEX SEARCH SERVICES IN SCHEMA <resource_database>.<resource_schema> TO ROLE <monte_carlo_role>;
GRANT READ ON FUTURE STAGES IN SCHEMA <skill_database>.<skill_schema> TO ROLE <monte_carlo_role>;
GRANT READ ON FUTURE GIT REPOSITORIES IN SCHEMA <skill_database>.<skill_schema> TO ROLE <monte_carlo_role>;Validate permissions
Run these as the Monte Carlo service account role. Each should succeed without error.
-- 1. Verify the agent is visible:
SHOW AGENTS;
-- 2. Verify trace data is accessible:
SELECT * FROM TABLE(
SNOWFLAKE.LOCAL.GET_AI_OBSERVABILITY_EVENTS(
'<database>',
'<schema>',
'<agent_name>',
'CORTEX AGENT'
)
);
-- 3. list the semantic views and Cortex Search services the agent uses.
-- In the returned spec, read tool_resources: a semantic_view for each
-- Cortex Analyst tool, a search_service for each Cortex Search tool.
DESCRIBE AGENT <database>.<schema>.<agent_name>;
-- 4. Confirm each semantic view can be described:
DESC SEMANTIC VIEW <resource_database>.<resource_schema>.<semantic_view_name>;
-- 5. Confirm each Cortex Search service can be described:
DESCRIBE CORTEX SEARCH SERVICE <resource_database>.<resource_schema>.<service_name>;
-- 6. Confirm each skill's SKILL.md can be read (use the stage or Git repository
-- and path named in the skill's spec):
SELECT $1 FROM @<skill_database>.<skill_schema>.<stage_name>/<skill_path>/SKILL.md;A does not exist or not authorized error on a semantic view, Cortex Search service, stage, or Git repository that exists means the Monte Carlo role is missing the grant.
Adding the agent in Monte Carlo
- In Monte Carlo, navigate to Settings → Agent Observability
- Click Add
- Choose Snowflake as the platform type
- Select a Domain for the agent to be assigned to
- Select a Snowflake Warehouse: Choose the warehouse where your target Cortex Agent(s) are available
- Select an Agent: Once the warehouse is selected, Monte Carlo will discover available Cortex Agents that it has permissions to access. Select the agent by its name
- Click Import to complete the connection
Next steps
Monte Carlo starts reading traces right away. Two things from here:
- Schedule a Reinforcement Loop digest. Open the agent, click Subscribe to digest on its issues list, and pick a cadence and an audience with an email or Slack recipient. Your team gets each finding wherever you work: what's breaking, why, and the proposed fix.
- Leave monitor setup to Bayes. After about a day of traces, Bayes sets up monitoring across context, performance, behavior and output. For a rule of your own, like a latency SLA, describe it to Bayes or build one yourself.
Updated 4 days ago
