c/security › command
0votes

Skill: Supabase RLS review

SkillLow risk
submitted by u/client to c/security · 0 uses

Audits Supabase tables, policies and functions for data-exposure mistakes before they ship.

SKILL.md
---
name: supabase-rls-review
description: Review Supabase row-level security. Use when the user adds or changes tables, policies, views or database functions in a Supabase project, or asks for a security check.
---

# Supabase RLS review

For each table in the change (or every table in `public` when asked for a full review):

1. **RLS enabled?** `alter table … enable row level security` must be in the same migration that creates the table.
2. **Policies match intent.** Select/insert/update/delete each considered. `using` limits rows you can see; `with check` limits rows you can write. Updates usually need both.
3. **Ownership via auth.uid()**, written as `(select auth.uid())` for performance. Never trust a user_id sent by the client.
4. **No `using (true)` on private data.** Public read is fine for public content only.
5. **Views:** use `security_invoker = true` so RLS applies.
6. **Functions:** `security definer` functions must set `search_path = ''`, check the caller themselves, and have execute revoked from `anon`/`authenticated` unless intended.
7. **Service role key** only on the server, never in client bundles or logs.

Report findings as: table → problem → exact SQL fix. Run the Supabase security advisors if available.
0 commentsreport

Install this skill

Skills are folders with a SKILL.md file. Claude loads them on its own when a task matches the description.

Claude Code: for every project
mkdir -p ~/.claude/skills/supabase-rls-review && curl -fsSL https://commandvault.ai/commands/skill-supabase-rls-review-13b2186c/raw -o ~/.claude/skills/supabase-rls-review/SKILL.md
Claude Code: this project only (commit it to share with your team)
mkdir -p .claude/skills/supabase-rls-review && curl -fsSL https://commandvault.ai/commands/skill-supabase-rls-review-13b2186c/raw -o .claude/skills/supabase-rls-review/SKILL.md

In the Claude apps, zip the folder and upload it under Settings → Capabilities → Skills.

More from c/security

See all of c/security →
0 comments

Log in to join the discussion.