How to Configure Goose Supabase Read Only Access
You set up goose supabase read only access by creating a dedicated Postgres database role. Then you grant that new role select rights on specific tables and schemas. Many teams take a shortcut and use the default project password for their coding agent. That default role has admin rights and can alter schemas or drop production tables. A single bad prompt can lead to deleted rows or broken apps. How goose supabase read only access works in Postgres Every project starts with a default postgres
Auditor Read-Only Access + Customer Support Access to Production: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up goose supabase read only access by creating a dedicated Postgres database role. Then you grant that new role select rights on specific tables and schemas. Many teams take a shortcut and use the default project password for their coding agent. That default role has admin rights and can alter schemas or drop production tables. A single bad prompt can lead to deleted rows or broken apps.
How goose supabase read only access works in Postgres
Every project starts with a default postgres role that holds admin rights. The platform does not grant full superuser rights because those allow destructive system work. Even so, the default password set at project creation belongs to this admin role. Official docs advise that you never give this admin password to an outside service. Instead, you should make a fresh database user for every tool or service.
To lock down your agent, an admin logs into the database dashboard. Queries run in the dashboard execute under the admin role and carry a dashboard comment. From there, you create a new role made just for the agent. You grant usage on the target schema and select rights on the needed tables. You also set default rules so future tables grant select rights to this role. Finally, you give this new role and password to your local Goose setup. When the agent runs a database extension, it logs in with those read rights.
Why you should avoid default roles for an AI agent
New projects also come with built-in roles like anon and other default profiles. Teams sometimes reuse these built-in keys or the main admin password to save time. This choice creates high risk when an automated tool writes and runs queries. An agent explores schemas, tests ideas, and executes statements at machine speed. If it logs in as the admin role, it can change table structures by mistake.
Using a dedicated role for each service isolates your agent from human admins. If you need to cut off the agent, you can drop or rotate that single user. Your main apps and dashboard users keep working without any downtime. Clear role separation is the foundation of safe database management for automated tools.
Auditor Read-Only Access + Customer Support Access to Production: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native database roles solve and what they miss
A read only role stops the agent from running write, update, or delete commands. Postgres checks the role rules and blocks any change to the stored data. This setup solves the problem of accidental data loss or schema changes. It decides who can log in and which tables they can read.
Still, static database roles leave big gaps during live agent work. First, you still have to store a plain database password on the user machine. Anyone or any script on that laptop can read the local config file. Second, a select grant applies to the whole table or chosen columns. If a table holds emails, phone numbers, card numbers, or national IDs, the query returns them. Data masking is needed to rewrite matched fields in results before the agent processes them. Third, a read role cannot stop an agent from running a massive join that locks CPU. Role rules check table access at login, not what individual statements do in flight. Teams also lack a clear log that ties each query to a specific person.
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
Can I use the default postgres password for Goose?
No, you should not use the default postgres password for an outside tool. That password belongs to the admin role, so you should create a separate read user instead.
Does a read only Postgres role hide sensitive customer columns?
A standard table select grant returns all columns in the matched rows by default.Unless you set up column grants or masking, results will include emails and phone numbers.
How do queries run in the Supabase dashboard differ from agent queries?
Queries run inside the project dashboard execute as the default postgres admin role. They also include a comment tag showing that the dashboard was the source.
Related guides
In this post