How to Configure Windsurf Supabase Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up windsurf supabase permissions by creating a custom Postgres role with limited rights. Then you give that role's credentials to the agent instead of the admin password. Many teams skip this step during initial setup. They paste the default admin password into local shell variables or agent settings. When an AI coding agent uses broad roles, a bad query can drop tables. It can also pull sensitive rows into the model prompt. How windsurf supabase permissions work in the IDE Cognition

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 windsurf supabase permissions by creating a custom Postgres role with limited rights. Then you give that role's credentials to the agent instead of the admin password. Many teams skip this step during initial setup. They paste the default admin password into local shell variables or agent settings. When an AI coding agent uses broad roles, a bad query can drop tables. It can also pull sensitive rows into the model prompt.

How windsurf supabase permissions work in the IDE

Cognition renamed Windsurf to Devin Desktop in June 2026. The IDE keeps the same features and the Cascade agent. This agent can run terminal commands on its own after the user approves them. It runs those commands inside a dedicated shell on your machine. On macOS it uses zsh, and on Linux it uses bash. Because this shell loads your normal profile, the agent can read your shell variables. It can also use your local command aliases.

The Cascade agent also talks to external databases through Model Context Protocol servers. Whether the agent uses a terminal tool or an MCP server, it needs database credentials. Every Supabase project starts with a default postgres role. This role has admin rights across the database. Supabase does not grant full superuser status to prevent destructive system changes. Still, the default admin role can change schemas, delete data, and read every table. The password you pick at project creation unlocks this admin role. Supabase advises teams not to share this password with external tools. Instead, you should make a new database user for each tool or service.

Creating scoped database roles for coding agents

To lock down agent sessions, start by making a dedicated Postgres role for the IDE. Do not reuse the built-in admin role or the backend service role. Grant the new role permission to connect to the database. Next, grant usage only on the specific schemas the agent needs to inspect. For safe debugging and schema checks, grant select rights on non-sensitive tables only. If the agent must test migrations, run it against a local branch or staging project. Never give schema change rights to an agent connected to production data.

You should also set a statement timeout on the agent role. This stops a slow query from locking up database resources. After you set up the role, store its credentials in your local shell profile. You can also place them in the MCP server settings file. When the agent runs a command or queries the database, Postgres checks the role rules. The database blocks any table access that you did not grant.

AI Agent Permissions + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native roles solve and what they leave open

Native Postgres roles do a great job of controlling which user can log in. They also define which tables and schemas that user can read or change. Setting up a dedicated read-only role stops an agent from dropping production tables. It also keeps the default admin password out of third-party config files.

Still, static database roles leave an operational gap during live sessions. A role decides who logs in, not what individual statements do in flight. First, you still have to put a static password on the developer laptop. Any script or terminal command in the IDE can read that local secret. Second, table-level select rights return every column and row in that table. If a table holds customer emails, phone numbers, or card numbers, queries return them. Native roles do not rewrite matched fields in results before the agent sees them. Third, standard roles cannot pause a risky statement for human approval while allowing safe reads.

Add query and result controls beside Postgres

Grants and pools govern who logs into PostgreSQL. Yet every query in an open session still runs with that role's full scope. In practice, hoop.dev sits inline in the wire protocol beside your database as a sidecar for your Postgres. For every plain or prepared query an agent or human runs against production, hoop.dev decides to pass, mask, block, or escalate it for review.

When a tool or agent sends SQL, hoop.dev Postgres controls block banned statements before execution or hold risky ones for human approval via an AI Analyzer you configure. Matched sensitive columns in result rows are masked in memory before they reach the caller. Each query and decision is logged per listener, which generates evidence for SOC 2, HIPAA, and GDPR audits. View the binary on GitHub.

Frequently asked questions

Should I give the default Supabase postgres password to Windsurf?

No, you should never share the default postgres admin password with external tools. Create a separate database user with narrow table rights for your coding agent instead.

How does the Windsurf agent access local database credentials?

The agent runs approved commands in a shell that loads your user profile. It can read any database variables stored in your shell config or MCP settings.

Can Postgres roles hide sensitive customer columns from AI agents?

Standard table grants allow or block whole tables or columns for a role. They do not mask emails, phone numbers, or card numbers inside returned query results.

The query runs. The emails stay hidden.