Initial Snowflake Setup
Before we jump into making our snowflake agent, lets go through the initial setup.
Auth Setup
- To connect to snowflake you’ll need a credal admin at your organization to add org-wide snowflake credentials.
- To help them prepare with adding in credentials you can:
1. Create the CREDAL_READ role in snowflake which will control read access to tables/views.
2. Create a new User that is granted the CREDAL_READ role
3. Setup Snowflake key pair authentication
- Follow this guide to setup key-pair auth: Snowflake Key Pair Auth
4. Get a credal admin at your organization to add the snowflake credentials
- They will need the
Subdomain
,Account Identifier
,Username
,Private Key
andSHA-256 Fingerprint
to add the snowflake connection.
Implementation Steps
Step 1: Create Your Agent
- Navigate to the Agents page and click “Create New Agent”
- Name your agent “Snowflake Data Extractor”
- Add this description:
This assistant helps employees query data from snowflake getting metrics, analysis and human-readable responses on the data.
- Enable Code Interpreter
Output from the runSnowflakeQuery Action is passed into Open AI Code Interpreter for analysis, meaning your copilot must be using an OpenAI foundational model compatible with Code Interpreter

Tip: A detailed description helps users understand the purpose of your Agent.
Step 2: Create the runSnowflake Action
- Database: the default database to use when querying
- Warehouse: the compute warehouse to run your queries (will likely be hardcoded)
- Query: Depends on whether you take the Query Templates Approach or the Snowflake Views approach (explained more in next steps)
- Username: Username of the account that is setup with Key-Pair authentication
- Account Name: Your snowflake account name (will likely be hardcoded)
- Format: The format of your output
csv
orjson
(prefercsv
)
Step 3: Choose your approach
Right now there are 2 approaches to querying snowflake for data
-
1. Query Templates
-
2. Snowflake Views
Each one has their own pros and cons and will likely be usecase dependant. Read about each approach and implementation steps in the Query Approaches