How to Configure Devin SQL Server Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up devin sql server permissions by creating a dedicated database user. Then you assign that user to a strict, read-only database role. Many engineering teams start by sharing an existing developer login with their AI agent. This shortcut gives the autonomous tool far too much control over production data. If an agent holds broad owner rights, one bad query can drop tables. Scoping the agent down to the minimum required role prevents accidental data loss. How devin sql server permission

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 permissions by creating a dedicated database user. Then you assign that user to a strict, read-only database role. Many engineering teams start by sharing an existing developer login with their AI agent. This shortcut gives the autonomous tool far too much control over production data. If an agent holds broad owner rights, one bad query can drop tables. Scoping the agent down to the minimum required role prevents accidental data loss.

How devin sql server permissions work at the database level

SQL Server separates server logins from individual database users across an instance. A database user is the identity of a login inside one specific database. Teams that need access to many databases usually create a login in master. Then they map a SQL user to that login in each target database. If the agent only needs one database, a contained database user works well. A contained user has a password and stays inside that single database. An admin must first enable contained databases on the server and database.

Once the user exists, you assign it to fixed database roles. SQL Server provides several built-in roles, and you cannot change their default rights. Every role, including the public role, includes basic permission to connect. The data reader role lets a member read all user tables and views. The data writer role lets a member add, change, or delete table data. You can also combine roles to block specific actions across the database. The deny data writer role stops a user from changing any table rows. The deny data reader role blocks all reads from user tables and views. You should avoid the database owner role for autonomous coding agents. Database owners can change settings, run maintenance, or drop the entire database.

What native roles solve and what they leave open

Native database roles control who logs in and which objects they can touch. Assigning the data reader role with the deny data writer role stops writes. This setup protects your tables from accidental updates or deletes during debugging. Still, fixed database roles apply across every user table and view at once. A member of the data reader role can read every single column.

This creates a major gap when an AI agent queries customer tables. Native roles do not inspect individual queries while they run in flight. Once authenticated, the agent can select emails, phone numbers, and card numbers. The database returns raw values directly to the agent workspace and external model. Native roles also lack a built-in step to pause risky queries for review. If an agent needs a one-time data fix, you must grant write rights. While that role is active, any table in the database can change.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Scoping agent workflows for safer database operations

Before giving an agent database credentials, map out the exact task it runs. Most debugging and schema inspection tasks only need metadata or sample rows. You can create a custom role that grants select rights on safe views. Keep sensitive tables out of that custom role whenever your schema allows it. If you use the fixed data reader role, pair it with deny roles. Always test the agent login manually to verify that write commands fail. Rotate the password for the contained user or login on a regular schedule. Remove the user account as soon as the agent finishes its assigned project.

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 is an open-source proxy that sits next to SQL Server as a sidecar for your SQL Server. It inspects TDS batches and parameterized queries in real time.

With hoop.dev guardrails and hoop.dev data masking, banned statements are refused with your message. Matched sensitive fields in supported result columns are masked in memory, and each decision is logged per listener. Check out the code on GitHub.

Frequently asked questions

Should I use a standard login or a contained user for Devin?

Use a contained database user when the agent only needs one database. It keeps credentials scoped to that single database without touching the master database. Use a login in master only when the agent must query multiple databases.

Does the data reader role hide sensitive customer columns from agents?

No, the fixed data reader role grants read access to all user tables. The agent can read every column, including emails, phone numbers, and national IDs. To hide those fields, you must rewrite matched fields in the query results.

Why should I avoid the database owner role for an AI agent?

Members of the database owner role can run all maintenance and config tasks. They also hold the power to drop the entire database in SQL Server. Giving an autonomous agent owner rights risks severe downtime from one bad command.

The query runs. The emails stay hidden.