How to Configure Cline Supabase Read Only Access

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up cline supabase read only access by creating a dedicated Postgres role with select rights. Then you give that role to your coding agent instead of the default admin login. Many teams start by pasting their main project password into local agent settings. That default postgres role has admin rights across the database. If the agent makes a mistake, a broad role lets it drop tables or alter rows. How cline supabase read only access works with native roles Every Supabase project starts

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 cline supabase read only access by creating a dedicated Postgres role with select rights. Then you give that role to your coding agent instead of the default admin login. Many teams start by pasting their main project password into local agent settings. That default postgres role has admin rights across the database. If the agent makes a mistake, a broad role lets it drop tables or alter rows.

How cline supabase read only access works with native roles

Every Supabase project starts with a default postgres role. This role has admin privileges, though Supabase does not grant full superuser status. The password you pick at project creation belongs to this postgres role. Supabase warns teams not to share this password with outside tools. Instead, you should make a fresh database user for each tool you run.

To lock down an AI coding agent, an admin logs into the database. When you run queries in the Supabase Dashboard, they run as the postgres admin role. From there, you create a new role made just for reading data. You grant usage on your target schemas and grant select rights on the current tables. You also set default privileges so the role can read new tables created later.

Cline runs inside your code editor and can run terminal commands or external tools. When the agent needs database context, it reads the connection string from your local setup. By swapping the admin credentials for your new read role, the database blocks write attempts. If the agent tries to insert, update, or delete a row, Postgres rejects the query.

Why native roles are a strong start

Database roles enforce rules right inside the data engine. Even if an agent bypasses a prompt instruction, it enforces policy on Postgres role checks. A read role stops accidental table drops during a debugging session. It also stops the agent from changing schemas or wiping test records. Separating roles per service also makes key rotation much easier for your team. If a laptop is lost, you can revoke that single agent role right away.

What native read roles leave open in flight

A read role controls who logs in and which tables they can read. It does not inspect what individual queries do while they run. Once a role has select rights on a table, it can read every row and column by default. Customer tables often hold emails, phone numbers, card numbers, and national IDs. A basic read role sends all of those raw fields back to the agent.

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.

The agent then sends those query results to an outside model provider as prompt context. You can set up Postgres column privileges or views to hide specific fields. Still, building and updating custom views for every table takes constant maintenance. Every time a developer adds a column, someone must update the view and role grants.

Static database credentials also create a storage risk on developer laptops. To use a native Postgres role, you must store the password in a local file. Any script or terminal task on that machine can read that same plain text password. Native roles also lack a clear tie to a specific human user. When ten developers share one read role, the database logs show one generic user name. You cannot tell which person or which agent prompt ran a heavy select query. Finally, a read role cannot stop a bad query from scanning millions of rows at once.

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, inline in the Postgres wire protocol. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review. 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 refuse bad deletes or drops with a real Postgres error, or hold risky queries for approval. On the way back, hoop.dev data masking rewrites sensitive values in returned rows in memory, and every 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 Cline the default postgres password from Supabase?

No, the default postgres role has admin privileges across your project. Supabase advises creating a separate database user for every third-party tool you use.

Does a Postgres read role hide sensitive columns from my coding agent?

Table select grants let the role read every column in that table by default. Without extra column rules or masking, results include emails, phone numbers, and card numbers.

How do queries run when I set up roles in the Supabase Dashboard?

Queries run in the Supabase Dashboard execute under the default postgres admin role. They also include a comment tag showing the dashboard was the source.

The query runs. The emails stay hidden.