How to Configure Amazon Q Supabase Read Only Access

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up amazon q supabase read only access by making a dedicated Postgres role. You grant this role read rights on chosen tables before linking your AI coding tool. Many teams start by pasting their default admin database password into local config files. That default postgres role holds full admin rights across the entire project. If the coding agent makes a mistake, it can drop tables or change live data. Giving an AI assistant broad admin rights turns a small prompt bug into an outage. H

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 amazon q supabase read only access by making a dedicated Postgres role. You grant this role read rights on chosen tables before linking your AI coding tool. Many teams start by pasting their default admin database password into local config files. That default postgres role holds full admin rights across the entire project. If the coding agent makes a mistake, it can drop tables or change live data. Giving an AI assistant broad admin rights turns a small prompt bug into an outage.

How amazon q supabase read only access works in Postgres

Every Supabase project comes with a default postgres role that holds admin rights. Supabase does not give out full superuser rights because those allow destructive system actions. Even so, Supabase warns that you should never share the default postgres password with outside tools. Instead, you should make a fresh database user for every outside service or agent.

To build a safe setup, an admin logs into the database and makes a new role. The admin grants usage on the target schema and select rights on specific tables. You also set default privileges so future tables get the same read rules. Next, you give those role credentials to your local Amazon Q Developer setup. The AI agent uses your local shell or tool integration to reach the database. When the agent runs a query, Postgres checks the role rules before returning any rows. If the agent tries to run an update, delete, or drop statement, Postgres blocks it.

What native read roles solve and what they leave open

Native database roles do a great job of stopping accidental writes and schema changes. When you give the agent a select-only user, it cannot alter rows or delete tables. This step removes the biggest risk of letting an AI tool touch a live database. It also keeps you from sharing the main project password across developer laptops.

Still, a read-only database role only decides who can log in and which tables they read. It does not inspect what individual queries do while they run in flight. A read-only user can still pull every row from a customer table in one query by default. If that table holds emails, phone numbers, card numbers, or national IDs, the raw data enters the agent prompt. Once those fields reach the AI model context, they leave your database boundary. A static role also cannot stop a bad join that locks up database memory. Also, shared role credentials sit in local plain text files on user machines. Teams also lack a clear log tying each AI query back to an individual person.

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.

Managing schema growth and table permissions over time

Keeping a read-only role safe takes ongoing work as your app grows. Developers add new tables and columns to the project every week. If you grant select rights across an entire schema, the AI agent reads every new table by default. That broad grant often exposes new sensitive columns before anyone reviews them.

If you grant rights table by table, someone must update the role after every migration. Teams often get tired of fixing broken permissions and revert to wide schema grants. You also have to rotate the database password whenever a developer leaves the team. Every password change forces the whole team to update their local AI tool configs. Native roles give you a solid base, but they need manual upkeep to stay tight.

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 Supabase postgres role for Amazon Q?

No, the default postgres role has admin rights across your project. Supabase advises creating a separate user for each outside service or tool instead.

Does a read-only Postgres role hide sensitive customer columns?

No, table-level select grants return all columns in that table by default. Without column grants or data masking, queries still return emails, phone numbers, and card numbers.

Can a read-only role stop heavy queries from slowing the database?

A basic select role cannot stop a large scan by itself. You must set statement timeouts on the role to kill slow queries.

The query runs. The emails stay hidden.