SPICEDB + SNOWFLAKE
How SpiceDB Makes Snowflake Row-Level Security Easier to Get Right
Snowflake row access policies decide which rows every query returns, and Snowflake enforces them everywhere. The hard part is the mapping table behind the policy: who should see what. SpiceDB works that out from relationships and keeps the table current.
Last reviewed November 2026. Try the interactive demo.
Short answer
SpiceDB doesn't replace Snowflake row access policies; it makes them easier to run correctly. Snowflake stays the enforcement point on every query. SpiceDB becomes the source of truth for who can see what, computed from relationships such as region hierarchies, partner companies, deal teams and access that expires. A sync keeps a narrow entitlement table in Snowflake current, so the policy itself stays a single, fast lookup.
What Snowflake row access policies do well
A row access policy is a schema-level object that decides whether each row of a table or view is visible. Snowflake applies it to SELECT statements and to the rows selected by UPDATE, DELETE and MERGE, and it is a strong design:
- Enforced inside the warehouse. Every query from every tool goes through the policy, including Snowsight, BI dashboards and AI features.
- Written once, applied widely. One policy can protect many tables and views across databases and schemas.
- Separation of duties. A governance team owns the policy, not each table owner, and Snowflake evaluates it with the policy owner’s role, so users never need access to the mapping table itself.
- Mapping tables for real entitlements. A policy can look the current user up in a mapping table, and you can update that table without changing the policy.
- Room for AI agents. Policies can check whether an agent is active in the session and hide rows accordingly.
For rules that depend on a role or a single attribute, a row access policy on its own is the right answer.
Where it gets hard: the mapping table
Real entitlements rarely fit a role or a single column. A regional vice president sees every property in her region, including regions nested inside it. An operating partner sees only the properties it runs. A deal team sees an acquisition target for a few weeks. An external auditor’s access should end when the engagement does. All of that has to become rows in a mapping table, and Snowflake leaves computing those rows to you.
- Someone has to flatten the hierarchy. Usually that means a scheduled job that joins HR, CRM and spreadsheet data into user-to-row pairs. When a region moves or a manager changes, the rows are wrong until the job runs again.
- Exceptions pile up. Partner access, deal teams and audits are often added by ticket, and removing them depends on someone remembering.
- Policies are meant to stay simple. Snowflake’s own guidance is that mapping-table lookups can be slower than simple expressions, that fewer lookups perform better, and that subqueries in a policy body may cause errors. Pushing hierarchy logic into the policy works against that advice.
- “Who can see this, and why?” is hard to answer. Snowflake notes that it has no default mechanism to show the data a given user can access; administrators assume the user’s role and run a query, and reconstructing past access means time-traveling the mapping table.
- The rules live only in the warehouse. The application, the API and the AI assistant that read the same data need the same rules, implemented again somewhere else.
What SpiceDB adds
SpiceDB is an open-source permissions database inspired by Google’s Zanzibar. Instead of storing the flattened answer, it stores the facts, such as Avery leads the West region, Southwest sits inside West or SunCare operates Magnolia, and computes access from them.
- Hierarchies of any depth. Move one region under another and everyone above it gains access, with one relationship written.
- Partners, teams and shares. Companies, nested groups and individual grants live in the same model.
- Access that expires on its own. Write the auditor’s relationship with an expiration and SpiceDB stops using it on time, with no cleanup ticket.
- An answer to “why?”. Every decision can return the relationship path behind it, ready to store beside the row for audits.
- Answers for access reviews. Lookups list everything a person can see, or everyone who can see a property, directly.
- One model everywhere. The same rules answer the warehouse, your applications, your APIs and your agents.
- Tested like code. The schema and expected answers can run in CI, so a change never silently widens access.
How they work together
- Relationships are written to SpiceDB as facts change, from HR, CRM, deal tools and your own applications.
- SpiceDB computes who can see each row’s key, here a property, by following those relationships.
- A sync keeps an entitlement table in Snowflake current, driven by SpiceDB’s change stream. For very large models, AuthZed Materialize can precompute permission sets for this kind of large-scale filtering.
- The row access policy does one lookup. Snowflake enforces it on every query, exactly as it does today, with no calls outside Snowflake at query time.
CREATE OR REPLACE ROW ACCESS POLICY finance.policies.property_rap
AS (property_id VARCHAR) RETURNS BOOLEAN ->
EXISTS (
SELECT 1 FROM finance.authz.property_entitlements e
WHERE e.user_name = CURRENT_USER()
AND e.property_id = property_id
);
ALTER TABLE finance.core.property_financials
ADD ROW ACCESS POLICY finance.policies.property_rap ON (property_id);
The entitlement table sits in the same database as the protected tables, as Snowflake recommends, and only the sync writes to it. The policy contains no hierarchy logic at all, because SpiceDB has already done that work.
Side by side
| Hand-maintained mapping table | Entitlement table kept current by SpiceDB | |
|---|---|---|
| Who works out the rows | Custom jobs and tickets | SpiceDB, from relationships |
| A region moves | Rows rewritten when the job next runs | One relationship; the table follows in seconds |
| A partner takes over a property | Rows added per partner user | One relationship for the whole company |
| Temporary access ends | Depends on a cleanup ticket | Expires automatically |
| “Why can she see this?” | Trace the job or ticket that wrote the row | The relationship path, stored with the row |
| Same rules in apps and agents | Implemented again elsewhere | The same SpiceDB answers |
| Enforcement on every query | Snowflake | Snowflake |
Is SpiceDB better than Snowflake row-level security? They do different jobs. Snowflake is better at enforcing access inside the warehouse; nothing should replace that. SpiceDB is better at deciding what that access should be when it depends on relationships, and at keeping the answer current, explainable and consistent beyond Snowflake.
When to add SpiceDB
- Your mapping table is built by jobs that join several sources, and reorganizations break it.
- Access follows hierarchies, partner companies, deal teams or account teams, not just roles.
- Temporary access for auditors, contractors or deal teams has to end on time.
- Auditors ask who can see a table, and why, and the answer takes days.
- The same data is served by an application or AI assistant that must follow the same rules.
Frequently asked questions
Does SpiceDB replace Snowflake row access policies?
No. Snowflake continues to enforce access on every query through its row access policies. SpiceDB decides what the access should be and keeps the entitlement table those policies read up to date.
Does Snowflake call SpiceDB when a query runs?
No. A sync writes SpiceDB’s decisions into a table inside Snowflake ahead of time, so queries make no calls outside Snowflake and the policy stays a single lookup.
How current is the entitlement table?
As current as the sync, which follows SpiceDB’s change stream and typically lands changes in seconds, rather than waiting for a scheduled rebuild.
Can the same approach drive masking policies?
Yes. Masking policy conditions can consult the same entitlement data, so column-level decisions follow the same relationships as row-level ones.
See it working
The interactive demo runs the same query as seven people at a property company, side by side: a policy fed by a hand-maintained mapping table, and one fed by SpiceDB. Switch on a reorganization, a new operating partner or an expiring audit and watch what each side returns.
Open the demo · Get a custom demo · Try the quickstart
AuthZed and Snowflake are independent companies. This article describes a common integration pattern based on Snowflake’s documented row access policies; it does not describe a joint product. Snowflake is a trademark of Snowflake Inc. Snowflake details reflect its published documentation as of November 2026.