Row-level security is a database access control feature that filters which rows a user can see or change. In Supabase, policies evaluate the current role and request context, so access depends on the policy expression attached to each table rather than on the table alone.
How row-level security actually filters access in Supabase
Row-level security, or RLS, is enforced inside PostgreSQL before a query returns rows or applies changes. In Supabase, the database checks each row against the policy attached to that table, using the current role and request context. That means the policy is the access rule, not the table itself, and different users can see different row sets from the same table.
For a practical overview of how table-level policies and tenant-aware access patterns fit together, the Row and Column Level Security Guide explains the broader design choices behind fine-grained data access.
Because Supabase builds on PostgreSQL, the control point is the policy expression, typically written to compare row data against the caller’s identity or session context. If the expression evaluates false, the row is invisible for reads or blocked for writes. If no policy matches, access is denied by default when RLS is enabled.
When you are working specifically with Supabase database controls, the Supabase Security guide covers how RLS fits alongside auth settings, logging, and network restrictions.
What policy scope and request context change
RLS is evaluated per statement and per row, so the same SQL can return different results depending on who runs it and what context is present. That context often includes the authenticated user, session claims, role membership, or other attributes exposed to the policy. In practice, this is what lets teams express tenant isolation, owner-only access, or case-based access directly in the database.
If you need the PostgreSQL mechanics behind USING, WITH CHECK, permissive versus restrictive policies, and bypass behaviour, the PostgreSQL Row-Level Security Guide is the deeper reference for how the engine evaluates those rules.
That same mechanism is why RLS is often paired with multi-tenant design. A table can hold rows for many customers, but the policy can make each tenant see only its own records, even when the application shares one schema or one physical database.
For a wider architecture view of tenant isolation, the Multi-Tenant SaaS Architecture Security Guide shows how verified tenant context, caches, quotas, and tests all support the database policy model.
Where RLS breaks down in real deployments
RLS is strong only when every data path goes through the database policy path. The common failure mode is not the policy syntax itself, but a bypass path such as an overprivileged role, a service credential with broader rights than intended, or application code that queries through a path the policy does not govern. In Supabase, that makes key hygiene and role design part of the security boundary, not a separate concern.
The most useful companion resource here is the Supabase Keys Security Guide, which covers publishable and secret keys, legacy JWTs, and how those credentials interact with RLS enforcement.
Another practical failure mode is assuming RLS alone will fix application authorization mistakes. If the application sends the wrong tenant context, uses a broad service role, or exposes a view or function that bypasses policy checks, the database may still return rows the developer never intended to expose. That is why policy testing matters as much as policy authoring.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP API Security Top 10 addresses the attack and risk surface, while NIST SP 800-53 Rev 5 and OWASP ASVS set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | AC-6 — Least Privilege | RLS limits row access to the minimum needed by role and context. |
| IA-5 — Authenticator Management | Supabase RLS depends on trustworthy session and credential context. | |
| AC-3 — Access Enforcement | RLS is a database access enforcement mechanism applied at query time. | |
| Recommendation — Use AC-6 to restrict each role to the smallest row access needed. Manage credentials so policy decisions rest on reliable identity context. Enforce table access through policy checks instead of application assumptions. | ||
| OWASP ASVS | V8 — Authorization | RLS is an authorization control for object and row access decisions. |
| Recommendation — Validate that authorization is enforced server-side for every data path. | ||
| OWASP API Security Top 10 | API1 Broken Object Level Authorization — Broken Object Level Authorization | Row filtering is a core defense against object-level data exposure in APIs. |
| Recommendation — Map each API data route to row-level checks that block unauthorized object access. | ||
Practitioner Guidance
What to verify: Confirm that every read and write path, including admin tooling, background jobs, and API routes, reaches the table through the intended policy path. If one path needs broader access, isolate it and document why it is exempt.
Common mistake: Treating RLS as a complete application authorization layer. It is a strong database control, but it still depends on correct role selection, correct session context, and careful handling of privileged credentials.
What good looks like: Each table with sensitive rows has explicit policies, test coverage for allowed and denied access, and no hidden bypass route that can read the same data without the same policy logic.
Practitioner takeaway: In Supabase, RLS works best when you think of it as the enforcement layer for a clearly designed authorization model, not as a substitute for that model.
Related resources from NHI Mgmt Group
- What breaks when Supabase tables are exposed without row-level security for authenticated and unauthenticated users?
- What is the difference between authentication and row-level security in a Supabase-based application?
- How should teams implement passkeys when Supabase still enforces Row Level Security?
- Supabase Row Level Security
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org