Move RLS verification into the policy editor, not beside it #49608
Unanswered
IshwaryaSuresh
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Supabase paused the RLS Tester feature preview in April while re-evaluating its direction. This is a concrete proposal for that direction, with a working prototype.
The argument in one line: the tester was the right capability in the wrong place. Verification that lives beside authoring is a destination people have to remember to visit, and the moment you most need it is the moment you don't know you need it, because a too-strict policy looks exactly like no data.
Try it: https://ishwaryasuresh.github.io/deny-by-default/
The prototype there runs a real RLS interpreter over a sample table (grants → role → permissive
OR→ restrictiveAND), so the policy you build is genuinely evaluated rather than mocked. There's a 3½ minute narrated walkthrough if you'd rather watch than click.The research
I pulled every discussion in this repo matching "RLS policy" (800), filtered out show-and-tell, and kept the 438 where a policy is the actual subject. Coded each on title and opening post; 27.9% resisted single-theme coding and are reported as unclassified rather than forced.
auth.uid()null, anon key, third-party JWT, server-side with no session)new row violates row-level security policyon INSERT)42501, reads as a policy failure and isn't)The one I'd flag: silent denial reads as small at 8.7%, but it isn't a category. It's the delivery mechanism for most of the others. A wrong identity, a missing grant and a restrictive-instead-of-permissive policy all arrive identically, as an empty array and a 200.
For scale, the repo carries 1,524 discussions and 405 issues mentioning RLS. Volume hasn't declined: 2023 and 2025 are the peak years.
What the proposal is
Five components, all in the prototype:
toclause defaults toauthenticated. The USING / WITH CHECK split becomes a consequence of the command rather than a question you answer, which is what #180 promised in 2020.OR→ restrictiveAND, for a chosen caller, with the failing step marked.One thing I got wrong, and corrected
My first version modelled every denial as silent. Per the docs' own table, that's wrong: a missing grant and a
with checkviolation both raise42501, and only ausingfilter is quiet. The prototype now models writes as loud and reads as silent, because conflating them overstates the problem. Reads are the silent case, and they're still a third of the corpus.Happy to be told I've misread the direction you're re-evaluating toward.
All reactions