[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
- 21h 33m
- Merged PRs (30d)
- 258
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
-
Local Kong keeps idle upstream connections longer than PostgREST, causing sporadic 502 on POST/PATCH Open🐛 Bug supabase/cli
-
✨ Feature supabase/cli
-
🐛 Bug supabase/cli
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·