Skip to content
Back to skills

Supabase Apps

ASecurity

Build secure Supabase apps: Row-Level Security policies, auth client separation, migrations and edge functions

  • 5 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added November 30, 2026
developmentrustgosqlbackendsecurity

Works with

  • cli

Security analysis

A100/100

Scanned November 30, 2026

npx -y skills add AdityaaaTiwari/ANVIL --skill supabase-apps --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Supabase Apps?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Supabase Apps
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/adityaaatiwari-supabase-apps/badge)](https://www.skillsdirectory.com/skills/adityaaatiwari-supabase-apps)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Build secure Supabase apps: Row-Level Security policies, auth client separation, migrations and edge functions
profile: standard
tags: supabase, postgres, auth, backend
---

# Supabase apps

Use when configuring Supabase Auth, Postgres RLS policies, storage buckets, or Edge Functions.

## Row-Level Security (non-negotiable)
- Enable `ALTER TABLE ... ENABLE ROW LEVEL SECURITY;` on **every table** in exposed schemas (`public`); tables without RLS allow unrestricted reads/writes via the public `anon` key.
- Write explicit `USING` and `WITH CHECK` policies using `(SELECT auth.uid()) = user_id` (wrapped in scalar `SELECT` so Postgres evaluates the plan once instead of per row), and index all policy columns (`user_id`, `org_id`).
- Never silently pass permissive `USING (true)` policies on write operations; restrict role targets explicitly (`TO authenticated`).

## Keys and client usage
- Keep `SUPABASE_SERVICE_ROLE_KEY` strictly server-side (bypasses all RLS). Never expose it via `NEXT_PUBLIC_*`, `VITE_*`, or client bundles.
- Use `@supabase/ssr` with cookie-based server clients for SSR frameworks, always validating identity via `supabase.auth.getUser()` on the server rather than trusting `getSession()` cookies alone.

## Storage and schema changes
Enforce RLS policies on `storage.objects` checking `bucket_id` and path owner prefix, and author schema/policy edits as reviewed SQL migrations under `supabase/migrations/` (`supabase db diff`).

## Verify
Run tests asserting cross-tenant queries fail under real `anon`/`authenticated` JWTs (zero rows returned), check linter advisors (`supabase db lint`), and inspect migration diffs.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.