How to Configure JetBrains AI Postgres Permissions
You set up jetbrains ai postgres permissions by making a read-only database role. Then you link that role to the database tool inside your editor. Many teams start by reusing a broad developer account for quick tests. That shortcut lets an AI helper run updates or drop tables by mistake. A safer setup uses tight database rules from day one. How jetbrains ai postgres permissions work The editor assistant uses the active database session configured in your local workspace. Whatever that databas
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 jetbrains ai postgres permissions by making a read-only database role. Then you link that role to the database tool inside your editor. Many teams start by reusing a broad developer account for quick tests. That shortcut lets an AI helper run updates or drop tables by mistake. A safer setup uses tight database rules from day one.
How jetbrains ai postgres permissions work
The editor assistant uses the active database session configured in your local workspace. Whatever that database user can do, the AI assistant can also suggest and run. So, your main defense is the native role system inside the database itself.
Start by creating a dedicated group role for editor tools and AI assistants. In PostgreSQL, group roles help you manage access when you have many users. You grant rights to the group role and add individual users as members. This keeps your permission setup clean as your engineering team grows.
Next, give that group role read rights on only the tables it needs. The SELECT privilege allows reading from a full table, view, or materialized view. You can also grant SELECT on specific columns instead of the whole table. Column grants help you leave out sensitive columns when you set up access. Keep in mind that the SELECT privilege also permits bulk data export actions.
Reviewing default roles and public schema access
A new role often inherits rights that you did not explicitly grant to it. PostgreSQL has a special role called PUBLIC that includes every user on the system. By default, PUBLIC gets the right to log in to databases and make temporary tables. It also gets the right to run functions and procedures across the database. The object owner can revoke these default grants to lock down the role.
You should also check the rules on your default public schema. In PostgreSQL 15 and newer, regular users cannot create objects there by default. Older databases, or ones upgraded from older versions, might still allow this action. An admin fixes this by revoking the create right on that schema from PUBLIC. Removing these defaults ensures your AI editor role stays strictly read-only.
AI Agent Permissions: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native roles solve and what they miss
Native database roles do a good job of stopping unwanted writes and deletes. They decide who can log in and which tables or columns are visible. This stops an AI assistant from altering your schema or wiping out production data.
Still, static database roles cannot check what individual queries do while they run. Once a role has read access to a table, it can pull every row by default. If a table holds customer emails, phone numbers, card numbers, or national IDs, queries return them. Static grants cannot mask those fields on the fly before results reach the editor. Native roles also require sharing static credentials on each developer machine. They do not give you a central log linking prompts to exact SQL statements.
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
Can I limit the AI assistant to specific columns in a table?
Yes, PostgreSQL lets you grant the SELECT privilege on specific columns of a table. The database will block queries that try to read any other columns.
Why can my new read-only role still run database functions?
PostgreSQL grants function execution rights to the special PUBLIC role by default. Every new role gets those rights until the object owner revokes them from PUBLIC.
Why can my read-only role still create tables in the public schema?
Databases created before PostgreSQL 15 let all users create objects in the public schema. An admin must revoke the create privilege on the public schema from PUBLIC.
Related guides
In this post