- Home
- Skills
- Data & Databases
- Supabase Auth Security Reviewer
Works with the AI Agents you already use
Supabase Auth Security Reviewer
Audit Supabase RLS policies and auth configurations to prevent data leaks with actionable SQL fixes.
Free
Supabase Auth Security Reviewer
Example session with this skill installed
Audit these policies for my 'profiles' and 'orders' tables. RLS is on, but users say they can see other orders.
CREATE POLICY "Public read" ON profiles FOR SELECT USING (true);
CREATE POLICY "Order access" ON orders FOR SELECT USING (true);
- Read your context and instructions
- Compiled the supabase auth security
I have reviewed your Supabase RLS policies. You have a critical security flaw in your orders table that allows any authenticated or anonymous user to read every order in the database.
Supabase Auth & Security Audit Report
🚨 Critical Security Flaws:
- Insecure Orders Policy: The
orderstable usesUSING (true), which grants global read access to all rows.
Profile Exposure: The profiles table allows public read access to all user profiles, which may leak PII depending on your schema.
📊 RLS Policy Audit:
| Table | Policy Name | Action | Status | Risk Level |
|---|---|---|---|---|
| profiles | Public read | SELECT | Permissive | Medium |
| orders | Order access | SELECT | CRITICAL | High |
| orders | - | INSERT | Missing | Low |
🔑 Auth & JWT Check:
- Your current policies do not reference
auth.uid(), meaning the JWT context is being ignored for row filtering. - Ensure your client-side initialization uses the
anonkey and not theservice_rolekey.
🛠️ Specific Fixes Required:
Enable strict isolation for the orders table:
-- Drop the insecure policy
DROP POLICY "Order access" ON orders;
-- Create a secure policy restricted to the owner
CREATE POLICY "Users can view own orders"
ON orders
FOR SELECT
USING (user_id = auth.uid());
-- Ensure RLS is active (re-run to be safe)
ALTER TABLE orders ENABLE ROW LEVEL SECURITY;
Restrict profile access (optional but recommended):
DROP POLICY "Public read" ON profiles;
CREATE POLICY "Users can view own profile"
ON profiles
FOR SELECT
USING (id = auth.uid());
Next steps
- Run the SQL fixes in your Supabase SQL Editor or include them in your next migration.
- Verify that your
orderstable has auser_idcolumn linked toauth.users. - Test the query from the frontend using a non-admin test account.
[Self-Check]
- RLS explicitly checked and enabled on all relevant tables
- Policies verified for strict user isolation using auth.uid()
- Service role key usage flagged if misused in client
- Exact SQL fixes provided for all identified flaws
Connects securely to your tools. The creator never sees your data.
About this skill
The problem
Misconfigured Row Level Security (RLS) is the leading cause of data leaks in Supabase applications. Developers often forget to enable RLS or write overly permissive policies that inadvertently expose private user records to the public internet.
What it does
- Scans database schemas to ensure RLS is explicitly enabled on all tables containing sensitive user data.
- Verifies that
auth.uid()is correctly implemented to enforce strict tenant isolation. - Identifies dangerous
PERMISSIVEpolicies and public write access on sensitive tables like profiles or payments. - Audits Edge Functions and client code for improper Service Role Key exposure.
- Generates precise SQL migration scripts to patch identified security holes immediately.
Frameworks & tools
Supabase, PostgreSQL, Row Level Security (RLS), Supabase Edge Functions, and JWT-based authentication.
Why this beats prompting it yourself
General AI often misses the nuance of PostgreSQL policy evaluation order or the specific syntax of Supabase's auth schema. This skill follows a rigid audit checklist that covers the common "gotchas" like forgotten ALTER TABLE commands and service role misuse, providing copy-paste SQL fixes instead of generic advice.
Use cases
- Reviewing new database migrations before pushing to production.
- Troubleshooting reports that users can see each other's private data.
- Auditing legacy Supabase projects for compliance with security best practices.
- Hardening Edge Functions to prevent privilege escalation.
Known limitations
Requires the user to provide schema definitions or existing RLS policy syntax. Cannot directly access a live database without the user pasting the relevant SQL or configuration.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Data & Databases.
Requires schema definitions or policy SQL to be provided in the chat. Cannot verify environment variables or infrastructure-level settings outside of the provided context.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
6 uses
Times used to date
Free to use
No account required to browse
Trust & safety
Security scan
Security scan passed 2 months ago
- Free with an Agensi account
Permissions
No special permissions declared or detected