How to Configure Continue Supabase Prevent Delete

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up a continue supabase prevent delete rule, create a restricted Postgres role. You must revoke row removal rights from that role before your AI coding tool logs in. Engineering teams often give AI assistants the default admin login to move fast. That default login can wipe out production tables if a prompt goes wrong. Using a custom database user stops the AI tool from running destructive queries. How to set up continue supabase prevent delete in Postgres Every new Supabase project com

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

To set up a continue supabase prevent delete rule, create a restricted Postgres role. You must revoke row removal rights from that role before your AI coding tool logs in. Engineering teams often give AI assistants the default admin login to move fast. That default login can wipe out production tables if a prompt goes wrong. Using a custom database user stops the AI tool from running destructive queries.

How to set up continue supabase prevent delete in Postgres

Every new Supabase project comes with a default postgres role. This default role has admin rights across your tables. Supabase does not give out full superuser rights because those allow destructive system actions. Still, the default postgres role can drop tables and remove rows. You receive the password for this admin role when you create a project. Supabase warns that you should never share this admin password with outside tools. Instead, you should make a fresh database user for each external service.

To protect your data, create a dedicated role just for the Continue extension. Grant this new role permission to read tables and insert or update records. Do not grant permission to remove rows or drop schemas. Next, put this new user and password into your local Continue settings. When the AI assistant runs a query, Postgres checks the role permissions first. If the assistant tries to remove a row, the database blocks the action right away.

What native database roles solve and what they miss

Native Postgres roles are great for blocking whole classes of commands. A role without delete privileges will stop accidental row removal every single time. It also keeps the main project password out of local config files. If a developer laptop gets lost, you only need to revoke that one user.

Still, static database roles only check who logs in at the start. They cannot inspect individual commands while they are in flight. A developer often needs to update records or fix a broken schema during work. If you block all write actions, the AI assistant becomes much less helpful. If you allow updates, a bad command can still overwrite thousands of rows with blank values. Static roles also cannot tell if a human or an AI wrote a specific query.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Why local AI coding assistants need safer database rules

Tools like Continue run right inside the code editor on a developer machine. They read project files and run database queries to help write and test code. Because they run locally, teams often share one static login string across the group. Everyone uses the same role, so audit logs show the exact same database user. When a bad query changes data, you cannot see which person or prompt caused it.

Also, database roles apply the same blanket rule to every table in a schema. You have to maintain complex grant rules whenever your team adds new tables. If someone forgets to lock down a new table, the AI tool might gain full write rights. Relying only on manual role setup leaves room for human error over time. Teams need a way to inspect each query before the database runs it. They also need to rewrite sensitive fields like emails, phone numbers, and card numbers in query results.

Check every Postgres query on the wire

Database roles and network rules decide who can open a session. They do not read what each SQL statement does after login. With hoop.dev, you run an open-source proxy, a sidecar for your Postgres. It runs beside your database and reads the Postgres wire protocol. Your apps and agents keep their login details and change only the host and port in the connection string their tool uses.

Before a query runs, hoop.dev guardrails check the statement by its effect, table, or pattern. They refuse bad deletes or drops with a real Postgres error. On the way back, hoop.dev data masking rewrites sensitive values in returned rows based on your rules. Every query and verdict goes to the audit trail. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and generates evidence for HIPAA, GDPR, and PCI DSS. See the code on GitHub.

Frequently asked questions

Can I use the default postgres role with Continue?

You should not use the default postgres role with third-party tools. It has broad admin privileges, and Supabase recommends making a separate user for every external service.

Does stopping delete commands also stop bad update queries?

No, revoking delete permissions only stops row removal commands. An AI tool with update privileges can still overwrite existing table rows if a query lacks a proper filter.

How do queries run in the Supabase Dashboard differ from external tools?

Queries run inside the Supabase Dashboard execute as the admin postgres role. They also include a dashboard source comment so you can spot them in logs.

The query runs. The emails stay hidden.