How to Configure JetBrains AI SQL Server Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up jetbrains ai sql server approval, create a restricted database user. Then force the IDE to ask before running any generated SQL statements. Many teams link their code editor straight to a database using admin keys. An AI assistant then inherits every right that the human developer holds. When roles are too broad, a bad prompt can alter or drop live tables. How jetbrains ai sql server approval works with native roles SQL Server splits access into server logins and database users. A d

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.

To set up jetbrains ai sql server approval, create a restricted database user. Then force the IDE to ask before running any generated SQL statements. Many teams link their code editor straight to a database using admin keys. An AI assistant then inherits every right that the human developer holds. When roles are too broad, a bad prompt can alter or drop live tables.

How jetbrains ai sql server approval works with native roles

SQL Server splits access into server logins and database users. A database user is the identity of a login inside one specific database. If a person needs many databases on an instance, teams create a login in master. If they need just one or a few databases, teams can use a contained user. An admin must enable contained databases on the server and database first. Microsoft supports thirteen types of database users for different access needs.

After creating the user, you assign fixed database roles to limit what the IDE can do. You cannot change the built-in permissions of these fixed database roles. Every role, including the public role, comes with basic connect rights. Members of the data reader role can read all data from all user tables and views. The data writer role lets a user add, delete, or change data in all user tables. To block writes from AI tools, admins can assign the deny data writer role. This role stops the user from adding, changing, or deleting any table data. You should avoid the database owner role for daily coding tasks. That owner role allows all maintenance tasks and can even drop the whole database.

Why native roles fall short for IDE query review

Native database roles decide who can log in to the server. They also set broad rules on which tables a user can read or change. Still, native roles do not check individual SQL statements in flight. Once a developer logs in with write rights, the database trusts every command from that session.

Inside the IDE, an AI assistant drafts queries based on database schemas and user prompts. The editor might show a local pop-up box asking the developer to confirm the run. That local check only involves the person sitting at the keyboard. It does not ask a team lead or security reviewer to approve risky changes. If a developer clicks run too fast, a bad update statement goes straight to the server.

Approval Chains & Escalation + Kubernetes API Server Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

The gap between static database roles and query safety

Static roles also struggle with sensitive fields during read tasks. A user in the data reader role can read every column in every user table by default. If an AI tool runs a select query to fix a bug, the results may hold private data. Native role checks do not rewrite emails, phone numbers, card numbers, or national IDs in query results. Teams need a way to pause risky queries for peer review and mask sensitive fields in flight.

Check SQL Server batches and results on the wire

SQL Server logins and roles decide who connects. They do not check what each TDS batch does or mask sensitive values in returned rows. With hoop.dev, you run an open-source proxy, a sidecar for your SQL Server. It reads plain batches and parameterized queries on the TDS wire while passing Windows login through untouched.

Before a batch hits the server, hoop.dev guardrails check the statement against your rules. Disallowed actions get a native TDS error with your message. On the way back, hoop.dev data masking rewrites sensitive values in supported result columns that match your rules. Every query and decision is logged. Explore the MIT-licensed project on GitHub.

Frequently asked questions

Can fixed database roles require peer review for specific queries?

No, fixed database roles in SQL Server only grant or deny broad actions like reading or writing. They cannot pause a single query to wait for a second person to approve it.

What happens if an IDE connects with the database owner role?

A user in the database owner role can run all setup and maintenance tasks. If an AI tool suggests a bad command, that session has the power to drop the database.

How can teams block an IDE session from changing table data?

Admins can place the database user into the deny data writer fixed role. This role stops the user from adding, changing, or deleting data across all user tables.

The query runs. The emails stay hidden.