How to Configure Devin SQL Server Credentials
To set up devin sql server credentials, create a dedicated database user with scoped read permissions. Then store those login details in the workspace secrets for the AI agent. Many teams start by handing an agent a shared admin account to save time. That broad role lets an automated tool change tables or read sensitive rows across the whole server. How devin sql server credentials work in the database SQL Server separates server logins from individual database users. A database user is the i
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 devin sql server credentials, create a dedicated database user with scoped read permissions. Then store those login details in the workspace secrets for the AI agent. Many teams start by handing an agent a shared admin account to save time. That broad role lets an automated tool change tables or read sensitive rows across the whole server.
How devin sql server credentials work in the database
SQL Server separates server logins from individual database users. A database user is the identity of a login when it connects to a database. SQL Server supports thirteen distinct types of database users for different setups. When an agent needs many databases on one instance, admins create a login in master.
Then they map a SQL user to that login inside each target database. If the agent only needs one database, a contained database user is a good option. A contained user has a password and does not tie to a login in master. An admin must enable contained databases on the server and the database first.
Once the user exists, you assign a role to limit what the agent can do. Every role, including the public role, includes basic connect rights. You cannot change the permissions built into fixed database roles. Adding the agent to the fixed reader role lets it read all user tables and views.
If the agent needs to edit records, the fixed writer role lets it add, delete, or change data. You can also combine roles with explicit deny roles. A deny writer role stops the user from adding, changing, or deleting any table data. A deny reader role blocks the user from reading data or metadata from user tables and views. Avoid the database owner role, because it allows full maintenance and can drop the database.
Why static roles leave runtime gaps for AI agents
Native roles control who can log in and which broad actions they can run. They do not inspect individual queries while the AI agent runs a task. An agent with the fixed reader role can still read every user table and view. That includes tables holding customer emails, phone numbers, card numbers, and national IDs.
When the agent runs a query, those raw values flow straight into the agent context. Similarly, a writer role allows changes to every user table in the database. Native roles cannot pause a risky update to ask a human for approval first. They also do not rewrite sensitive columns in query results before the agent reads them.
Ephemeral Credentials + Kubernetes API Server Access: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Storing a static password in an agent workspace also creates rotation work for your team. If you share one login across many agent tasks, your database logs show one user name. You cannot tell which specific developer prompt triggered a heavy query or a broken update.
Scoping agent database sessions for daily work
Start by separating read tasks from write tasks when you set up the agent. Give the agent a reader role with a deny writer role for bug investigation tasks. Create separate schemas or views if you want to restrict which tables the agent sees.
Keep the agent out of the database owner role at all times. Even in a test database, dropping a database breaks work for the rest of the team. Rotate the password on a regular schedule and remove unused accounts right away. For production data, pair native roles with runtime controls that inspect queries and mask sensitive fields.
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
Should I use a login in master or a contained user for Devin?
Use a contained user if the AI agent only needs one or a few databases. Use a login in master if the agent must query many databases on the same server instance.
Can I customize the built-in reader role to hide one table from an agent?
No, SQL Server does not let you change the permissions inside fixed database roles. Members of the fixed reader role can read all data from all user tables and views.
Why is the database owner role risky for an AI coding agent?
Members of the database owner role can run all maintenance tasks and can drop the entire database. An automated agent could delete the database if it misinterprets a cleanup prompt.
Related guides
In this post