How to Configure Windsurf Postgres Permissions
You set up windsurf postgres permissions by creating a limited database role for your agent. You then grant that role read privileges on specific tables or columns. Teams often give an AI coding agent a local developer account for speed. This choice lets the agent run any command the developer can run. Overly broad roles allow an assistant to change tables, drop data, or read secrets. How windsurf postgres permissions work in practice Cognition renamed Windsurf to Devin Desktop on June 2, 202
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 postgres permissions by creating a limited database role for your agent. You then grant that role read privileges on specific tables or columns. Teams often give an AI coding agent a local developer account for speed. This choice lets the agent run any command the developer can run. Overly broad roles allow an assistant to change tables, drop data, or read secrets.
How windsurf postgres permissions work in practice
Cognition renamed Windsurf to Devin Desktop on June 2, 2026. The tool keeps the same IDE and features under the new name. Its agent can run terminal commands on its own when a user approves. The agent uses a dedicated terminal that loads the user shell setup. Because of this, your shell aliases and saved variables are open to the agent. The legacy Cascade agent also talks to Model Context Protocol servers.
Whether the agent uses the terminal or a server, it needs a database login. Postgres controls what that login can do through role grants. You can set up group roles to manage privileges across many users. You then add specific user accounts to that group role. For an AI agent, you should build a role with read rights only.
The Postgres select privilege lets a role read data from a table or view. It also works on materialized views and other table-like objects. You can grant select on a whole table or only on specific columns. Column grants help you keep sensitive columns away from the agent role. Note that the select privilege also allows the role to export data using copy.
Locking down default database roles and schemas
Creating a read-only role is only the first step in Postgres. Every database has a special role called public that includes every user. By default, every role gets rights to log in to a database. This public group also gets rights to make temporary tables and run functions. The object owner can revoke these default grants to lock down the database.
You should also check who can create new objects in the public schema. In Postgres 15 and newer, regular users cannot create objects there by default. Older databases, or upgraded ones, may still allow this for everyone. An admin fixes this by revoking create rights on the public schema from public. Doing this stops an AI agent from creating unwanted tables during a task.
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 database roles leave open
Native database roles decide who can log in and which objects they can touch. This setup works well for static apps with fixed query patterns. AI coding agents do not follow fixed patterns when they debug code. An agent writes and runs new queries based on the prompt it gets.
Static database roles cannot inspect what an individual query does in flight. A role with select rights on a table can still pull every row at once by default. If a table holds emails, phone numbers, or card numbers, the query returns them. Native column grants also take time to maintain across hundreds of changing tables. Teams often skip column rules and grant full table reads to move fast.
Also, the agent loads your shell setup when it opens its dedicated terminal. If you store admin keys in your shell profile, the agent can use them. The agent might bypass its restricted role and log in as an admin instead. Database roles alone cannot stop a local tool from reading local secret files.
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
Did Windsurf change its name to Devin Desktop?
Yes, Cognition announced on June 2, 2026 that Windsurf is now Devin Desktop. The IDE and its agent features remain the same under the new name.
Can I grant a Postgres role read rights on just a few columns?
Yes, Postgres lets you grant the select privilege on specific columns of a table. This lets the agent read safe columns without granting select on the whole table.
Why can a new Postgres role run functions I did not grant to it?
Postgres grants function execution rights to the special public role by default. Every new role inherits public grants until the object owner revokes them.
Related guides
In this post