Supabase
database.supabase
Protects against destructive Supabase CLI operations including database resets, migration rollbacks, function/secret/storage deletion, project removal, and infrastructure changes
- 18blocking rules
- 35safe patterns
- 6Critical
- 12High
[packs]
enabled = ["database.supabase"]Evaluated when a command contains supabase, network-restrictions.
Blocking rules
Each rule ID is database.supabase:<name>. Use it in allowlists and [policy.rules].
Criticalsupabase-db-pushsupabase db push applies migrations to the remote database. Use --dry-run to preview first.
Explanation
supabase db push applies pending migrations to the remote (linked) database: - Migrations may include DROP/ALTER statements - Changes to the production database are irreversible - With --linked, this targets the live project database Always preview changes first: supabase db push --dry-run Dump remote database before pushing: supabase db dump -f backup.sql --linked
Criticalsupabase-db-resetsupabase db reset drops and recreates the entire database. All data will be lost.
Explanation
supabase db reset completely destroys and recreates your database: - All tables, views, and functions are dropped - All data is permanently deleted - Migrations are re-applied from scratch - Seed data (if configured) is re-inserted This is irreversible for any data not captured in migrations or seeds. With --linked, this targets the remote production database. Before resetting: supabase db dump -f backup.sql Review differences first: supabase db diff
Criticalsupabase-migration-downsupabase migration down reverts applied migrations. Schema changes and associated data may be lost.
Explanation
supabase migration down reverts previously applied migrations: - Reversed migrations may DROP tables, columns, or constraints - Data in dropped objects is permanently lost - With --linked, this targets the remote production database - The --version flag can revert multiple migrations at once Review applied migrations first: supabase migration list Dump the database before reverting: supabase db dump -f backup.sql --linked
Criticalsupabase-migration-repairsupabase migration repair modifies the migration history. This can cause drift between schema and migrations.
Explanation
supabase migration repair alters the migration history table: - Can mark migrations as applied or reverted - May cause schema drift if used incorrectly - Can break future migration runs Review migration status first: supabase migration list Dump the database before repairing: supabase db dump -f backup.sql
Criticalsupabase-projects-deletesupabase projects delete permanently removes the entire Supabase project and all its data.
Explanation
supabase projects delete permanently removes a Supabase project: - The database and all data are deleted - Auth users and sessions are removed - Storage buckets and files are deleted - Edge functions are removed - API keys are invalidated This action cannot be undone. Dump the database before deleting: supabase db dump -f backup.sql --linked Verify the project: supabase projects list
Criticalsupabase-sso-removesupabase sso remove disconnects an SSO identity provider. All users authenticating via that provider will be locked out.
Explanation
supabase sso remove disconnects an SSO identity provider: - All users authenticating via these providers are immediately locked out - Existing sessions may be invalidated - Re-adding the provider requires full reconfiguration List providers before removing: supabase sso list Inspect provider details: supabase sso show --id {provider_id}
Highsupabase-branches-deletesupabase branches delete permanently removes a preview branch and its database.
Explanation
supabase branches delete permanently removes a preview database branch: - The branch database and all its data are deleted - Any pending migrations on the branch are lost - This action cannot be undone Verify the branch first: supabase branches list Inspect branch details: supabase branches get --id {branch_id}
Highsupabase-config-pushsupabase config push overwrites the remote project configuration with local config.toml settings.
Explanation
supabase config push replaces the remote project configuration: - Auth, database, API, and other settings may be overwritten - Misconfiguration can break authentication flows - Changes take effect immediately on the live project Review your local config.toml before pushing.
Highsupabase-db-shell-destructivesupabase db shell with destructive SQL (DROP/TRUNCATE/DELETE/ALTER). Verify the command carefully.
Explanation
supabase db shell is being invoked with destructive SQL: - DROP permanently removes database objects - TRUNCATE removes all rows from tables - DELETE without WHERE removes all rows - ALTER can drop columns, change types, or remove constraints Dump the database before running destructive commands: supabase db dump -f backup.sql Check row count first: supabase db shell -- -c 'SELECT COUNT(*) FROM tablename'
Highsupabase-domains-deletesupabase domains delete removes the custom domain configuration. Clients using the custom domain will lose access.
Explanation
supabase domains delete removes the custom hostname configuration: - Clients accessing the service via the custom domain will fail - DNS records may need to be reconfigured - Re-setup requires DNS verification Check current domain configuration: supabase domains get
Highsupabase-functions-deletesupabase functions delete removes a deployed Edge Function. This causes immediate downtime for that function.
Explanation
supabase functions delete permanently removes a deployed Edge Function: - The function is immediately unavailable - Clients calling the function will receive errors - The function can be re-deployed from local source code Verify the function first: supabase functions list Download source before deleting: supabase functions download {function_name}
Highsupabase-migration-squashsupabase migration squash consolidates migrations and omits data manipulation statements (INSERT/UPDATE/DELETE).
Explanation
supabase migration squash consolidates multiple migration files into one: - DML statements (INSERT, UPDATE, DELETE) are omitted - Cron jobs, storage buckets, and vault secrets are lost - These must be manually recreated in the squashed migration - With --linked, modifies the remote migration history Review migrations before squashing: supabase migration list Dump the database before squashing: supabase db dump -f backup.sql
Highsupabase-network-restrictions-updatesupabase network-restrictions update modifies allowed CIDR ranges. Misconfiguration can lock out all database connections.
Explanation
supabase network-restrictions update modifies the database firewall rules: - Overly restrictive CIDR ranges can lock out all connections - Including your own application servers and admin access - Recovery may require Supabase support intervention Check current restrictions first: supabase network-restrictions get
Highsupabase-orgs-deletesupabase orgs delete permanently removes the organization and may affect all projects within it.
Explanation
supabase orgs delete permanently removes an organization: - All projects in the organization may be affected - Billing and subscription are cancelled - Team members lose access This action cannot be undone. List organization projects first: supabase projects list Verify the organization: supabase orgs list
Highsupabase-secrets-unsetsupabase secrets unset removes secrets from the project. Edge Functions depending on them will break immediately.
Explanation
supabase secrets unset removes environment variables from the project: - Edge Functions depending on these secrets will fail - Third-party integrations may break - The secret values cannot be retrieved after removal List secrets before removing: supabase secrets list
Highsupabase-stop-no-backupsupabase stop --no-backup stops the local stack and permanently deletes all data volumes.
Explanation
supabase stop --no-backup stops the local development stack and deletes data: - All local database data is permanently deleted - Storage objects in the local stack are removed - Auth users created locally are lost - Combined with --all, deletes ALL local Supabase projects' data Use 'supabase stop' without --no-backup to preserve data.
Highsupabase-storage-rmsupabase storage rm deletes objects from storage. With --recursive, entire directories are removed.
Explanation
supabase storage rm permanently deletes objects from Supabase Storage: - Deleted files cannot be recovered - With --recursive, entire directory trees are removed - User-uploaded content may be permanently lost List contents before deleting: supabase storage ls {path} Copy files locally before deleting: supabase storage cp {path} ./backup/
Highsupabase-vanity-subdomains-deletesupabase vanity-subdomains delete removes the vanity subdomain. Clients using it will lose access.
Explanation
supabase vanity-subdomains delete removes the vanity subdomain: - Clients using the vanity URL will lose access - Auth flows configured with the vanity URL will break - The subdomain name may not be reclaimable Check current configuration: supabase vanity-subdomains get
Safe patterns
Checked first. A command that matches one is never blocked by this pack.
supabase-db-diffsupabase-db-lintsupabase-db-dumpsupabase-db-shell-safesupabase-inspect-dbsupabase-statussupabase-startsupabase-servicessupabase-gen-typessupabase-test-dbsupabase-migration-listsupabase-migration-newsupabase-migration-fetchsupabase-db-push-dry-runsupabase-functions-listsupabase-functions-servesupabase-functions-downloadsupabase-functions-newsupabase-secrets-listsupabase-storage-lssupabase-projects-listsupabase-orgs-listsupabase-branches-listsupabase-branches-getsupabase-domains-getsupabase-domains-reverifysupabase-vanity-subdomains-getsupabase-vanity-subdomains-checksupabase-sso-listsupabase-sso-showsupabase-sso-infosupabase-network-restrictions-getsupabase-network-bans-getsupabase-ssl-enforcement-getsupabase-postgres-config-get