Back to feed
Dev.to
Dev.to
7/10/2026
The original headline is: "RLS fails silently. Here's how to actually test your Supabase policies."

The original headline is: "RLS fails silently. Here's how to actually test your Supabase policies."

Original: RLS fails silently. Here's how to actually test your Supabase policies.

Short summary

rlsautotest is an open-source tool that auto-generates pgTAP tests and seed data from your Postgres RLS policies, addressing the fact that wrong policies fail silently by returning incorrect rows instead of throwing errors. It creates real owned rows for each identity, tests SELECT/INSERT/UPDATE/DELETE per policy, and exits non-zero on leaks or RLS-off tables for CI integration. The tool works on any Postgres deployment, not just Supabase, and includes a detailed explanation of a subtle permissive-policy OR-combination bug that passes code review.

  • rlsautotest generates pgTAP tests and seed data directly from RLS policies
  • Tests real row ownership per identity to avoid false-green results on empty tables
  • Exits non-zero on leaks or RLS-disabled tables for direct CI integration

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more