Snowflake
Let agents run SQL against your Snowflake account through its SQL API.
Connect it with: API key. Snowflake's own documentation: https://docs.snowflake.com/en/developer-guide/sql-api/authenticating.
What agents can do
Connect Snowflake so the agents working your tasks can reach it. With it connected, they can:
- Run read-only SQL to answer questions about your data, for example revenue by month or the newest sign-ups.
- Inspect databases, schemas, tables and column types before writing a migration or a dbt model.
- Check that a pipeline loaded today's rows, and report the counts in the task.
- Run the SQL an agent wrote for a report and attach the result.
Before you start
- A Snowflake user that may create a programmatic access token. Snowflake requires the user to be covered by a network policy before it issues one, unless an admin has relaxed that rule for the user.
- A role for agents, granted USAGE on the warehouse and SELECT on what they should read. Grant no more: the token can do whatever that role can.
- Your account identifier in the orgname-accountname form. The older locator form with a region (xy12345.us-east-1) does not fit this field.
- A Jaah account. Anyone can add a personal secret; an organization secret needs an Org Owner or Admin.
Connect with Snowflake
Jaah connects to Snowflake with an API key, not with a sign-in button.
Connect with an API key
Find each value first:
- Account identifier: In Snowsight, select your name (bottom left) > Connect a tool to Snowflake > Account/Server URL tab: copy the Account Identifier, written orgname-accountname (a hyphen, not a dot; write any underscore in the account name as a hyphen).
- Programmatic access token: In Snowsight, open Governance & security > Users & roles, select the agents' user > Programmatic access tokens > Generate new token; choose the role agents should use and an expiry, then copy the token (it is shown once).
- Warehouse (optional): The warehouse agents run queries on (Snowsight > Compute > Warehouses); blank uses the user's default warehouse.
- Role (optional): The role to run queries as; blank uses the token's role.
Then add it to Jaah:
- In Jaah, open Secrets, select New, and pick the Snowflake card.
- Name the secret and choose who can use it.
- Fill in Account identifier, Programmatic access token, Warehouse, Role.
- Select Save. Jaah tests the secret straight away (see Test the connection).
Jaah encrypts what you type and never shows it again — not to you, and not to an admin.
Use your own OAuth app
Not used: Jaah connects to Snowflake with an API key, not through an OAuth app.
Test the connection
Select Test on the secret. Jaah calls Snowflake's API once (POST https://<Account identifier>.snowflakecomputing.com/api/v2/statements) with the stored values, and shows whether Snowflake accepted it, or which value Snowflake refused and the status it answered. Jaah also tests automatically when you save or reconnect.
The last result and its time stay on the secret's page, so you can see whether it still works without testing again.
Who can use it
Every secret has an owner, and the owner decides who can use it:
- Personal — only your own tasks can use it. This is the default.
- Organization — every task in the organization can use it. Only Org Owners and Admins can choose this.
- Attached to a project — every task on that project can use it, whoever started the task. See Attach a secret to a project.
More on owners and access: How secrets work.
Use it in an agent session
An agent asks for the secret with its credential_get tool, by the secret's path, when it needs it, and gets the values for that one call. The path is the owner's prefix and the secret's name:
org/<name>for an organization secret,projects/<project>/<name>for one attached to a project,me/<name>for your personal one.
A key connection hands the agent its fields: account, token, warehouse, role.
Tell the agent in your task description which secret to use, for example “use the Snowflake secret org/snowflake”.
Manage, rotate or disconnect
Everything is on the secret's page under Secrets:
- Rotate a key: create a new key at the vendor first, then select Replace on the secret and paste it. Revoke the old key at Snowflake once the test passes. Steps: Replace or delete a secret.
- Disconnect: select Delete. The stored values are destroyed and agents lose access on their next call. To end access at Snowflake's side too, revoke or delete the key at Snowflake.
Limitations
- Jaah tests with
SELECT 1. It proves the token and account are right, not that the role can read a given table. - Only programmatic access tokens are supported here. Key-pair (JWT) and OAuth sign-in to Snowflake are not.
- A programmatic access token expires (15 days by default, at most a year, as the admin set). Rotate it before then.
- Queries run on a warehouse and use its credits. Give agents a small warehouse with auto-suspend.
- Agents can do only what the connected Snowflake account allows.
Troubleshooting
Test says Snowflake rejected the programmatic access token (401)
Generate a new token: it may have expired or been revoked. Check that the user is covered by a network policy that allows Jaah's address, which Snowflake requires before it accepts a token.
Test says the account identifier must be a single name
Use the orgname-accountname form from Connect a tool to Snowflake, with a hyphen. Do not paste the whole URL or the locator with a region.
Test says Snowflake returned HTTP 422
Snowflake could not run SELECT 1, most often because the user has no default warehouse. Set one with ALTER USER USER_NAME SET DEFAULT_WAREHOUSE = WAREHOUSE_NAME and grant the token's role USAGE on it.
Test passes but a query fails with 'No active warehouse selected'
Fill in Warehouse, or set a default warehouse on the user with ALTER USER USER_NAME SET DEFAULT_WAREHOUSE = WAREHOUSE_NAME.
A query fails with 'does not exist or not authorized'
Grant the token's role USAGE on the database and schema and SELECT on the table, then try again.
Still stuck? Select Test and read the result: it names the value Snowflake refused and the status it answered.
FAQ
Can agents change data?
Only if the token's role may. Use a role with SELECT grants only to keep agents read-only.
Which Snowflake regions and clouds work?
All of them. The account identifier already says where the account lives.
Can Jaah or an admin see the key or token?
No. Jaah stores it encrypted and never shows it again. Only the tasks allowed to use the secret receive it, at the moment they ask for it.
Can I connect more than one Snowflake account?
Yes. Add one secret per account, each with its own name, and tell the agent which one to use.