How to Configure OpenHands Supabase Connect
You set up openhands supabase connect by creating a dedicated database role for your coding agent. Then you pass that role and its password into the agent workspace. Many teams skip this step and use the default project password to save time. This gives the autonomous agent broad admin rights over every table in your project. A single bad prompt or agent mistake can then alter schemas or wipe production rows. How openhands supabase connect works with database roles Every new Supabase project
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.
You set up openhands supabase connect by creating a dedicated database role for your coding agent. Then you pass that role and its password into the agent workspace. Many teams skip this step and use the default project password to save time. This gives the autonomous agent broad admin rights over every table in your project. A single bad prompt or agent mistake can then alter schemas or wipe production rows.
How openhands supabase connect works with database roles
Every new Supabase project comes with a default postgres role. This default role has admin privileges across the database. Supabase does not grant full superuser status to prevent destructive system tasks. Still, the default role still holds high privileges for most database work. The password you pick at project creation belongs to this default admin role.
Supabase docs state you should not share this password with outside tools. Instead, you should create a new database user for each external service. When you set up openhands supabase connect, the agent runs inside its own container. The agent reads your database string from its local settings to run SQL commands. It uses this string to inspect tables, write migrations, and test app logic.
To keep your data safe, create a dedicated role just for the coding agent. Grant this role permission to read or write only the specific tables it needs. Supabase also includes built-in roles like anon for public requests. These built-in roles fit web apps, while a custom role fits a direct agent link.
What native roles solve and what they leave open
A dedicated Postgres role solves the first part of the access problem. It decides which service can log in and which tables that user can touch. It also stops the agent from using the main admin password. Queries run in the Supabase dashboard execute as the main postgres role. Using a separate role for your agent helps you tell human and agent actions apart.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Still, static database roles only check permissions at login and table level. They do not inspect what individual SQL statements do while in flight. Once an agent logs in with write rights, it can drop rows in allowed tables. A role cannot stop an agent from running a broad delete command by mistake.
Static roles also do not change how sensitive fields return in query results. If the agent queries a user table to debug a bug, it gets full rows. Those rows might hold emails, phone numbers, card numbers, or national IDs. The database sends all of those values straight into the agent context and model prompts. Native roles cannot rewrite matched fields in results before the agent reads them. You also have to store a password inside the agent container, which adds key rotation work.
Add query and result controls beside Postgres
Grants and pools govern who logs into PostgreSQL. Yet every query in an open session still runs with that role's full scope. In practice, hoop.dev runs beside your database as a sidecar for your Postgres. It reads plain and prepared queries on the wire with no change to your users or drivers.
When a tool or agent sends SQL, hoop.dev Postgres controls check each statement against your deny rules. An AI Analyzer you configure can also score intent or hold a risky query for human review. Matched sensitive columns in result rows are masked in memory before they reach the caller. Each query and decision is logged per listener, which generates evidence for SOC 2, HIPAA, and GDPR audits. View the binary on GitHub.
Frequently asked questions
Should I give OpenHands the default postgres role password?
No, you should keep the default postgres password private. Supabase recommends creating a separate database user for every third-party tool or agent. This limits the damage if an agent runs a bad query or leaks its settings.
How do I limit what tables the coding agent can change?
Create a custom role in your database and grant rights only to specific tables. Give read rights on reference tables and write rights only on test schemas. Never grant admin rights to an autonomous agent.
Can database roles hide sensitive user data from AI prompts?
Standard roles grant or block table and column reads, but they do not mask values. If a role can read a column, the database returns the full text to the agent. You need query result masking to rewrite emails or card numbers in flight.
Related guides
In this post