How to Configure OpenHands Supabase Credentials
You set up openhands supabase credentials by making a dedicated database user for the agent. Then you pass that role into the agent container at startup. Many teams take a fast shortcut during testing. They paste the default database admin password into the agent workspace. This gives an autonomous coding tool full admin rights over every table. One bad query from the agent can drop tables or leak user data. How openhands supabase credentials work in a project Every new database project start
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 credentials by making a dedicated database user for the agent. Then you pass that role into the agent container at startup. Many teams take a fast shortcut during testing. They paste the default database admin password into the agent workspace. This gives an autonomous coding tool full admin rights over every table. One bad query from the agent can drop tables or leak user data.
How openhands supabase credentials work in a project
Every new database project starts with a default postgres role. This role holds admin rights across the database. The platform does not grant full superuser status to prevent destructive system commands. Still, this default admin role has broad power over your schemas and data. You set the password for this admin role when you create the project. You should never share this password with an external tool or coding agent. Instead, the platform advises making a separate database user for each external service.
Each project also includes built-in roles like anon, authenticated, and service_role. The anon role handles public requests that lack a user login. When you set up an AI coding agent, you should make a custom role. You grant this new role read or write rights on specific tables only. Then you load those login details into the agent runtime workspace. The agent uses this scoped role to run queries and inspect your schema.
What native database roles solve and what they miss
A dedicated database role stops an AI agent from ruling your whole project. You can block the agent from dropping production tables or changing user permissions. You can also limit which schemas the agent can read during a task. This setup solves the basic problem of who can log into the database.
Still, static database roles leave a big gap during live agent runs. A role check happens when the agent logs in and starts a session. It does not inspect individual queries while they run in flight. If a role has read access to a customer table, it reads everything. The database returns raw emails, phone numbers, card numbers, and national IDs. Static roles also require you to store secret passwords inside the agent container. Because the agent runs shell commands, it can read its own workspace variables. A bad prompt could trick the agent into printing those secrets in logs. Also, native roles cannot pause a risky delete query to ask a human first.
Ephemeral Credentials + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Scoping agent permissions for safer database tasks
To keep your data safe, start with the smallest possible permission set. Give the coding agent a role that only reads schema structure when possible. If the agent must test migrations, point it at a disposable test branch. Do not reuse the same database user across multiple bots or third-party tools. When each service has its own user, you can revoke one key fast. You can also track which tool ran a heavy query by checking the role. Still, static keys in a container remain a risk for production data. Teams running AI agents against real data need controls that work per query.
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 AI agent the default postgres role password?
No, you should never share the default postgres password with an external service. That role has admin rights, so make a separate user with limited permissions instead.
Why are read-only roles still risky for AI coding agents?
A read-only role still returns every column in an allowed table by default. The agent will pull raw emails, phone numbers, and card numbers into its prompt context.
How can I track queries coming from the database dashboard versus an agent?
Queries run in the project dashboard execute as the postgres role with a source comment. Give your agent a custom role name so its queries stand out in logs.
Related guides
In this post