How to Configure Devin Supabase Prevent Delete

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up a devin supabase prevent delete workflow, create a custom database role. Grant that role read, insert, and update rights, and leave out delete rights. Teams often connect coding agents to databases using the default admin password. Every Supabase project gets a default postgres role with admin privileges. The password set at project creation belongs to this postgres role. Supabase warns teams not to share this password with third-party tools. Instead, Supabase recommends creating a ne

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 devin supabase prevent delete workflow, create a custom database role. Grant that role read, insert, and update rights, and leave out delete rights.

Teams often connect coding agents to databases using the default admin password. Every Supabase project gets a default postgres role with admin privileges. The password set at project creation belongs to this postgres role. Supabase warns teams not to share this password with third-party tools. Instead, Supabase recommends creating a new user for every external service. If an AI agent uses the admin role, a bad prompt can wipe tables.

How to set up devin supabase prevent delete rules

Start by creating a dedicated Postgres role for your AI agent. Do not use the default postgres admin role for automated tasks. Supabase withholds superuser status from the default role to block destructive tasks. Even so, the default postgres role still holds broad admin privileges. Queries run in the dashboard also run as this default postgres role.

When you make a new role for Devin, grant only needed rights. Give the role permission to read tables and insert or update rows. Do not grant permission to delete rows or drop tables. You can also turn on row rules to control which rows change. In Postgres, table privileges and row rules work together to block bad actions. If Devin tries to remove a row, the database rejects the query.

Why static database roles fall short for AI agents

Native database roles decide who can log in and which tables they touch. They work well when a service needs the exact same rights all day. Still, AI coding agents often do many different tasks across a project. One moment the agent checks a bug by reading production data. Next, the agent needs to fix a broken row or run a migration.

Static roles cannot tell a safe command from a risky one in flight. If you strip all write rights, the agent cannot fix data issues. If you grant broad write rights, a bad update can still overwrite columns. Static roles also do not rewrite sensitive fields like emails or phone numbers. Every query returns raw data unless you build views for every table. Finally, managing dozens of custom roles across many projects takes a lot of time. Teams often fall back to sharing the main admin login to move fast.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

How to manage schema changes and data privacy

Sometimes an AI agent must test schema changes or clean up test rows. You should keep these tasks away from your live customer database. Give the agent a separate test database where it can delete test rows. In your live database, keep delete rights revoked on all important tables.

You should also think about what data the agent reads during a session. Customer tables often hold emails, phone numbers, card numbers, and national IDs. Standard database roles return all rows and columns that the user can read by default. When data masking is in place, it rewrites matched fields in query results. This lets the agent debug issues while keeping sensitive customer fields protected.

Run guardrails and masking on the Postgres connection

Role grants and firewall rules are needed setup. Setup alone cannot check single SQL statements or mask sensitive rows in a response. By design, hoop.dev is an open-source proxy that sits beside Postgres, RDS, or Aurora as a sidecar for your Postgres. Clients and agent tools keep their credentials and point their connection string at the listener.

On each query, hoop.dev guardrails refuse disallowed drops, deletes, or table reads before they run. Next, hoop.dev data masking rewrites sensitive fields in returned rows that match your rules. Furthermore, hoop.dev holds SOC 2 Type II and logs every statement and verdict per resource. Check out the project on GitHub.

Frequently asked questions

Should I give Devin the default postgres role password?

No, the default postgres role has admin privileges across your database. Supabase advises creating a separate user for every external service you use.

Can row rules stop an AI agent from deleting rows?

Yes, unless the agent logs in with an admin role that bypasses rules. Create a standard role without delete grants and enable row rules on tables.

What happens if Devin needs to update data without deleting it?

Grant select, insert, and update rights to the agent role on specific tables. Leave out the delete right so the database blocks any delete statement.

The query runs. The emails stay hidden.