Want an AI agent querying Snowflake in the next few minutes without leaving a permanent credential behind? This is the short path. Just-in-time access means the agent gets a connection for the task and nothing afterward, so the fastest safe setup is also the one with the smallest standing footprint.
No standing role, no password baked into the agent image, no live path sitting open at 3am. The grant opens when the agent asks, closes when the task ends, and every statement in between is recorded. Here is the minimal first connection.
Connect Snowflake to the gateway
hoop.dev is an open-source Layer 7 access gateway. Register Snowflake as a connection once. From then on, engineers and AI agents query real Snowflake data through hoop.dev, and the gateway brokers access as the session principal so the agent holds no permanent warehouse credential.
You give the gateway the warehouse host, the role to broker with, and the credential one time. After that the connection is a named target your agents request by name, never by holding the secret. The credential lives at the gateway, not in the agent image, not in an environment variable, not in a config file that follows the agent around. That separation is what lets access be granted and revoked per task instead of per deploy.
Make the agent's grant just-in-time
Configure the agent's access as time-bound rather than permanent. Access opens when the agent requests a session and closes when the session ends. That single setting is what turns a standing grant into just-in-time access.
- Authenticate the agent to the gateway through your identity provider over the MCP server.
- Scope the session to one schema, the one the task needs.
- Run the query inside the session.
- Let the session close. The path is gone until the next request.
Run the first query
SELECT order_id, status FROM ops.orders WHERE status = 'pending';The agent gets its results, the session is recorded at the gateway, and when it ends there is no live Snowflake connection left in the agent's environment. That is the minimal loop: request, query, close.
