How to Configure Aider SQL Server Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up aider sql server permissions by making a dedicated database user with read roles. Then you pair that account with a deny write role to stop table changes. Many engineering teams start by sharing their own admin logins with coding tools. This shortcut lets the tool run any command that the developer can run. When a coding agent has broad owner rights, one bad query can drop tables. A better approach uses the built-in user and role model inside the database engine. How aider sql serve

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 aider sql server permissions by making a dedicated database user with read roles. Then you pair that account with a deny write role to stop table changes. Many engineering teams start by sharing their own admin logins with coding tools. This shortcut lets the tool run any command that the developer can run. When a coding agent has broad owner rights, one bad query can drop tables. A better approach uses the built-in user and role model inside the database engine.

How aider sql server permissions work in the database

The database engine splits access into server logins and database users. A database user is the identity of a login inside one specific database. When a person or tool needs many databases, teams create a login in the master database. That login then maps to a user inside each target database. If the coding tool only needs one database, you can use a contained user instead. A contained database user has its own password and stays inside that single database. It does not tie back to a login in the master database. A server admin must turn on the contained database setting on the server first. The admin must also turn on that setting on the target database itself.

Once you create the user, you control its actions by assigning fixed database roles. The system offers thirteen types of database users and several built-in roles. You cannot change the base rights that belong to a fixed database role. Every role in the database, including the default public role, holds the right to connect. To let your coding tool inspect schemas and rows, you assign the fixed reader role. Members of this reader role can read all data from all user tables and views. If the tool needs to edit rows, teams assign the fixed writer role instead. Members of the writer role can add, delete, or change data in all user tables.

To lock down an account, you can also apply explicit deny roles. The deny writer role stops the user from adding, changing, or deleting any table data. The deny reader role blocks the user from reading data or metadata from user tables. You should never give an automated coding tool the fixed database owner role. That owner role can run all maintenance tasks and can even drop the whole database.

What native roles solve and where gaps remain

Setting up a dedicated user with a reader role solves the biggest safety problem. It stops an agent from dropping tables or deleting rows by mistake. The database checks the role at login and blocks any write statement right away. Separating the agent account from human admin accounts also makes database logs easier to read. You can see which queries came from the coding tool User ID.

Kubernetes API Server Access + AI Agent Permissions: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Still, fixed database roles leave a large operational gap during daily work. Database roles are all-or-nothing across every user table and view in that database. A member of the fixed reader role can read every single table without limits. That includes tables holding customer emails, phone numbers, card numbers, and national IDs. When the coding agent runs a query to check sample data, raw rows return. Fixed roles cannot rewrite matched fields in results to hide those sensitive values.

Native roles also decide who logs in, not what individual statements do in flight. A user with read access can still run a massive join that locks up memory. And if a task requires a temporary write, an admin must change the role manually. Until the admin removes the writer role, the tool can alter any user table. Relying only on static database roles forces a hard choice between safety and speed.

Govern SQL Server queries and responses in flight

Table grants decide which SQL Server objects a caller may touch. They do not check query intent or rewrite sensitive values in results across every client and agent. By design, hoop.dev sits inline in the TDS wire protocol next to SQL Server as a sidecar for your SQL Server. On every production batch from an engineer or AI agent, hoop.dev decides to pass, mask, block, or hold it for approval.

With hoop.dev guardrails and hoop.dev data masking, banned statements are refused or held for review, matched sensitive fields in supported result columns are masked in memory, and each decision is logged. Check out the code on GitHub.

Frequently asked questions

Should I use a standard login or a contained user for a coding agent?

Use a contained database user if the agent only works inside one database. It keeps the password scoped to that single database without touching the master database. Use a standard login only when the tool must query across many databases.

Can I edit the fixed reader role to hide one specific table?

No, the database engine does not let you change the rights of fixed roles. The fixed reader role always grants read access to all user tables and views. To hide specific columns or values, you need controls that work per query.

How do I make sure the agent cannot modify rows by mistake?

Add the database user to both the fixed reader role and the deny writer role. The deny writer role blocks all insert, update, and delete statements across user tables. Also make sure the user is never added to the database owner role.

The query runs. The emails stay hidden.