All posts

Non-human identity vs shared service accounts: which actually controls AI agent risk (on Snowflake)

Many assume that simply swapping a shared password for a non-human identity eliminates the danger of an AI‑driven workload on a data warehouse. The reality is more nuanced: the credential type is only one piece of the puzzle. In most organizations, Snowflake is accessed by an AI agent that runs batch jobs, generates reports, or powers downstream analytics. Teams often create a single service account, store its password in a vault, and give that account read‑write rights across many schemas. The

Free White Paper

Non-Human Identity Management + AI Agent Security: The Complete Guide

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

Free. No spam. Unsubscribe anytime.

Many assume that simply swapping a shared password for a non-human identity eliminates the danger of an AI‑driven workload on a data warehouse. The reality is more nuanced: the credential type is only one piece of the puzzle.

In most organizations, Snowflake is accessed by an AI agent that runs batch jobs, generates reports, or powers downstream analytics. Teams often create a single service account, store its password in a vault, and give that account read‑write rights across many schemas. The agent authenticates with the static secret, opens a long‑lived connection, and executes arbitrary SQL without any human eyes on the activity. Because the same credential is reused for weeks or months, any compromise – whether through credential leakage, insider misuse, or a compromised container – instantly grants unfettered access to the entire warehouse.

This pattern leaves three glaring gaps. First, there is no notion of who actually triggered a query; the audit log only shows the service account name. Second, because the connection is direct, Snowflake itself cannot enforce runtime policies such as masking personally identifiable information or blocking dangerous DDL statements. Third, there is no approval workflow; a new model or a costly data‑export can be introduced without any checkpoint.

Switching to a non‑human identity, for example an OIDC client or a SAML‑asserted service principal, addresses the authentication side. The agent receives a short‑lived token that is tied to a specific workload, and the token can be scoped to the exact objects it needs. This eliminates credential reuse and makes revocation easier. However, the request still travels straight from the agent to Snowflake. The data path remains unchanged, so the same three gaps persist: Snowflake sees only a valid token, not the policy engine that could inspect each query, mask columns, or require a human sign‑off before a schema change.

In other words, non‑human identity solves who can connect, but it does not solve what happens once the connection is established. The enforcement point must sit where the traffic flows, not merely at the authentication boundary.

Why the data path matters for AI‑driven workloads

When an AI agent talks directly to Snowflake, the database itself is the only gatekeeper. Snowflake’s native role‑based access control can limit which objects are visible, but it cannot apply fine‑grained, context‑aware rules such as:

  • Masking credit‑card numbers in query results unless the requester has a finance role.
  • Blocking DROP TABLE statements unless they have passed an approval step.
  • Recording every statement for replay in case of a data‑leak investigation.

All of these controls require a proxy that can inspect the wire‑protocol, understand the semantics of each command, and intervene before the database processes it. That proxy is the only place you can reliably enforce just‑in‑time (JIT) approvals, inline masking, and immutable session recording.

Why non-human identity alone is insufficient

Even with short‑lived tokens, Snowflake cannot enforce runtime policies on its own. Without a gateway, the AI workload retains the ability to run any statement its role permits, and there is no central point to apply masking, approval, or command blocking. The gap leaves organizations exposed to accidental data exfiltration or destructive changes.

Continue reading? Get the full guide.

Non-Human Identity Management + AI Agent Security: Architecture Patterns & Best Practices

Free. No spam. Unsubscribe anytime.

hoop.dev as the enforcement layer

hoop.dev is a Layer 7 gateway that sits between the AI agent (or any non‑human identity) and Snowflake. The gateway terminates the client connection, validates the OIDC/SAML token, maps the token’s groups to policy rules, and then forwards the request to Snowflake only after applying the configured guardrails. Because hoop.dev is in the data path, it can:

  • Record each query and associate it with the originating workload, creating a replayable audit trail.
  • Mask sensitive columns in real time, ensuring that downstream services never see raw PII.
  • Require just‑in‑time approval for high‑risk commands such as CREATE TABLE AS SELECT that could materialize large data sets.
  • Block disallowed statements before they reach Snowflake, preventing accidental data loss.

All of these outcomes exist only because hoop.dev sits in the data path. If you removed the gateway, the AI agent would again have unrestricted access, even if it still used a non‑human identity.

Integrating non‑human identity with hoop.dev

hoop.dev acts as an OIDC relying party. When the AI workload starts, it obtains a short‑lived token from the corporate IdP. hoop.dev validates that token, extracts the workload’s group memberships, and then enforces the policy attached to those groups. Because the token is short‑lived, compromised credentials expire quickly, and because hoop.dev enforces policies on every request, you get continuous protection without changing the agent’s code.

This model satisfies both the identity‑centric and the data‑centric requirements:

  • Setup: define a service principal in your IdP, grant it the minimal Snowflake role, and configure hoop.dev to trust the IdP.
  • Data path: all traffic passes through hoop.dev, where the guardrails live.
  • Enforcement outcomes: hoop.dev records sessions, masks data, requires approvals, and blocks unsafe commands.

Benefits for compliance and risk management

Because hoop.dev records each AI‑driven query, auditors can trace exactly which workload accessed which data and when. The inline masking feature helps you meet data‑privacy obligations without building custom application logic. Just‑in‑time approvals give you a safety net for destructive operations, reducing the blast radius of a mis‑behaving model.

In practice, teams that combine non‑human identity with hoop.dev see a measurable drop in accidental data exposure incidents and a clearer audit trail for regulatory reviews.

Getting started

To try this pattern, follow the getting‑started guide and review the feature documentation for policy definitions, JIT approval workflows, and masking rules. The repository contains example configurations for Snowflake and for common AI workloads.

FAQ

Q: Do I still need Snowflake roles if I use hoop.dev?
A: Yes. Roles define the baseline privileges. hoop.dev adds runtime enforcement on top of those base rights.

Q: Can hoop.dev work with existing service accounts?
A: It can, but you lose the benefits of short‑lived tokens. The recommended approach is to replace long‑lived passwords with non‑human identities and let hoop.dev handle the rest.

Q: Does hoop.dev store any Snowflake credentials?
A: The gateway holds the credential needed to connect to Snowflake, but it never exposes it to the client. All access is mediated through the gateway.

Explore the source code on GitHub to see how the proxy is built and to contribute improvements.

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