supabase-rls

Enforce Supabase row-level security policies on database tables.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/dvorkinguy/claude-skills-agents --skill supabase-rls
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: supabase-rls
Source: https://github.com/dvorkinguy/claude-skills-agents/tree/main/skills/supabase-rls
Command: npx skills add https://github.com/dvorkinguy/claude-skills-agents --skill supabase-rls

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Supabase Row Level Security (RLS) policies help enforce fine-grained access control on your tables. This Skill provides ready-to-use RLS patterns for common scenarios such as per-user data visibility and multi-tenant isolation, plus examples for admin bypass on server-side operations.

Core Features & Use Cases

  • Predefined RLS policies for common patterns (Users view own data, Users insert/update own data, etc.)
  • Multi-tenant data isolation patterns (Team-based access, role-based access)
  • Service role bypass example for server-side operations
  • Testing and validation patterns to ensure policies behave correctly

Quick Start

Apply SQL blocks from the SKILL body to enable RLS on your tables. For example, connect to your database with psql and execute the policy snippets, adjusting table names to your schema. Example: psql -h <host> -d <db> -U <user> -f policies.sql

Frequently Asked Questions about supabase-rls

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce row-level security on Supabase database tables?

Row-level security (RLS) on Supabase enforces fine-grained access control by restricting data visibility at the database level. Enable RLS on your tables, then create policies using auth.uid() and USING/WITH CHECK clauses to define who can SELECT, INSERT, UPDATE, or DELETE rows. Apply the ready-made policy patterns provided to match your access requirements.

Can I use RLS policies for multi-tenant data isolation in Supabase?

Yes. RLS policies support multi-tenant isolation through team-based and role-based access patterns. Define policies that check tenant ownership or user roles before granting access, ensuring users see only their organization's or team's data. Supabase RLS enforces these restrictions at the database layer across all client connections.

How do I bypass RLS policies for server-side operations in Supabase?

Server-side operations use the service-role bypass: call your database through the service role instead of the authenticated user role. This grants unrestricted access on the server, while RLS policies still protect client-side queries. Apply service-role queries for administrative tasks that require full-table visibility.

What's the difference between USING and WITH CHECK clauses in RLS policies?

USING clauses filter which rows a user can read or modify (applies to SELECT, UPDATE, DELETE). WITH CHECK clauses validate rows before INSERT or UPDATE succeed. Together, they define both visibility and write permissions, ensuring users can only access and modify data they're authorized for.

How do I test RLS policies to verify they work correctly?

Test policies by querying tables as different authenticated users and roles, confirming that each user sees only permitted rows. Validate that INSERT, UPDATE, and DELETE operations either succeed or fail as expected. Use psql or Supabase's API with different auth contexts to simulate real access patterns.

Do I need PostgreSQL knowledge to set up Supabase RLS policies?

Yes. RLS policies are SQL constructs executed at the PostgreSQL layer. You need familiarity with SQL syntax, basic policy syntax, and PostgreSQL role concepts. Supabase provides ready-made policy templates you can adapt, but understanding SQL and how policies attach to tables is essential.