[Feature Request] AST-based Static RLS Linter & Hybrid Search Plugin Engine for supabase db lint
@7ttp is already working on this.
Since Aug 3, 2026.
Assessment
This issue has not been assessed yet.
Description
Existing issues
- I have searched the existing issues.
Affected area
Database
Problem to solve
While building on Supabase, we noticed a few tricky Row Level Security (RLS) and database bugs that can easily slip past normal checks into production:
- Infinite RLS Policy Loops: Self-referencing subqueries inside USING clauses that cause
stack depth limit exceededcrashes when executed. - Unindexed FK Joins in Policies: Policy subqueries that join on foreign key columns missing database indexes, leading to full table scans on every request.
- Insecure SECURITY DEFINER RPC Functions: Functions created without an explicit
SET search_path = ''scoping, leaving room for schema hijacking.
Detecting these early without spinning up full local database containers every time can save developers a lot of debugging headache.
Proposed solution
We built a lightweight, zero-dependency AST static analyzer (supabase-rls-guardian & supabase-vector-sdk) that parses migration files and catches these rules in under 5ms without needing a live database daemon running.
We'd love to propose:
- Bringing these static RLS analysis rules directly into
supabase db lint. - Adding a
--htmldashboard option so teams can publish visual security audit artifacts in their CI workflows. - Including built-in SQL generators for Reciprocal Rank Fusion (RRF) hybrid search (
match_documents_hybrid).
Everything has 100% test coverage, and we'd be super happy to open a clean Pull Request to contribute this directly to the Supabase CLI!
Alternatives considered
Relying on manual testing or spinning up full Docker containers for every quick lint check, which is usually much slower and harder to run inside lightweight GitHub Action PR checks.
Additional context
We published an open-source reference implementation and benchmark suite here:
- GitHub: https://github.com/supabase-community/rls-guardian
- npm:
supabase-rls-guardian
Happy to adapt the code to fit whatever patterns the CLI team prefers!
- Dominant language
- TypeScript
- Stars
- 2.4k
- Forks
- 523
- Avg merge
- 20h 47m
- Merged PRs (30d)
- 243
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from supabase/cli
-
🐛 Bug supabase/cli
-
🐛 Bug supabase/cli
-
🐛 Bug supabase/cli
-
Local Kong keeps idle upstream connections longer than PostgREST, causing sporadic 502 on POST/PATCH Open🐛 Bug supabase/cli
-
✨ Feature supabase/cli
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug clawsweeper:linked-pr-open clawsweeper:needs-live-repro clawsweeper:no-new-fix-pr impact:message-loss issue-rating: 🐚 platinum hermit P2 regression
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
calcite-components needs triage refactor
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Esri/calcite-design-system#15203 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
danielmiessler/LifeOS#2218 ·