How to Configure Devin SQL Server Sandbox

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up a devin sql server sandbox, create a scoped database user. Then assign fixed read or write roles to limit what the agent touches. Engineering teams often give AI agents a shared admin login to save time. That broad role lets an autonomous agent alter schemas or drop the whole database. A safe setup scopes the agent to one test database with strict role limits. How to set up a devin sql server sandbox First, decide how the AI agent will log in to your database server. In SQL Server,

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 a devin sql server sandbox, create a scoped database user. Then assign fixed read or write roles to limit what the agent touches. Engineering teams often give AI agents a shared admin login to save time. That broad role lets an autonomous agent alter schemas or drop the whole database. A safe setup scopes the agent to one test database with strict role limits.

How to set up a devin sql server sandbox

First, decide how the AI agent will log in to your database server. In SQL Server, a database user is the identity of a login. When a team needs many databases on one instance, they use a master login. For one or a few databases, a contained database user is a good option. A contained user has a password and does not tie to a master login. An admin must enable contained databases on the server and the database first. SQL Server supports thirteen types of database users for different needs.

Next, map that user to the right fixed database role for the task. Every database role, including the public role, has basic permission to connect. If the agent only checks schemas or debugs queries, use the data reader role. Members of that role can read all data from all user tables and views. If the agent must seed test rows, add the data writer role. That role lets the user add, delete, or change data in all user tables. Never give an autonomous agent the database owner role in your test space. That owner role can run all maintenance tasks and even drop the database. Admins cannot change the permissions built into these fixed database roles.

Why native roles are not enough for AI agents

Native database roles decide who logs in and which tables they can read. They do not inspect what individual queries do while the session is active. A user in the data reader role can still read every user table. If your test database holds real customer records, the agent reads all of them. Emails, phone numbers, card numbers, and national IDs flow right into the agent context.

Fixed roles also work as an all-or-nothing switch across the whole database. You can apply a deny role to block reads or writes across all tables. If you add the deny data writer role, the agent cannot change any data. If you add the deny data reader role, it cannot read any user tables. It cannot even read metadata about those tables and views. Yet you often want the agent to run most writes while stopping table drops. Native roles cannot pause a single risky statement and ask a human to approve.

Kubernetes API Server Access + AI Sandbox Environments: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

How to manage test data and credentials

Teams also face a hard choice when they load data into a test database. Empty tables make it hard for an AI agent to reproduce real bugs. Copying production data brings sensitive customer fields into the agent workspace. Even with a contained user, you still hand a raw password to the agent. If that password leaks in a task log, anyone can use it. A complete setup pairs native database roles with query checks and field masking. Masking rewrites matched fields like emails and card numbers in query results.

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 master login or a contained user for the agent?

Use a contained database user if the agent only needs one test database. It keeps the user inside that database and avoids a login in master. Remember that an admin must enable contained databases on the server and database first.

Can I customize the built-in data reader role in SQL Server?

No, SQL Server does not let you change permissions on fixed database roles. The data reader role always grants read access to all user tables and views.

How do I stop the agent from changing data in the sandbox?

Assign the user to the data reader role and leave out the writer role. You can also add the deny data writer role to block all data changes.

The query runs. The emails stay hidden.