How to Configure Devin SQL Server Read Only Access
You set up devin sql server read only access by creating a dedicated database user. Then you add that user to the fixed reader role and block write roles. Many teams start by giving an AI agent a broad admin account to move fast. That shortcut lets an automated agent change rows or drop tables by mistake. A strict read role keeps the agent from changing data while it checks your tables. How devin sql server read only access works SQL Server splits login accounts from database users to control
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 devin sql server read only access by creating a dedicated database user. Then you add that user to the fixed reader role and block write roles. Many teams start by giving an AI agent a broad admin account to move fast. That shortcut lets an automated agent change rows or drop tables by mistake. A strict read role keeps the agent from changing data while it checks your tables.
How devin sql server read only access works
SQL Server splits login accounts from database users to control who gets in. A database user is the identity of a login when it opens a database. SQL Server supports 13 types of database users for different needs. If the agent needs many databases on one instance, use a login in master. Then map a SQL user to that login inside each target database. If the agent needs one or a few databases, use a contained user instead. A contained database user has a password and no login in master. An admin must first turn on contained databases on the server and database.
After you create the user, you assign roles to set its read rules. All database roles, including the public role, have permission to connect. You can add the user to the fixed database reader role. Members of this reader role can read all data from all user tables and views. You can also add the user to the fixed deny writer role. That role makes sure the user cannot add, change, or delete any table data. Keep the agent out of the fixed writer role and the owner role. The owner role can run all maintenance tasks and even drop the database.
What native roles solve and what they leave open
Fixed database roles give teams a fast way to stop unwanted writes. You cannot change the permissions assigned to fixed database roles in SQL Server. This rule keeps another admin from adding write rights to the reader role later. If a table holds secrets, the fixed deny reader role blocks all reads on it. Yet the standard reader role still lets the agent read every user table and view.
Native roles decide who logs in and which tables they can read or change. They do not inspect what individual queries do while the session runs. An agent with reader rights can still pull emails, phone numbers, or card numbers. Those raw values then flow straight into the agent workspace and model prompts. You also have to hand a static password to the agent workspace. If someone copies that password, they get the same database access from anywhere.
Auditor Read-Only Access + Kubernetes API Server Access: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Why query level controls matter for AI agents
AI coding agents run many queries fast when they debug an app issue. A broad reader role cannot rewrite sensitive fields like national IDs in query results. It also cannot ask a human to approve a query on a billing table. Teams need a way to keep database keys out of the agent workspace. They also need a full log of every query the agent sends.
Add runtime guardrails beside SQL Server
Role grants and network rules are needed setup for SQL Server. Still, an allowed user or agent tool can send a bad delete or read raw customer fields over a valid session. In practice, hoop.dev runs beside the database as a sidecar for your SQL Server and checks TDS traffic without changing how clients log in.
With hoop.dev SQL Server controls, rules refuse banned statements before they run and can hold risky queries for human review. Matched sensitive values in supported result columns are masked before they reach the client. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for HIPAA, PCI DSS, SOX, and GDPR audits. See the source on GitHub.
Frequently asked questions
Should I use a login in master or a contained user for Devin?
Use a login in master if the agent reads many databases on one instance. Use a contained user with a password for one or a few databases. Remember that an admin must enable contained databases on the server and database first.
Does the fixed reader role block sensitive columns like emails or card numbers?
No, members of the fixed reader role can read all user tables and views. It does not hide emails, phone numbers, card numbers, or national IDs in results. You need data masking or custom permissions to keep those fields out of results.
How do I make sure the agent user can never write data?
Do not add the user to the fixed writer role or the owner role. You can also add the user to the fixed deny writer role. Members of that role cannot add, change, or delete data in user tables.
Related guides
In this post