How to Configure OpenHands Supabase Prevent Delete
To set up openhands supabase prevent delete rules, create a dedicated database role without delete rights. Then, give your coding agent those restricted credentials instead of your main admin password. Many teams take a shortcut and hand over the default admin password to their agent. This broad setup lets an automated agent wipe out production rows or drop whole tables. How openhands supabase prevent delete works with database roles Every new project starts with a default postgres role that
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 openhands supabase prevent delete rules, create a dedicated database role without delete rights. Then, give your coding agent those restricted credentials instead of your main admin password. Many teams take a shortcut and hand over the default admin password to their agent. This broad setup lets an automated agent wipe out production rows or drop whole tables.
How openhands supabase prevent delete works with database roles
Every new project starts with a default postgres role that holds broad admin privileges. The platform does not grant full superuser status because that allows destructive operations. Still, this default admin role can still delete data and drop tables across your project. The password you set at project creation belongs to this powerful default role. Official docs states you should never share this password with an outside service. Instead, you should make a new database user for every service or coding agent.
When you run OpenHands, the agent executes database commands to build features or fix bugs. If it logs in with the default admin user, nothing stops a delete query. To block deletions, an admin must create a fresh role just for the agent. You grant this new role select, insert, and update rights on specific tables. You leave out the delete privilege and block table drop rights at the schema level. When the agent tries to remove rows, the database rejects the command right away.
Why static database roles fall short for coding agents
Custom database roles decide who logs in and which general commands they can run. This native setup solves basic accidents by blocking delete statements across an entire table. Still, static role rules apply the same way to every single query in a session. They do not inspect what individual statements or updates do while in flight.
A coding agent with update rights can still overwrite every row with blank values. That bad update destroys your data just like a delete statement would. Also, a role with read rights can pull sensitive columns in bulk during a task. Standard roles cannot rewrite matched fields like emails, phone numbers, card numbers, or national IDs. Teams also struggle when an agent needs to delete one bad migration row safely. Granting delete rights for five minutes requires manual role changes and creates human error.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Managing agent database tasks with safer workflows
To keep production data safe, teams need controls that check queries before they run. Start by removing the default admin password from all agent config files and scripts. Give the agent a narrow database role that only reads and writes safe tables. Separate your test databases from live customer data whenever an agent writes new schema changes. When an agent must run a risky command, require a human to review it first. Checking each statement in flight stops bad updates and keeps sensitive fields hidden in 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
Should I give my coding agent the default postgres password?
No, the default postgres role has admin privileges across your project. You should create a separate database user with narrow rights for each outside service.
Can a role without delete rights still ruin table data?
Yes, a user with update privileges can still overwrite existing rows with empty or wrong values. Static table grants cannot check how many rows an update statement will change.
How do I know if a query ran from the project dashboard?
Queries run inside the project dashboard execute under the default postgres admin role. The platform attaches a source dashboard comment to those queries so you can spot them.
Related guides
In this post