# Supabase Production & RLS Security Pack

> Eight agent skills plus an RLS auditor and key-leak scanner that find and fix the Supabase mistakes behind most vibe-coded data leaks, tested on a real stack.

Supabase Production & RLS Security Pack is a paid AI agent skill on Agensi by Abdalkader Alhamoud, in Data & Databases. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: $29 (one-time purchase)
- Creator: [Abdalkader Alhamoud](https://www.agensi.io/creators/abdalkaderdev)
- Category: [Data & Databases](https://www.agensi.io/skills/data-databases)
- Version: 1.0
- Last updated: 2026-10-13
- Security: scan passed (2026-10-13); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/supabase-production-rls-security-pack
- Tags: database, security, supabase, postgres, row-level-security, nextjs, security-audit

## About this skill

Agents build Supabase apps fast and leave the doors open: tables without RLS, `using (true)` on writes, policies that trust `user_metadata`, views that bypass RLS, `SECURITY DEFINER` functions callable by anyone at `/rest/v1/rpc`, the service role key in a client component, `getSession()` used for server auth, public buckets anyone can list, Edge Functions with `verify_jwt` off and no check in code. Most training data also predates the publishable and secret keys, opt-in Data API exposure and Next.js 16's `proxy.ts`, so agents keep writing `SUPABASE_ANON_KEY` and deprecated auth-helpers code.

This pack gives the agent current rules for each of those, checked against the Supabase docs and source, and two tools that look at your real project.

### What's inside

- **supabase-production**: entry point, pre-flight checklist, versions, the platform changes that invalidate older advice.
- **supabase-rls**: per-operation policies, `(select auth.uid())`, teams via private definer helpers, recursion, `security_invoker` views, MFA `aal2`, anonymous users, custom claims, column privileges, indexes, and two pgTAP test files.
- **supabase-security-audit**: `audit-rls.mjs` connects to a database URL, runs 21 checks and prints a fix for each finding.
- **supabase-api-keys**: publishable/secret vs anon/service_role, the retirement timeline, migration, leak response, and `scan-key-leaks.mjs` for source, `.env` files and build output.
- **supabase-auth-production**: Next.js 16 `@supabase/ssr` setup, `getClaims`, safe callback routes, redirect URLs, SMTP, rate limits, CAPTCHA, TOTP MFA.
- **supabase-storage-realtime**: bucket limits, the policy each storage call needs, owner folders, private Realtime channels.
- **supabase-edge-functions**: `verify_jwt`, `@supabase/server` auth modes, webhooks, CORS, secrets, a 401 decoder.
- **supabase-migrations-backups**: CLI migrations without drift, CI, branching, backups and PITR, restore drills.

### Verified, not just written

Every SQL block runs in an automated test against a local Supabase stack, the policy tests pass under `supabase test db`, TypeScript typechecks under `--strict`, and the Storage, Realtime and Edge Function patterns were exercised with real requests. It also caught a policy in Supabase's own MFA docs that fails with `permission denied for table mfa_factors`; the pack ships the working version.

### Versions

supabase-js 2.117, @supabase/ssr 0.12, @supabase/server 1.9, Supabase CLI 2.120, Postgres 17, Next.js 16.

## Known limitations

Requires Supabase CLI 2.120+ and @supabase/ssr. Does not support legacy auth-helpers or versions of Next.js older than 15. Standardized for Postgres 17.11.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Supabase Production & RLS Security Pack skill from Agensi" and describe your task.
3. Buy it on the listing or let your agent ask you first; your agent then loads it from Agensi when it needs it. Every paid skill has a money-back guarantee: https://www.agensi.io/docs/money-back-guarantee

## Frequently asked questions

### How does this skill differ from simply asking a standard LLM to secure my Supabase project?

This skill is specifically tuned for the 2026 Supabase ecosystem, addressing the deprecation of legacy keys and the shift to Postgres 17, which general-purpose AI models often overlook or hallucinate.

### What are the specific technical requirements and version constraints for using this skill?

It targets supabase-js 2.117, @supabase/ssr 0.12, Supabase CLI 2.120, Postgres 17 (15+ for security_invoker views) and Next.js 16, with notes for Next.js 15. Projects still on the deprecated auth-helpers get a migration path to @supabase/ssr. The scripts need Node.js 20+ and nothing else.

### What exactly is included in the purchase of the Supabase Production skill?

The skill provides a specialized hardening framework, including multi-point security audit checklists, leak detection for build outputs, and migration paths for the latest publishable/secret key systems.

### Can this skill help if my project has already suffered a data exposure or credential leak?

Yes. The API keys guide has a leak response: rotate to the new secret keys, revoke the leaked one, find where it was exposed with scan-key-leaks.mjs, then run audit-rls.mjs to close the RLS gaps that made the leak damaging.

### How do I get started with the audit process after purchasing the skill?

Ask your agent to audit the Supabase project. It runs audit-rls.mjs against your database connection string (local, direct or pooler), explains each finding, writes a fix migration and pgTAP tests, then re-runs the audit to confirm.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
