Prototype · Preview: every server in the official registry, synced every 30 minutes. Sign in with Google to write reviews.Prototype · updated every 30 min
PopNx MCPMCP servers for people who use AI · explained in plain words

Supabase Rls Check

by Tthanh2k6version 0.7.0i★ 0iRuns on your computerRepository ↗
Registry nameio.github.Tthanh2k6/supabase-rls-check

How to install

What it does

Read-only Supabase RLS checks: explain rules, analyze/diff SQL exports, scan public env vars.

  • Connects Runs on your computer
  • Account or key No key needed
  • Category Databases & datasets

Use together with

Skills that teach the AI this kind of work; they work alongside this one

timesfm

TimesFM (Time Series Foundation Model) is a pretrained time-series foundation model developed by Google Research for time-series forecasting.

by google-research★ 35,6291 skills

Skill · How-to guide

Shadowbroker

Open-source intelligence for the global theater. Track everything from the corporate/private jets of the wealthy, and spy satellites, to seismic events in one unified interface. Hook an AI agent up to have it parse through data and find previously unseen correlations. The knowledge is available to…

by BigBodyCobain★ 11,6021 skills

Skill · How-to guide

google-maps-scraper

scrape data from Google Maps. Extracts data such as the name, address, phone number, website URL, rating, reviews number, latitude and longitude, reviews,email and more for each place

by gosom★ 8,2091 skills

Skill · How-to guide

Why it ranks here

Lists are ordered by a usage score (out of 100) built from these parts

Popularity0/80GitHub stars or weekly downloads: the larger counts 60, the smaller 20
Freshness12/12Full marks for a release or code change within 30 days
Still answering0/8The cloud endpoint answered at the last check
Usage score12/100

Quality: Passed 3/3 basic checks (shown, not used for ordering) · Momentum: No data yet (Used only on the Trending tab)

Install

Pick the AI app you use, then copy the settings.

Let your AI install it with one sentence

Please install Supabase Rls Check. Follow https://mcp.popnx.com/i/tthanh2k6-supabase-rls-check.md, show me the commands and wait for my OK before running them.

Paste it into an AI that can work on your computer (such as Claude Code or Cursor). It reads our steps, shows you the commands and waits for your OK. No key, no sign-up. · See the full text your AI reads

Passed 3/3 checks · Runs on your computer · ✓ Commands checked Nov 19, 2026

First: which AI do you use?

Pick your app and the steps appear below.

Works with Claude, with some setup first

Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone

Let AI install it

Copy this message into a Claude chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Supabase Rls Check for Claude on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "supabase-rls-check": { "command": "uvx", "args": [ "supabase-rls-check", "mcp" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Supabase Rls Check tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Open the Claude desktop app’s settings file

    SettingsDeveloperEdit Config

  3. Paste these settings and save the file

    {
      "mcpServers": {
        "supabase-rls-check": {
          "command": "uvx",
          "args": [
            "supabase-rls-check",
            "mcp"
          ]
        }
      }
    }
  4. Quit Claude and open it again

  5. Try it

    Use Supabase Rls Check and tell me what you can do for me, then show me one thing

    ✓ If Claude says it is using Supabase Rls Check or shows a Supabase Rls Check tool in the answer, you are connected

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

ChatGPT cannot connect Supabase Rls Check yet

Supabase Rls Check runs on your computer, but ChatGPT can only connect servers that run on the web

What you can do instead

A · Use an app that can connect Supabase Rls Check

  • Install Python (uv) on your computer first (one time) · Only the Claude desktop app (Windows or Mac), not the web or phone
  • Install Python (uv) on your computer first (one time)
  • Install Python (uv) on your computer first (one time)
  • Install Python (uv) on your computer first (one time)

B · Others in Databases & datasets that work with ChatGPT

Picked from the most used in the same category, only ones that connect by address with no key

Works with Claude Code, with some setup first

Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a Claude Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Supabase Rls Check for Claude Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): claude mcp add --scope user supabase-rls-check -- uvx supabase-rls-check mcp 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Supabase Rls Check tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Open Terminal

    Mac: press Command+Space and type Terminal · Windows: open PowerShell

  3. Paste this command and press Enter

    claude mcp add --scope user supabase-rls-check -- uvx supabase-rls-check mcp
  4. Type /mcp in Claude Code

    You should see Supabase Rls Check listed as connected

  5. Try it

    Use Supabase Rls Check and tell me what you can do for me, then show me one thing

    ✓ If Claude Code says it is using Supabase Rls Check or shows a Supabase Rls Check tool in the answer, you are connected

Menu names checked against Anthropic’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with Cursor, with some setup first

Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a Cursor chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Supabase Rls Check for Cursor on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "mcpServers": { "supabase-rls-check": { "command": "uvx", "args": [ "supabase-rls-check", "mcp" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Supabase Rls Check tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Click this button to open Cursor

    Open in Cursor

    Cursor asks you to confirm; click Install

  3. Open the AI chat in Cursor in Agent mode

  4. Try it

    Use Supabase Rls Check and tell me what you can do for me, then show me one thing

    ✓ If Cursor says it is using Supabase Rls Check or shows a Supabase Rls Check tool in the answer, you are connected

Menu names checked against Cursor’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Works with VS Code, with some setup first

Install Python (uv) on your computer first (one time)

Let AI install it

Copy this message into a VS Code chat. The AI checks your computer, tells you which file it will change, and waits for your OK every time.

Please install the MCP server Supabase Rls Check for VS Code on this computer, in this order: 1) Check uv with uv --version. If it is missing, tell me to install it from https://docs.astral.sh/uv/getting-started/installation/; do not install it yourself. 2) Use only this config (already checked by PopNx MCP): { "servers": { "supabase-rls-check": { "type": "stdio", "command": "uvx", "args": [ "supabase-rls-check", "mcp" ] } } } 3) Tell me the full path of the file you will change, or the command you will run, and wait for my OK. 4) No key is needed. 5) Do what we agreed, then check that the Supabase Rls Check tools really show up.

This message has no key in it. If a key is needed, the AI will ask you to paste it yourself into the file or the app’s field.

  1. Install uv (if you don’t have it)

    Already installed? Check first · Open Terminal, type this command and press Enter

    uv --version
    • A version number such as uv … = installed, skip this step
    • "command not found" (on Windows: "is not recognized") = not installed yet, or installed but Terminal needs to be closed and reopened
    How to open Terminal

    Mac: press ⌘ + Space, type Terminal, press Enter

    Windows: open Start, type Windows PowerShell, then Open

    Not installed: uv has no click-through installer. Copy the one-line command for your system (macOS or Windows) from uv’s official page into Terminal · no separate Python install needed; uv downloads it when required

    Open the uv download page ↗

    When it’s done, close Terminal, open it again and run the same command. You should see a version number: uv --version

    Install once; it works for everything that needs uv

  2. Click this button to open VS Code

    Open in VS Code

    VS Code asks you to confirm; click Install

  3. Open the AI chat in VS Code in Agent mode

  4. Try it

    Use Supabase Rls Check and tell me what you can do for me, then show me one thing

    ✓ If VS Code says it is using Supabase Rls Check or shows a Supabase Rls Check tool in the answer, you are connected

Menu names checked against VS Code’s help page on Nov 11, 2026 · your screen may differ slightly by app version

Other apps that use MCP, such as Windsurf, Zed or Gemini CLI, each add servers differently. See how in the app list.

See every app that uses MCP →

JSON settings are under “For developers” below

Stuck? Ask people who use Supabase Rls Check💬 Discussion →
For developers: Terminal commands and JSON settings

Installed on your computer

Claude Code

claude mcp add --scope user supabase-rls-check -- uvx supabase-rls-check mcp

Claude Desktop (claude_desktop_config.json)

{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check",
        "mcp"
      ]
    }
  }
}

Cursor (~/.cursor/mcp.json)

{
  "mcpServers": {
    "supabase-rls-check": {
      "command": "uvx",
      "args": [
        "supabase-rls-check",
        "mcp"
      ]
    }
  }
}

VS Code (mcp.json)

{
  "servers": {
    "supabase-rls-check": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "supabase-rls-check",
        "mcp"
      ]
    }
  }
}

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

At a glance

Downloads per weeki
267/wk
Connection
Runs on your computer
Latest versioni
0.7.0
Published to registryi
Nov 18, 2026
Code last changedi
Nov 16, 2026
Maker
Tthanh2k6
Packages
pypi: supabase-rls-check
Registry status
Active

Which apps can use it

Based on how this server connects and on each app’s own docs, checked Nov 10, 2026.

Run on your computer in

ClaudeGooseLM StudioMsty StudioCherry StudioCursorVS Code + GitHub CopilotVisual StudioWindsurf (Devin Desktop)ZedKiroClineContinueJetBrains AI AssistantClaude CodeCodex CLIGemini CLIOpenCodenodecodeWarpLibreChatRaycast

All apps, with pros and cons →

Related guides

What it can do

Runs on your computer; the tool list appears in your AI app after you install it.

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 19, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account Tthanh2k6, which owns the repo

  • ✓ Pass

    Still maintained

    Code last changed 3 days ago

  • ✓ Pass

    Has a licence

    Uses MIT

  • – Not applicable

    Endpoint responds

    This one runs on your computer; there is no internet endpoint

  • – Not applicable

    Sign-in with OAuth

    Runs on your computer and uses local settings instead

  • … Not checked yet

    No hidden instructions in tool descriptions

    Runs on your computer; we can only read tool lists from internet endpoints

Published vulnerabilities (OSV.dev)

Not checked yet

What we check → · JSON

Makers: ask for a re-check or report wrong info
For makers: add a badge to your README

If you made this, paste this code into your README. The badge links back to this page.

[![Featured on PopNx MCP](https://mcp.popnx.com/badge/tthanh2k6-supabase-rls-check.svg)](https://mcp.popnx.com/en/servers/tthanh2k6-supabase-rls-check)

Discussion

Ask, share a tip or report that it does not work. Sorted by what people marked helpful.

No posts yet. Be the first to ask or share.

Posts here are written by users, not the PopNx team.

Sign in to post

User reviews

No reviews yet

Sign in to write a review

Compared with others in Databases & datasetsi

  • More stars than 0% of the other 1233 servers in this category
  • Published to the registry more recently than 99% of the other 1233 servers in this category
  • Basic checks equal to or better than 99% of the other 1233 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is Supabase Rls Check safe?

It passed 3 of 3 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

The registry does not list a required key, though some servers ask you to sign in on first use.

Does it run on my computer or in the cloud?

It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).

Is it still maintained?

The GitHub repo last changed 3 days ago, and the latest version (0.7.0) reached the registry yesterday.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Python (uv) on your computer.

What can I use instead?

In the same category: QueryWeaver, Supabase, Neon, DBCode, Keboola MCP

Similar alternatives

Same category, other makers, commands already checked. Official ones first, then by stars.

Reading a card:↓ Downloads per weeki★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

QueryWeaver

An MCP server for Text2SQL: transforms natural language into SQL using graph schema understanding.

by FalkorDBGrowing★ 1.1KUpdated 14 months ago

Runs on your computer✓ falkordb.com

Supabase

Supabase’s official server lets AI create tables, query data and review project settings in your Supabase database.

by supabaseWidely used↓ 245.5K/wk★ 3K Stars for the whole repoUpdated yesterday

Computer or cloud✓ service owner · supabase.com

Neon

Official Neon MCP server for managing Neon projects and Lakebase Postgres databases.

by neondatabaseGrowing★ 666Updated 13 days ago

Runs in the cloud✓ service owner · neon.com

DBCode

Query and explore 100+ databases through your DBCode connections.

by dbcodeioEarly↓ 118/wk★ 367 Stars for the whole repoUpdated 2 months ago

Runs on your computer✓ service owner · dbcode.io

Keboola MCP

Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...

by keboolaGrowing↓ 1.4K/wk★ 84Updated 3 days ago

Computer or cloud✓ service owner · keboola.com
Compared with similar ones
This one
Supabase Rls Check
QueryWeaverSupabaseNeonDBCodeKeboola MCP
Runs whereInstalls on your computerInstalls on your computerCloud or install on your computerRuns in the cloud, nothing to installInstalls on your computerCloud or install on your computer
Needs a keyNoNoYesNoNoNo
Add with + in ClaudeNoNoYesYesNoNo
Basic checks3/33/35/55/52/35/5
LicenseMITAGPL-3.0Apache-2.0MITNOASSERTIONMIT
PriceNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registryNo cost listed in the registry

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

supabase-rls-check

A command-line tool that reads PostgreSQL catalog metadata from a Supabase project and flags Row Level Security (RLS) mistakes: tables without RLS, USING (true) policies, SECURITY DEFINER functions callable by anon, public Storage buckets and 13 other patterns. It also scans a local app folder for leaked service_role keys. It never needs a database password or a service_role key, and it never reads table rows. It also ships as an MCP server and a GitHub Action. Python 3.11+, PostgreSQL 15+.

It is for people who ship a Supabase app with the anon key in the browser and want to check what that key can reach. It is a review aid, not a penetration test (see Limitations).

pipx install supabase-rls-check      # or: uvx supabase-rls-check --help

supabase-rls-check report --from demo/todo_ai.csv --out-dir demo --project "todo-ai (fictional demo)" --i-own-this-project

The second command runs on the fictional dataset in demo/todo_ai.csv:

rule,schema_name,object_name,policy_name

rls_disabled,public,todos, policy_true,public,profiles,read_every_profile public_bucket,storage,todo-attachments,

It writes demo/report.md, demo/report.html and demo/fix.sql. The Markdown report contains this table:

SeverityFinding / objectEvidence
HighUnconditional policy expression: public.profilespolicy_true: read_every_profile
HighRow security is disabled: public.todosrls_disabled
MediumStorage bucket is public: storage.todo-attachmentspublic_bucket

fix.sql is a review template that starts with BEGIN; and ends with ROLLBACK;. It enables RLS on profiles and todos and leaves a commented example policy for you to adapt.

Install

pipx install supabase-rls-check

pipx install "supabase-rls-check[mcp]" # adds the MCP server (mcp>=1.10) pip install -e ".[dev]" # from a source checkout

Usage

1. Export catalog metadata with check.sql
supabase-rls-check sql --print-sql > check.sql

Paste check.sql into the Supabase SQL Editor, adjust the sensitive-table name pattern if needed, run it, and export the single result set as CSV or JSON (columns rule,schema_name,object_name,policy_name,basis). The query reads catalogs only, never application rows. The query file is also at src/supabase_rls_check/sql/check.sql.

Validate and normalize the export:

supabase-rls-check sql --from export.csv --out sql_results.json --i-own-this-project
2. Optional: check anonymous read access with probe

probe asks your project, with the public key only, which tables an unauthenticated visitor can read. With --site it also looks for a service_role JWT in your frontend.

supabase-rls-check probe \

--url https://YOUR_PROJECT.supabase.co \ --anon-key YOUR_ANON_OR_PUBLISHABLE_KEY \ --site https://your-app.example \ --out probe_results.json \ --i-own-this-project

  • Pass the project origin to --url, not /rest/v1/.
  • Only anon JWTs and sb_publishable_ keys are accepted. service_role and authenticated tokens are rejected before any request is sent.
  • If OpenAPI discovery is off on PostgREST, name the tables yourself with --tables todos profiles.
  • Set SUPABASE_ANON_KEY instead of --anon-key to keep the key out of shell history.

It adds two findings: anon_readable (High; column names and visible row count only) and service_role_exposed (Critical; a JWT with role = "service_role" found in the page HTML or a same-origin script).

3. Build the report
supabase-rls-check report \

--from sql_results.json probe_results.json \ --out-dir review_out \ --project "My Supabase App" \ --i-own-this-project

Output in review_out/:

  • report.html: standalone, works offline, A4 landscape print stylesheet for Save as PDF.
  • report.md: summary for issues or pull requests.
  • fix.sql: commented review template wrapped in BEGIN; ... ROLLBACK;. The tool never runs it. Replace user_id with your ownership column and test on staging first.

Add --lang vi for Vietnamese text. A Vietnamese demo is in demo/vi/report.md.

Scan your app folder for leaked secrets

scan-env reads local files only, needs no network and no consent flag, and masks every secret it prints (first 6 characters, then …, then last 4).

supabase-rls-check scan-env . --out envscan.json

supabase-rls-check report --from sql_results.json envscan.json --out-dir review_out --project "My Supabase App" --i-own-this-project

It reads .env, .env.*, app.json, app.config.*, eas.json, AI agent and MCP config files (.claude/settings.json, .claude/settings.local.json, .cursor/mcp.json, .mcp.json, .vscode/mcp.json) and client source files (*.js, *.jsx, *.ts, *.tsx, *.mjs, *.cjs, *.vue, *.svelte). It skips node_modules, .git, virtualenvs, build output (dist, build, web-build, android/app/build, ios/build, ios/Pods), binary files and files over 2 MB.

It reports:

  • public_env_service_role (Critical) and public_env_secret_key (High): secrets in variables that get bundled into the client (EXPO_PUBLIC_, NEXT_PUBLIC_, VITE_, REACT_APP_, PUBLIC_, NUXT_PUBLIC_).
  • service_role_in_client_code and db_url_in_client_code (both Critical): service_role JWTs, sb_secret_ keys or Postgres URLs with a password in client files. supabase/functions/, server/, api/, scripts/ and backend/ are excluded.
  • agent_config_secret (Critical): the same secrets in agent or MCP config files, reported with the file path and, for valid JSON, the key path.

The anon JWT and sb_publishable_ keys belong in a client app and are never reported. Matching is line by line, so obfuscated, split or encoded keys can be missed.

Explain a rule, run the MCP server
supabase-rls-check explain rls_disabled

supabase-rls-check explain definer_anon_exec supabase-rls-check mcp # needs the [mcp] extra; stdio transport

The MCP server has four local, read-only tools: analyze_sql_export(path), explain_rule(rule), scan_public_env(path) and diff_results(old_path, new_path). probe is not exposed, so an AI client never handles your API key or makes HTTP requests through this tool.

Compare two runs with diff
supabase-rls-check diff \

--old baseline_results.json \ --new sql_results.json \ --out diff.json \ --fail-on-new high

diff lists findings that are new or resolved between two local CSV or JSON files. With --fail-on-new (critical, high, medium or low) it exits 1 when a new finding at or above that severity appears. A finding is keyed by (rule, schema_name, object_name, policy_name, basis). basis says why a heuristic rule fired, for example table name matches pattern 'payment' or table comment tag 'pii'. Adding a pii comment to a table therefore shows up as a new finding, and the earlier pattern-based one as resolved. JSON files without a basis key still load, with basis set to "".

One consequence: a baseline exported before 0.6.1 lists an extension-owned table with an empty basis. The first diff against it reports that table as new (with owned by extension ) and the old entry as resolved, so --fail-on-new high exits 1 once. Export the baseline again with 0.6.1 or later to clear it.

GitHub Action

The repository is a composite action. It runs check.sql with psql inside a default_transaction_read_only session, writes report.md, report.html and fix.sql, adds a summary table to the job page, and fails the job when a finding is at or above fail-on. Unlike the flow above, it needs a Postgres connection string. Store it as a repository secret and point it at staging or a read-only role. The action refuses to run unless i-own-this-project is "true". Outputs: findings (total) and failing (at or above fail-on).

name: RLS check

on: [pull_request] jobs: rls: runs-on: ubuntu-latest steps:

  • uses: Tthanh2k6/supabase-rls-check@main with: database-url: ${{ secrets.STAGING_DATABASE_URL }} i-own-this-project: "true" fail-on: High # Critical, High, Medium, Low or none
  • uses: actions/upload-artifact@v4 if: always() with: name: rls-report path: rls-report/

To catch schema drift outside pull requests, run check.sql on a schedule and diff it against a baseline, for example .rls-baseline.json committed to the repository:

name: RLS drift check

on: pull_request: schedule:

  • cron: "0 6 * * *"

jobs: drift: runs-on: ubuntu-latest steps:

  • uses: actions/checkout@v4
  • uses: actions/setup-python@v5 with: python-version: "3.12"
  • name: Run check.sql and diff against baseline env: DATABASE_URL: ${{ secrets.STAGING_DATABASE_URL }} run: | python -m pip install supabase-rls-check supabase-rls-check sql --print-sql > check.sql PGOPTIONS='-c default_transaction_read_only=on' \ psql "$DATABASE_URL" -v ON_ERROR_STOP=1 --csv -f check.sql > current.csv supabase-rls-check sql --from current.csv --out current.json --i-own-this-project supabase-rls-check diff \ --old .rls-baseline.json \ --new current.json \ --out diff.json \ --fail-on-new high
  • uses: actions/upload-artifact@v4 if: always() with: name: rls-diff path: | current.json diff.json

Rules

check.sql has 17 rules. It queries PostgreSQL 15+ system catalogs and storage.buckets in one read-only query. The table also lists two scan-env rules that read local files.

Rule IDSeverityWhat it flags
rls_disabledHighTable or partitioned table in public with RLS off. If an extension owns the table (for example PostGIS spatial_ref_sys), it is still reported with basis = owned by extension , and fix.sql suggests moving the extension to an extensions schema, because ENABLE ROW LEVEL SECURITY fails there with "must be owner" (see supabase/supabase discussion #52767). Detection uses pg_depend (deptype = 'e') and covers direct extension members only. Some extensions cannot be relocated, so check first.
policy_trueHighPolicy in public with USING (true) or WITH CHECK (true).
policy_true_writableCriticalPermissive UPDATE, DELETE or ALL policy for anon, authenticated or public with USING (true), on a table where anon or authenticated holds UPDATE or DELETE. Anyone with that role can change or delete every row.
sensitive_anon_policyHighPolicy granted to anon or public on a table whose name matches user, profile, order, payment, invoice, customer, patient, secret, token or document, or that has a pii table comment. basis records which one matched.
definer_anon_execHighNon-trigger SECURITY DEFINER function in public that anon can execute (callable at /rest/v1/rpc/*).
definer_search_pathHighSECURITY DEFINER function in public with no fixed search_path.
view_not_invokerHighView in public without security_invoker, so it runs with the owner's privileges.
public_bucketMediumStorage bucket with public = true.
public_bucket_listableMedium

Only the beginning is shown; read the rest in the repo