How to Configure Goose Supabase Audit Log

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up a goose supabase audit log by making a custom Postgres user for the agent. Next, you turn on database logging to record every query that this user runs. Many teams take a shortcut and give their local coding agent the default admin password. That choice makes it hard to tell agent actions apart from human work. Broad permissions also let an automated tool change tables or read private rows by mistake. How a goose supabase audit log works in Postgres Every project comes 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 a goose supabase audit log by making a custom Postgres user for the agent. Next, you turn on database logging to record every query that this user runs. Many teams take a shortcut and give their local coding agent the default admin password. That choice makes it hard to tell agent actions apart from human work. Broad permissions also let an automated tool change tables or read private rows by mistake.

How a goose supabase audit log works in Postgres

Every project comes with a default postgres role that holds admin rights. Supabase does not give out full superuser rights because those allow destructive database actions. Instead, the platform grants the default postgres role extra privileges for needed admin tasks. The password you pick when you create a project belongs to this default admin role. Queries that you run inside the web dashboard also use this same postgres role. Those dashboard queries include a comment tag showing they came from the dashboard.

Official guidance says you should never share the main postgres password with outside tools. Instead, you should make a fresh database user for each external tool or agent. When you pair the Goose agent with your database, give it a dedicated role. Grant that role only the exact table permissions it needs for its daily job. Once the agent has its own role, the database log records that specific username. Your team can then filter the log entries by role name to review agent work.

What native roles solve and what they leave open

Making a separate database role for your coding agent solves basic identity tracking. You can see when the agent logs in and which tables it can reach. Built-in roles like the anon role and the authenticated role help with app traffic. A custom agent role keeps machine queries separate from your main admin account. This setup stops the agent from running admin commands that it does not need.

Still, static database roles only check who logs in at the start of a session. They do not inspect what individual statements do while they run in flight. If an agent has read rights on a customer table, it can pull every column. Native roles cannot rewrite sensitive fields like emails, phone numbers, card numbers, or national IDs. Also, standard database logs only record the text of the query after it runs. They cannot pause a risky drop command and ask a human to approve it first. Teams also have to rotate and store static database passwords on every developer laptop.

Audit Log Integrity + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Steps to tighten agent permissions before logging

Start by listing the exact schemas and tables your AI agent needs to read. Create a dedicated role for the agent instead of using the default postgres account. Grant select rights only on the safe tables that hold non-sensitive project data. Keep write permissions turned off unless the agent must insert or update specific rows. Review your database log outputs each week to spot strange query patterns from the agent. If a local device gets lost, revoke that single agent role right away.

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

No, you should never give the default postgres password to an external service or agent. Always create a separate database user with limited permissions for each tool you use.

How do I tell dashboard queries apart from Goose queries in the log?

Queries run in the Supabase dashboard execute as the postgres role with a dashboard comment. When Goose uses its own custom role, its log entries show that distinct role name.

Does the default postgres role have full superuser access?

No, Supabase does not grant superuser access because it allows destructive database operations. The postgres role is an admin role with extra privileges for specific allowed tasks.

The query runs. The emails stay hidden.