supabase-security-basics
Installation
SKILL.md
Supabase Security Basics
Overview
The Data API exposes configured schemas through PostgREST. Access depends on schema exposure, the requesting role’s object grants, and RLS policies; a non-RLS table is not automatically readable and writable without grants. This skill covers the three pillars of Supabase security: key separation (anon vs service_role), RLS policy enforcement, and API surface hardening.
Prerequisites
- Supabase project created (local or hosted) with Dashboard access
@supabase/supabase-jsinstalled (npm install @supabase/supabase-js)SUPABASE_URLandSUPABASE_ANON_KEYenvironment variables configured- Basic understanding of SQL and Postgres
Instructions
Step 1 — Understand the Two API Keys
Distinguish public and privileged keys. The table below describes legacy JWT-based keys; current projects also support publishable and secret keys, with different rotation and verification behavior: