# supabase rls policy auditor

> Audit Supabase RLS policies for IDOR vulnerabilities and verify fixes with cross-tenant attack queries.

supabase rls policy auditor is a paid AI agent skill on Agensi by Elyas, in Agents & Orchestration. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $22 (one-time purchase)
- Creator: [Elyas](https://www.agensi.io/creators/elyas-shukri-elmi)
- Category: [Agents & Orchestration](https://www.agensi.io/skills/agents-orchestration)
- Version: 1.0
- Last updated: 2026-08-21
- Security: scan passed (2026-08-21); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/supabase-rls-policy-auditor
- Tags: ai-agents, supabase, postgresql, security, database-security

## About this skill

### The problem

Supabase RLS policies often look correct while still leaking data due to permissive policy overlap or incorrect scoping columns. Relying on a visual audit of policy text is insufficient for identifying IDOR/BOLA vulnerabilities in a production database.

### What it does

- Audits every table in a Supabase or Postgres project against an IDOR/BOLA attack matrix.
- Identifies missing RLS, overly permissive policies, and unsafe usage of user-editable JWT metadata.
- Generates precise remediation SQL including DROP, ALTER, and CREATE POLICY statements using hardened null-check patterns.
- Verifies fixes by generating and executing cross-tenant queries to prove enforcement rather than just reviewing code.
- Scans for service_role key leakage in client-side environment variables and source code.

### Frameworks & tools

PostgreSQL, Supabase, and RLS (Row Level Security) mechanics.

### Why this beats prompting it yourself

Generic LLMs often miss that Postgres combines permissive policies with OR, meaning adding a correct policy won't fix an existing leak. This skill enforces a "verify via query" workflow, ensuring you don't just feel safe, but are actually protected against cross-tenant access.

### Use cases

- Reviewing Supabase-backed applications before moving from staging to production.
- Auditing legacy projects where RLS was applied inconsistently across different teams.
- Fixing data leaks where one table's policy inadvertently grants access to another tenant's rows.
- Validating that service_role keys are not exposed to the frontend or public mobile bundles.

### Known limitations

Does not perform broad security audits like secrets scanning or logging. Verification queries require a connection that does not bypass RLS (non-superuser role).

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the supabase rls policy auditor skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this auditor identify vulnerabilities that a manual code review might miss?

This skill systematically tests your Row Level Security (RLS) against an IDOR/BOLA attack matrix and generates hardened remediation SQL. Unlike a manual review, it executes actual cross-tenant queries to prove your data is truly isolated.

### What level of database access is required for the auditor to perform its checks?

You will need to provide the tool with a connection string for a role that respects RLS (not the superuser/postgres role) and read-only access to your schema metadata. It also scans your client-side environment variables to ensure the service_role key isn't exposed.

### Can I use this skill for a standard PostgreSQL database, or is it exclusive to Supabase?

Yes, the skill is compatible with any standard PostgreSQL environment utilizing Row Level Security, though it includes specialized optimizations for Supabase-specific patterns and JWT metadata.

### Does the skill just find leaks, or does it help me fix the vulnerable RLS policies?

It provides precise remediation SQL, including DROP and CREATE POLICY statements using hardened null-check patterns, to fix detected leaks. After you apply the fixes, the skill runs verification queries to confirm the vulnerabilities are closed.

### How does this tool handle tables that have multiple conflicting RLS policies?

Postgres combines multiple policies on a single table using 'OR' logic, meaning one secure policy won't override a separate permissive one. This skill specifically audits for policy overlap to ensure no legacy or overly-broad rules are accidentally granting access.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
