How to Configure Goose Supabase Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up goose supabase permissions by creating a dedicated database user with restricted table grants. You then give that specific role to your migration tool or AI agent instead of the default admin login. Many teams take a shortcut and reuse the default project password created at setup. When roles are too broad, a single bad migration or agent command can drop production tables or read private records. How native goose supabase permissions work Every Supabase project starts with a defau

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 goose supabase permissions by creating a dedicated database user with restricted table grants. You then give that specific role to your migration tool or AI agent instead of the default admin login. Many teams take a shortcut and reuse the default project password created at setup. When roles are too broad, a single bad migration or agent command can drop production tables or read private records.

How native goose supabase permissions work

Every Supabase project starts with a default postgres role. This role has admin privileges across your database. Supabase does not grant full superuser status because that allows destructive system acts. Instead, it gives the postgres role extra rights to manage the database. The password you pick when you create a project belongs to this default admin role.

Supabase docs states you should not hand this main password to external tools. Instead, you should make a fresh database user for each tool or service. Whether you use Goose as a database migration runner or an autonomous coding agent, the same rule applies. You log in through the dashboard and create a dedicated role for the tool.

Queries you run in the web dashboard execute as the postgres admin role. From there, you grant your new Goose role only the schema and table rights it needs. For a migration tool, that means rights to alter tables in a specific schema. For an AI agent, that often means read access to a few safe tables. The project also includes built-in roles like anon for public requests, plus authenticated and service roles for app traffic. You should keep your tool role separate from these built-in app roles.

What native roles solve and what they miss

Setting up a dedicated database user solves the basic problem of shared admin keys. If you need to cut off the tool, you can revoke its user without breaking other apps. You also stop the tool from touching schemas outside its assigned scope. This is a strong first step for database safety.

AI Agent Permissions + 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 who logs in at the start of a session. Once Goose connects with valid credentials, the database trusts every valid statement within that role's grant. Native roles cannot tell the difference between a safe schema update and an accidental table drop. If a migration script has a bug, the role has full permission to run it. If an AI agent gets a bad prompt, it can pull every row from the tables it can read.

Static grants also leave raw sensitive data exposed in query results. If a role can read a user table for debugging, it reads real emails, phone numbers, card numbers, and national IDs. Database roles are also persistent until someone remembers to delete or alter them. Teams end up managing long-lived passwords stored in local files or build servers. Native permissions set the outer boundary, but they do not inspect or filter individual commands in flight.

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 the default Supabase postgres password to Goose?

No, the default postgres role has admin rights across the project. Supabase recommends creating a separate database user for every external tool or service you run.

Does the Supabase postgres role have full Postgres superuser rights?

No, Supabase withholds superuser status to prevent destructive system commands. Instead, the default postgres role gets admin rights and select extra privileges needed for daily work.

Why are database role grants not enough for AI agents and migration tools?

Database roles only control login identity and broad table rights. They do not review individual SQL statements in flight or rewrite sensitive fields like emails and card numbers in results.

The query runs. The emails stay hidden.