All posts

Putting access controls around Claude: database access for AI coding agents (on Snowflake)

Many teams assume that giving Claude a static Snowflake credential is safe for database access because the model only reads data it needs. The reality is that an AI coding agent can issue any query its token permits, and a leaked credential instantly grants unlimited read and write rights. When Claude talks directly to Snowflake, the connection bypasses every control layer. The credential lives in a configuration file, the agent reuses it for every request, and no one sees which tables were que

Free White Paper

Snowflake Access Control + AI Model Access Control: The Complete Guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free. No spam. Unsubscribe anytime.

Many teams assume that giving Claude a static Snowflake credential is safe for database access because the model only reads data it needs. The reality is that an AI coding agent can issue any query its token permits, and a leaked credential instantly grants unlimited read and write rights.

When Claude talks directly to Snowflake, the connection bypasses every control layer. The credential lives in a configuration file, the agent reuses it for every request, and no one sees which tables were queried or which rows were returned. If an engineer forgets to rotate the secret, the exposure persists indefinitely.

Why the naïve setup fails to protect database access

In the first stage, teams create a service account in Snowflake, grant it broad SELECT, INSERT, and UPDATE rights, and embed the key in Claude’s runtime environment. This gives the agent standing access that never expires and never requires approval. The data path runs straight from Claude to Snowflake, so there is no place to inspect queries, mask PII, or enforce least‑privilege at the moment of execution.

Even if the organization adopts a non‑human identity model, using a dedicated service account instead of a personal user, and limits that identity to the Snowflake database, the request still reaches the target directly. The gateway that could enforce policy is missing, so the system cannot block a destructive command, cannot require a manager’s sign‑off for a bulk delete, and cannot redact credit‑card numbers from result sets. Auditors also see no session logs that tie a particular Claude output to an individual engineer’s request.

How hoop.dev secures database access for Claude

hoop.dev resolves the gap by inserting a Layer 7 gateway between Claude and Snowflake. The gateway runs a network‑resident agent that holds the Snowflake credential. Claude authenticates to hoop.dev with an OIDC token, and hoop.dev validates the token, extracts group membership, and then proxies the request to Snowflake on Claude’s behalf.

Because hoop.dev sits in the data path, it can enforce every control that the naïve setup lacks:

  • Just‑in‑time access: hoop.dev grants Claude a short‑lived session token only for the duration of the request.
  • Inline masking: when a query returns columns marked as sensitive, hoop.dev redacts those fields before they reach Claude.
  • Approval workflows: a query that matches a “dangerous” pattern, such as DROP TABLE or mass UPDATE, triggers a human approval step before the command is sent to Snowflake.
  • Command blocking: policies can outright reject statements that exceed defined risk thresholds.
  • Session recording: every request and response is logged, enabling replay for forensic analysis.

All of these outcomes happen because hoop.dev is the only point where traffic is inspected. The Snowflake service never sees Claude’s raw token, and the credential never leaves the gateway.

Continue reading? Get the full guide.

Snowflake Access Control + AI Model Access Control: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

Getting started with hoop.dev and Claude

Begin with the getting‑started guide to deploy the gateway. Register Snowflake as a connection, supply the service‑account key to hoop.dev, and define a policy that masks columns like email and ssn. Next, configure Claude to point at the hoop.dev endpoint instead of the Snowflake endpoint. The gateway will handle authentication, enforce the policies you created, and record each interaction.

The feature documentation provides deeper examples of policy language, approval routing, and masking rules. For teams that prefer to inspect the source, the full repository is available on GitHub.

Designing policies for Claude

Effective policies start with a clear inventory of the data Claude needs to generate code. Identify columns that contain personal identifiers, financial data, or other regulated information, and mark them for inline masking. Then define risk thresholds for statements that modify schema or bulk‑update rows. By coupling those thresholds with approval steps, you ensure that only vetted changes reach Snowflake.

Because hoop.dev evaluates each statement in real time, you can tighten or relax rules without redeploying the agent. This flexibility is essential for AI workloads that evolve quickly yet must remain under strict governance.

FAQ

Does hoop.dev store my Snowflake credentials?

Yes, the gateway stores the credential securely and presents it only to Snowflake after a request has been authorized. Claude never sees the secret.

Can I still use existing OIDC providers?

Absolutely. hoop.dev acts as a relying party for any OIDC or SAML provider, so you can keep your existing identity platform.

What happens if a query is blocked?

hoop.dev returns a clear denial response to Claude, logs the event, and optionally notifies a designated approver for further review.

How does hoop.dev support audit retention?

All session recordings and policy decisions are persisted by the gateway. Those logs can be integrated with your organization’s log‑aggregation or SIEM system, providing the evidence auditors need for database‑access reviews.

Secure your AI‑driven workloads with granular database access controls today. Explore the source code and contribute on GitHub.

Open source

Save the open-source gateway for agent data access

Hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.

Star and save the repo →More posts