Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIDeepSeekDeepSeekMuseMuse+22 more

    Supabase Auth Security Reviewer

    1

    Audit Supabase RLS policies and auth configurations to prevent data leaks with actionable SQL fixes.

    Free

    6 usesSecurity scanned
    Supabase Auth Security Reviewer

    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 orders table uses USING (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:

    TablePolicy NameActionStatusRisk Level
    profilesPublic readSELECTPermissiveMedium
    ordersOrder accessSELECTCRITICALHigh
    orders-INSERTMissingLow

    🔑 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 anon key and not the service_role key.

    🛠️ 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

    1. Run the SQL fixes in your Supabase SQL Editor or include them in your next migration.
    2. Verify that your orders table has a user_id column linked to auth.users.
    3. 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 PERMISSIVE policies 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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 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

    Listed2 months ago

    What's inside

    Frequently Asked Questions

    The skill analyzes your Supabase schema and RLS policies to identify vulnerabilities like missing `ALTER TABLE` commands, incorrect `auth.uid()` checks, and improper Service Role Key usage. It provides ready-to-use SQL scripts to fix these security gaps immediately.

    For a comprehensive audit, you should provide your table definitions (DDL), existing Row Level Security (RLS) policies, and any relevant Edge Function logic where authentication is handled. The more schema context you provide, the more accurate the generated SQL fixes will be.

    Unlike general AI models, this skill follows a specialized security checklist tailored specifically to the Supabase auth schema and PostgreSQL policy evaluation logic. It focuses on high-risk 'gotchas' like bypasses in nested joins and permissive policy overlaps that generic prompts often overlook.

    This skill is a prompt-based logic package designed to work within your preferred AI agent interface; it does not require direct access to your production database. You simply paste your configurations into the agent, ensuring your live credentials remain private.

    You will receive the specialized audit logic and a structured framework for analyzing Supabase security. This includes the ability to generate precise SQL migration scripts for patching RLS leaks and hardening tenant isolation.

    New in Data & Databases

    Free