How to Configure Supabase Grant Permissions
You set up supabase grant permissions by assigning table privileges to specific Postgres roles. These roles control what each user or service can read, write, or delete. Many teams start by sharing the default admin role across their tools and staff. When you set permissions too wide, one mistake can wipe out production tables. Broad roles also let queries return raw emails, phone numbers, and card numbers. How supabase grant permissions work in practice Every new project comes with a set of
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 supabase grant permissions by assigning table privileges to specific Postgres roles. These roles control what each user or service can read, write, or delete.
Many teams start by sharing the default admin role across their tools and staff. When you set permissions too wide, one mistake can wipe out production tables. Broad roles also let queries return raw emails, phone numbers, and card numbers.
How supabase grant permissions work in practice
Every new project comes with a set of built-in Postgres roles. The default postgres role acts as an admin with extra privileges for database management. The platform withholds full superuser access to block destructive commands on the host.
When you set a database password at project creation, it belongs to this admin role. Queries you run in the web dashboard also execute under this default admin role. The docs warns teams not to share this main password with outside services.
Instead, you should create a fresh database user for every outside service or person. Each new project also includes default roles for anonymous requests and logged-in users. You manage supabase grant permissions by tying table and schema rights to these roles.
First, you create a dedicated role for the person or service that needs access. Next, you grant that role access to the specific schema it must use. Then, you grant select, insert, update, or delete rights on individual tables.
You can also limit grants to specific columns so a role reads only safe fields. If a role only needs to read data, you grant select rights alone. This setup keeps a reporting tool from changing rows by mistake.
When you pair table grants with row rules, you restrict which rows return. Both layers work together inside the database engine to check every query.
AI Agent Permissions + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Why static role grants leave an operational gap
Native database grants solve a big part of the access puzzle. They decide which role can log in and which tables that role can touch. They also separate public app traffic from backend services and human admins.
Still, static grants cannot inspect what a valid role does during an active session. Once an engineer logs in with an admin role, every granted right stays active. If a role has update rights on a table, it can update one row. That same role can also update ten million rows in one bad query.
Static grants also treat every select query on a granted column the same way. If a support engineer needs table access, native grants return the raw values. Results include live emails, phone numbers, and national IDs in plain text. You have to build and maintain extra views if you want to rewrite fields.
Shared database passwords create another headache for growing teams. When you create custom roles for developers, you still have to hand out passwords. Rotating those passwords takes work when someone leaves the team or changes jobs.
Finally, database grants stay on twenty-four hours a day until you revoke them. An engineer who needs write rights for ten minutes often keeps them for months. Without per-query checks, a valid login can still run a risky command in production.
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
Does the default postgres role have full superuser rights?
No, the default postgres role is an admin role rather than a full superuser. The platform blocks superuser access to prevent destructive operations on the database server.
Should I share the main database password with third-party services?
No, you should never give the main postgres password to outside services unless trusted. Create a separate database user with narrow table grants for every external service instead.
Which role runs the queries inside the web dashboard?
Queries you run in the project dashboard execute under the default postgres admin role. Those queries also carry a comment tag showing they came from the dashboard.
Related guides
In this post