How to Configure Goose Supabase Connect

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a goose supabase connect workflow by giving the agent a dedicated database user. Then you point the agent tool to your project database URI. Many teams take a shortcut and use the default project password during setup. That choice gives an automated agent broad admin rights across your entire database. If a prompt goes wrong, the agent can drop tables or read private user rows. How a goose supabase connect setup works Every new Supabase project comes with a default postgres role. T

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 a goose supabase connect workflow by giving the agent a dedicated database user. Then you point the agent tool to your project database URI. Many teams take a shortcut and use the default project password during setup. That choice gives an automated agent broad admin rights across your entire database. If a prompt goes wrong, the agent can drop tables or read private user rows.

How a goose supabase connect setup works

Every new Supabase project comes with a default postgres role. This role has admin rights across the database. Supabase does not give out full superuser rights because those allow destructive actions. Even so, the default postgres role still holds extra privileges for major tasks. The password you pick when you create a project belongs to this admin role.

Supabase says you should never share this main password with an outside tool. Instead, you should make a fresh database user for every service you run. Queries that you run inside the project dashboard also run as this default admin role. Those dashboard queries carry a short comment in the logs to mark their source.

When you link Goose to your database, the agent acts like any other client app. It reads your local environment settings to find the database host and user password. Then it opens a session and sends SQL queries based on your natural language prompts. If you create a dedicated role with read rights on three tables, the database enforces that rule. The agent can only query those three tables during its session.

Where native database roles fall short for agents

Creating a separate Postgres role for your agent is a strong first step. It stops the agent from touching schemas or tables outside its assigned scope. Supabase also adds built-in roles like anon for public requests and other roles for signed-in users. These native roles decide who can log in and which tables they can reach.

Still, static database roles only check permissions at the table or column level. They do not inspect what individual statements do while they run in flight. A scoped role with read access to a customer table returns every column allowed by default. If that table holds emails, phone numbers, or card numbers, the query returns them in plain text. The local agent receives those raw values and sends them straight to the language model.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Write access brings another risk when an agent runs SQL on its own. If a role can update rows for a migration task, it can also run a bad update. Static roles cannot pause a risky command to ask a human for approval first. You also have to store a real database password on every developer laptop using the agent. Managing and rotating those local credentials across a growing team takes constant manual work.

Scoping agent permissions before you run queries

Before you start a session, map out the exact tasks the agent needs to do. If the agent only helps developers write queries, give its role read-only rights on safe tables. Keep sensitive tables with national IDs or card numbers out of that role's reach. Never reuse the main project password that you set at project creation.

When an agent needs to change schema definitions, keep those rights separate from daily read tasks. Create a specific role for schema work and turn it off when the task ends. Check your database logs often to see which statements the agent role runs. Native roles handle the basic login boundary, while runtime controls handle statement checks and data masking.

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 use the default postgres role for my Goose agent?

No, the default postgres role has admin rights across your project. Supabase advises creating a new database user for each outside service instead of sharing the main password.

Does Supabase give the default postgres role full superuser rights?

No, Supabase blocks superuser access to prevent destructive database operations. The default postgres role gets admin rights with extra privileges, while commands like altering a user to superuser stay blocked.

Can native Postgres roles mask emails or card numbers in query results?

Standard table privileges only allow or block access to whole tables or columns. To rewrite matched fields like emails or phone numbers in results, you need runtime data masking in front of the database.

The query runs. The emails stay hidden.