Overview
Connect Supabase to Continue Mission Control to enable AI-powered database workflows. When Supabase is enabled, Continue can audit Row Level Security (RLS) policies, generate secure migrations, optimize queries, and maintain database security automatically.What You Can Do with Supabase Integration
- Automatically audit RLS policies on every PR
- Generate secure migrations for missing security policies
- Identify and fix critical security gaps
- Optimize database queries and schemas
- Monitor database performance and security
- Validate schema changes before deployment
Setup
1
Navigate to Integrations
Go to the Supabase Integration.
2
Connect Supabase
Click âConnectâ to Supabase.
3
Authorize Supabase Access
Youâll be redirected to Supabase to authorize Continue:
- Select the Supabase organization and project to connect
- Review the requested permissions
- Click âAuthorizeâ to complete the connection
4
Configure Workflows
After connecting, set up your first workflow. The integration supports:
- On PR open: Audit RLS policies when PRs are created
- Manual tasks: Run database operations on-demand
- Scheduled jobs: Periodic security audits and performance checks
Workflows
Supabase security review
Trigger: On PR openDescription: Connect your Supabase workspace to agents that can explore schemas, run queries, create and update documents, and handle migrations using natural language When a pull request is opened, this security-focused workflow automatically:
-
Analyzes PR Changes - Identifies affected tables from:
- Migration files (
supabase/migrations/*.sql) - SDK/library usage (
.from('table_name')calls) - Schema references in type definitions
- Migration files (
-
Audits RLS Policies - Uses Supabase MCP to inspect:
- Whether RLS is enabled on affected tables
- Existing policy configurations
- Potential security gaps
-
Classifies Security Risks - Prioritizes findings by severity:
- đ´ Critical: No RLS on tables with sensitive data
- đ High: Overly permissive policies (e.g.,
USING (true)) - đĄ Medium: Missing standard access patterns
- đ˘ Low: Policy optimization opportunities
-
Generates SQL Migrations - Creates fixes for Critical/High/Medium issues:
- Enables RLS on unprotected tables
- Adds missing user-scoped policies
- Implements proper access controls
- Includes rollback commands
- Commits Fixes to PR Branch - Automatically pushes security fixes
- Posts Comprehensive Comment - Explains all findings and changes
Why This Matters
Row Level Security (RLS) is Supabaseâs primary security mechanism. Without proper RLS policies:
- Users can access other usersâ private data
- Unauthorized modifications can occur
- Sensitive information may be exposed
Smart Scoping: The agent only audits tables directly referenced in your PR changes, not your entire database. This keeps audits focused and efficient.
Example PR Comment
After auditing RLS policies, the agent posts a comprehensive comment like this:Security Risk Levels Explained
đ´ Critical - Immediate Fix Required
đ´ Critical - Immediate Fix Required
What it means: Tables with no RLS that contain sensitive dataExamples:
- User profiles, emails, or authentication data
- Financial information or payment details
- Private messages or personal content
- New tables created without RLS
đ High - Important Security Gap
đ High - Important Security Gap
What it means: Overly permissive policies that could allow unauthorized accessExamples:
- Policies using
USING (true)without justification - Write access without proper validation
- Admin policies that donât verify admin status
- Missing
WITH CHECKclauses
đĄ Medium - Missing Best Practices
đĄ Medium - Missing Best Practices
What it means: Partial RLS coverage or missing standard patternsExamples:
- SELECT policy exists but no UPDATE/DELETE
- No user-scoped policies for personal data
- Missing public read policies where appropriate
- Incomplete CRUD policy coverage
đ˘ Low - Optimization Opportunity
đ˘ Low - Optimization Opportunity
What it means: Policies work but could be improvedExamples:
- Poor policy naming conventions
- Inefficient policy logic
- Missing documentation
- Duplicate or redundant policies
Use Cases
Automated Security Audits
Catch security issues before they reach production:RLS Policy Auditor
Task Example: Automatically audit RLS on every PR that touches database schema or queriesWhat the Agent Does:
- Scans PR for database-related changes
- Identifies all affected tables
- Checks RLS status and policies
- Generates fixes for security gaps
- Commits migrations to the PR branch
Database Migration Generation
Create secure migrations automatically:Migration Generator
Task Example: âGenerate a migration to add RLS policies for the new messages tableâWhat the Agent Does:
- Analyzes table structure and purpose
- Determines appropriate access patterns
- Generates SQL with RLS policies
- Includes proper naming and comments
- Adds rollback commands
Query Optimization
Improve database performance:Query Optimizer
Task Example: âAnalyze slow queries and suggest optimizationsâWhat the Agent Does:
- Identifies queries in your codebase
- Checks for missing indexes
- Suggests query rewrites
- Recommends schema changes
- Estimates performance impact
Schema Validation
Ensure schema changes follow best practices:Schema Validator
Task Example: âValidate that all new tables follow our schema standardsâWhat the Agent Does:
- Checks naming conventions
- Validates data types and constraints
- Ensures proper indexes exist
- Verifies RLS is enabled
- Reviews foreign key relationships
Access Pattern Analysis
Understand how your database is used:Access Analyzer
Task Example: âAnalyze SDK usage patterns and suggest RLS policiesâWhat the Agent Does:
- Scans codebase for Supabase client calls
- Identifies data access patterns
- Detects security anti-patterns
- Recommends appropriate RLS policies
- Generates migration files
Development Environment Sync
Keep dev and production schemas aligned:Schema Sync Agent
Task Example: âCompare dev and production schemas and generate sync migrationsâWhat the Agent Does:
- Connects to multiple Supabase projects
- Compares schema definitions
- Identifies differences
- Generates sync migrations
- Validates compatibility
Running Supabase Agents in Mission Control
You can run Supabase-connected agents in two ways as one-off tasks or automated workflows:Common RLS Policy Patterns
The agent recognizes and implements these standard security patterns:User-Scoped Access
Users can only access their own data:Admin Override
Admins can access all data while users access only their own:Public Read, Authenticated Write
Anyone can read, only authenticated users can write:Soft Delete Handling
Exclude soft-deleted records from queries:Troubleshooting
Authentication issues
Authentication issues
Problem: Agent canât connect to SupabaseSolutions:
- Re-authenticate through the integrations page
- Verify OAuth token hasnât expired (expires after 7 days)
- Check project permissions
- Ensure Supabase project is accessible
- For CI/CD, verify environment variables are set
No tables detected in PR
No tables detected in PR
Problem: Agent reports no tables found to auditSolutions:
- Verify PR contains database-related changes
- Check that migration files use standard naming
- Ensure SDK calls use
.from('table_name')pattern - Review PR for schema/type definition changes
RLS policies not generated
RLS policies not generated
Problem: Agent identifies issues but doesnât create fixesSolutions:
- Check if issues are Low priority (agent suggests only)
- Verify agent has write access to repository
- Review error messages in agent logs
- Ensure Supabase MCP connection is working
- Check if migration directory exists
Generated policies too restrictive
Generated policies too restrictive
Problem: Auto-generated RLS policies block legitimate accessSolutions:
- Review and adjust policies in the generated migration
- Add custom logic for your specific access patterns
- Mark tables for manual policy creation if needed
- Provide feedback to improve future policy generation
Migration conflicts
Migration conflicts
Problem: Generated migration conflicts with existing changesSolutions:
- Review both migrations and merge manually
- Ensure migration timestamps are unique
- Check for duplicate policy names
- Adjust generated migration as needed
Security Best Practices
RLS Policy Checklist
Before deploying RLS changes, verify:
- RLS is enabled on all sensitive tables
- Policies cover all CRUD operations (SELECT, INSERT, UPDATE, DELETE)
- User-scoped data includes
auth.uid()checks - Admin overrides verify admin role properly
- Public access is intentional and documented
- Policies include
WITH CHECKclauses for writes - Soft deletes filter out
deleted_at IS NOT NULL - Policy names follow naming conventions
- Rollback commands are included
- Policies are tested with different user scenarios
Support & Resources
Supabase MCP Cookbook
Complete guide to database security automation with Supabase and Continue
GitHub Integration
Combine Supabase with GitHub for automated security workflows
Supabase RLS Documentation
Official Supabase Row Level Security documentation
Supabase MCP Docs
Learn about the Supabase MCP Server.