maelrx/skills-aletheia/03-supabase-database-security
Claude Code and agent skill by maelrx/skills-aletheia
- community
Checking that the SKILL.md file is still in the repository.
Use when auditing Supabase/PostgreSQL security and reliability. Checks RLS, policies, anon vs service_role keys, tenant filters, sensitive data, backups, migrations, indexes, and connection pooling.
Install
npx vskill@latest install maelrx/skills-aletheia/03-supabase-database-securitySKILL.md
The same SKILL.md was published earlier as maelrx/skills-aletheia/03-supabase-database-security.
Supabase and Database Security
Mission
Treat the database as the vault. Supabase is powerful, but its auto-generated APIs and public anon key are only safe when Row Level Security and policies are correct. The goal is to prevent total data exposure, cross-tenant leakage, data loss, and serverless connection failures.
Use when
- The project uses Supabase, PostgreSQL, Prisma, Drizzle, SQLAlchemy, Neon, or serverless databases.
- The user asks about RLS, service role keys, anon keys, backups, migrations, slow queries, pooling, or tenant isolation.
Workflow
1. Inventory database access
Map every place that can read/write data.
2. Check key usage
Rules:
anon_keymay be public, but only if RLS policies are correct.service_role_keyis root-like and must only exist server-side.service_role_keybypasses RLS; code using it must manually check permissions.
Search:
P0 if service role appears in browser code or public env variables.
3. Verify RLS and policies
If SQL access is available, run:
Required:
- RLS enabled on every table containing user/customer/tenant data.
- SELECT/INSERT/UPDATE/DELETE policies exist as needed.
- Policies filter by
auth.uid() = user_idor tenant membership. - Avoid broad
authenticatedpolicies that expose all rows.
4. Verify query-level tenant/user filtering
Even with RLS, server-side code should include explicit filters:
Red flags:
select('*')on user data without.eq('user_id', ...)or tenant filter.- Server Actions using service role without manual permission check.
- Admin dashboards reading all records without role verification.
5. Check backups and migration safety
Search migrations:
Required:
- Backup before destructive changes.
- Migration tested in staging before production.
- Destructive changes performed in phases: add -> migrate -> verify -> drop.
- Restore process tested, not assumed.
6. Check indexes and connection pooling
Required indexes:
user_id,organization_id/tenant_id,created_at, status fields, email, foreign keys used in filters.
For serverless apps using Supabase/Postgres:
- application connection string should use pooler port
6543where applicable; - direct port
5432should be reserved for migrations/admin tasks.
Search:
7. Sensitive data review
Search schema and code for sensitive fields:
Rules:
- Never store raw credit card data.
- Prefer not storing CPF/document IDs unless essential.
- Passwords must be hashed by a proper auth provider or strong password hashing.
- Logs must not contain sensitive values.
Output contract
Stop criteria
Stop and report before any destructive migration, service role rotation, production RLS change, or operation that could lock out users or delete data.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/03-supabase-database-security/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/maelrx/skills-aletheia/03-supabase-database-security)