Data context and governance

    Horizon and Unity Catalog still won’t tell you which agent ran the query

    Warehouse governance for AI agents means every agent query runs under a role the warehouse can check, filter and log. Snowflake Horizon, Databricks Unity Catalog, BigQuery and Microsoft Fabric each enforce this for the identity that connects. When several agents share one service login, the log names that login, and nobody can say which agent asked.

    By Toby Mather · Published

    Key takeaways

    • Each platform enforces row filters, column masks and access logs for whoever connects, including agents.
    • The audit trail is only as specific as the identity behind the connection, so a shared service account hides the agent.
    • Give every agent its own role, an owner and a call limit before it reaches production data.
    • Keep native policies in the warehouse, and use a gateway for agent identity, purpose and one log across platforms.
    • Agents also need certified metrics, or they will query the right rows and still compute the wrong number.
    1. 01People and agents

      Claude, Cursor, Notion agents, scheduled workflows

    2. 02Gateway

      A role, token, call limit and owner for each agent

    3. 03Platform policies

      Horizon, Unity Catalog, BigQuery and Knowledge Catalog, Fabric and Purview

    4. 04Warehouse data

      Rows and columns the role is allowed to read

    People and agents go through one gateway, which then queries each platform under that caller’s own role.

    What question are you trying to answer about agents?

    A security reviewer will ask three things about any agent on the warehouse: which tables, rows and columns it can read, who is answerable for it, and whether you can find the exact query it sent when an odd number turns up in a report.

    Every major warehouse platform answers the first question well for the identity that connects. The second and third depend on how you connect the agents. If a team sets up one service account called ai_reader and points five agents at it, the warehouse will enforce ai_reader’s policies correctly and log every query as ai_reader, so nobody can tell the revenue assistant from the support bot.

    How does Snowflake Horizon handle agent access?

    Snowflake Horizon Catalog is the governance layer built into Snowflake. Its documentation lists role-based access control, row access policies, masking policies, object tags, automatic classification of sensitive data, column-level lineage and access history. Snowflake states that agents operate under the same role-based access policies as human users, so a row access policy applies whether an analyst or an agent runs the query.

    Access history records one row per SQL statement, with the user who ran it and the columns it read, including columns used only in a filter. If you want that record to name the agent, the agent needs its own Snowflake user or a gateway in front that keeps its own per-agent log. Row access policies and masking are the right place for rules such as “EU staff see EU customers”, because they apply to every tool that connects.

    What does Unity Catalog cover on Databricks?

    Unity Catalog governs data and AI assets on Databricks. Its documentation covers privileges on objects, attribute-based policies, row and column filters, workspace bindings, lineage from source data through to models and dashboards, and an audit log system table that records data access.

    The same identity rule applies. Databricks logs the principal that ran the query, so a per-agent service principal gives you a per-agent record. Metric views are the Databricks way to define business measures once inside Unity Catalog, and we cover what they do and do not give an agent in a separate post on Databricks metric views.

    How do BigQuery and Knowledge Catalog govern queries?

    BigQuery controls access through IAM at project, dataset and table level, then adds row-level access policies, column-level access through policy tags, and data masking on top. A row access policy has a list of grantees and a filter that works like a WHERE clause, and principals who are not on any policy see no rows. Google’s documentation says policies are audit logged by name.

    Google now calls its catalog Knowledge Catalog, formerly Dataplex Universal Catalog. It covers discovery, business context, lineage across systems, data quality scans and policy enforcement. For agents, the practical step is the same as on the other platforms: one service account per agent, so Cloud Audit Logs can tell them apart.

    What do Fabric and Purview add for agents?

    Microsoft Fabric has governance built into the OneLake catalog, with domains, endorsement, tags, lineage and impact analysis. Data-level controls on tables, rows and columns are available for SQL analytics endpoints, warehouses, Direct Lake and KQL databases. Microsoft Purview adds sensitivity labels, data loss prevention and Purview Audit, some of which need separate Purview licensing.

    The Fabric data agent is a useful reference design. Microsoft documents that it runs read-only queries using the requesting user’s identity and permissions, that row-level and column-level security on semantic models still apply, and that its interactions can be logged in Purview Audit. Copy that pattern for any agent you connect, so each one has a known identity, reads only by default and leaves a searchable log.

    What still sits outside the catalog?

    A catalog records what data exists and enforces who may read it. It does not usually record why an agent exists, who owns it, how many calls it should make in a day, or which tools it may use. Those facts decide whether you can switch an agent off quickly after it starts looping on a schedule, or explain to a finance director which agent produced a number.

    The other gap is meaning. An agent with correct row-level access can sum the wrong revenue column. Certified metric definitions, table descriptions and usage rules belong in a context layer that every agent reads, so the governed rows also produce the agreed number.

    • Agent identity: one role and one token per agent, separate from any person’s login.
    • Ownership: a named person answerable for each agent.
    • Limits: a daily call cap and a list of permitted tools.
    • One readable log: agent name, tool and query, across every warehouse you run.
    • Meaning: certified metrics and usage rules the agent reads before it writes SQL.

    How does Rig do it?

    Rig works on Snowflake, BigQuery, Databricks and Postgres and keeps the native policies you already have there. Fabric tables sync into one of those warehouses first, and Gateway’s rules apply at that warehouse. Gateway is Rig’s access product. Each agent gets its own role, copied from a role you already trust and then narrowed, its own token, a daily call cap and a named owner. The agent cannot sign in to Rig as a person, and owners can switch it off with one toggle.

    Every agent call lands in the Gateway audit log with the agent’s name and tool, and refused calls show as errors. Table, column and row rules and PII masking are edited on the agent’s role, and changes reach the agent within about 30 seconds. Rig Map holds the certified metrics, table descriptions and usage rules that agents read over MCP, so governed access and agreed definitions arrive together. Cleo, a Rig customer, runs agents on certified metrics its data team reviews.

    Tools and approaches

    Snowflake Horizon Catalog
    Snowflake’s built-in governance: role-based access, row access and masking policies, tags, classification, lineage and access history. Policies apply to every caller, agents included.
    Databricks Unity Catalog
    Governance for data and AI assets on Databricks, with privileges, attribute-based policies, row and column filters, lineage and an audit log system table.
    BigQuery and Knowledge Catalog
    BigQuery row-level access policies, policy tags and masking, with Knowledge Catalog (formerly Dataplex Universal Catalog) for discovery, lineage and data quality.
    Microsoft Fabric and Purview
    OneLake catalog governance with domains, endorsement and lineage, plus Purview sensitivity labels, data loss prevention and audit. The Fabric data agent queries with the requesting user’s permissions.
    Atlan
    A catalog and governance platform that sits across several warehouses, and publishes guidance on building a governed context layer for AI agents.
    phData
    A Snowflake implementation partner that publishes guidance on Horizon and helps customers set up Snowflake governance, which suits work that is mostly native Snowflake policy design.
    Atrium
    A consultancy with a Snowflake Horizon consulting and implementation practice, covering governance, security and compliance across analytics and AI workloads.

    Common questions

    Does Horizon or Unity Catalog replace a gateway?

    For human users on one platform, native policies may be all you need. A gateway helps when several agents connect, because it gives each agent its own role, owner, call cap and log entry, across every warehouse you run.

    Can one policy cover every platform?

    Each platform stores its policies in its own objects, so a Snowflake row access policy does not apply in BigQuery. A gateway can apply the same agent role across platforms, while each warehouse keeps enforcing its own rules underneath.

    Where should I start if I have two warehouses?

    Start with the warehouse your first agent needs. Give that agent its own role and token, connect it through a gateway, and check the log before you add the second warehouse or a second agent.

    How do I audit an agent’s queries?

    Make sure each agent has its own identity, then read the platform log for that identity, or the gateway log, which shows the agent’s name, tool and every call, including refused ones.

    Should an agent ever use a person’s login?

    No. A personal login gives the agent everything that person can see, and its queries are logged under that person’s name. Use a dedicated agent role with a token instead.

    Sources

    Vendor documentation checked on 20 November 2026. Confirm current features and terms with the vendor.

    About the author

    Toby Mather, Co-founder and CEO, Rig. Toby co-founded Rig after seeing how hard it was for business teams and AI to work with complex internal data. He was previously co-founder and CEO of Lingumi and CPO at Novakid.

    Talk to Rig

    See your stack drawn as one diagram

    An architect drafts a one-page diagram of your warehouse, sources and access path, then offers a 30-minute walkthrough.