How to Configure OpenHands Supabase Approval
To set up openhands supabase approval, create a restricted database user for your coding agent. Then pair that role with human confirmation before the agent runs any write queries. Many teams start by giving their AI agent the main project password to ship fast. When an agent holds full admin rights, one bad prompt can drop production tables. How openhands supabase approval works with database roles Every new Supabase project comes with a default postgres role that holds admin rights. Supabas
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 approval, create a restricted database user for your coding agent. Then pair that role with human confirmation before the agent runs any write queries. Many teams start by giving their AI agent the main project password to ship fast. When an agent holds full admin rights, one bad prompt can drop production tables.
How openhands supabase approval works with database roles
Every new Supabase project comes with a default postgres role that holds admin rights. Supabase does not give out full superuser rights because those allow destructive database actions. Instead, the platform grants the default postgres role extra permissions for common admin tasks. When you set up a project, the password you pick belongs to this postgres role. Queries that you run inside the project dashboard also run under this admin role.
Supabase states that you should not share this main password with outside tools. Instead, the docs recommend that you make a fresh database user for each external service. Supabase also creates built-in roles like anon, authenticated, service_role, and authenticator for each project. For an AI coding agent like OpenHands, a dedicated role limits what tables it touches. You can grant this role read rights on most tables and write rights where needed.
On the agent side, OpenHands can run shell commands, edit files, and connect to databases. When you turn on confirmation steps, the agent pauses before it executes an action. A developer must check the proposed action and click approve before the agent proceeds. Combining a scoped database user with agent confirmation forms the base of your setup.
Why native roles leave a gap during live sessions
Database roles and basic agent prompts solve the first layer of access control. A custom role stops the agent from touching tables outside its assigned schema. Agent confirmation steps let a human check a shell command before it runs locally. These native tools decide who can log in and start a task.
Still, static roles do not inspect individual SQL statements once a session is open. If an agent needs permission to update rows, that role stays active for every query. The database cannot tell a safe single-row update from a bulk table delete. Both commands use the exact same table permission inside the database engine.
Approval Chains & Escalation + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Local agent prompts also lack visibility for the wider engineering team. When one developer approves a command on a laptop, central security teams see no record. Also, raw query results flow back into the agent context window without filters. If a table holds emails, phone numbers, or card numbers, the model reads them all. Teams need statement-level checks and field masking that rewrite sensitive data in query results.
Best practices for safer AI database workflows
Start by auditing every database credential stored in your agent workspace today. Remove the default postgres role password from all agent config files right away. Create a dedicated role for OpenHands and revoke public creation rights on your schemas. Grant read permissions only on the specific tables the agent needs for its task.
Separate your read workflows from your schema change workflows whenever possible. Allow the agent to read table structures and sample rows with a read-only role. When the agent writes a migration file, require a human peer review before running it. Never let an automated coding loop run schema changes against production data without a check. Keep production credentials out of local agent files to stop accidental writes.
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 OpenHands the default Supabase postgres password?
No, you should never share the main postgres password with an AI coding agent. That default role has admin rights, so create a separate user with limited permissions instead.
Does Supabase give superuser rights to the default admin role?
No, Supabase withholds superuser rights to prevent destructive actions against the hosted database platform. The default postgres role gets admin rights with extra grants for safe daily tasks.
Why are static database roles not enough for AI agents?
Static roles check permissions at login time, not what each individual SQL query does. A role that allows row updates can still alter thousands of production records at once.
Related guides
In this post