Goose AI SQL Server Permissions
Setting up goose ai sql server permissions starts with creating a dedicated database user. You then assign read-only roles so the agent cannot change or delete data. AI agents like Goose run queries on your behalf to inspect schemas and fix bugs. Without strict rules, an agent can change production rows or read private customer records. Database teams must scope these accounts before letting any agent connect to a live database. How goose ai sql server permissions work in practice In SQL Ser
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.
Setting up goose ai sql server permissions starts with creating a dedicated database user. You then assign read-only roles so the agent cannot change or delete data.
AI agents like Goose run queries on your behalf to inspect schemas and fix bugs. Without strict rules, an agent can change production rows or read private customer records. Database teams must scope these accounts before letting any agent connect to a live database.
How goose ai sql server permissions work in practice
In SQL Server, a database user is the identity of a login when it connects. There are thirteen types of database users available in the system. For access to many databases on an instance, a login in master is common. For access to one or a few databases, a contained database user works well. This user has a password and is not tied to a login in master. An admin must first enable contained databases on the server and on the database.
Once the user exists, you assign fixed database roles to control what Goose can do. All roles, including the public role, have basic connect rights. The permissions assigned to fixed database roles cannot be changed by admins. To keep the agent safe, teams assign the data reader role. Members of this role can read all data from all user tables and views. You can also add the deny data writer role to the agent account. That role makes sure the user cannot add, modify, or delete any data.
You should never give an AI agent the database owner role. Members of the owner role can do all setup and maintenance tasks. They can even drop the entire database in SQL Server. If an agent needs to write data in a test database, use the data writer role. Members of that role can add, delete, or change data in all user tables.
Security tradeoffs of static roles and credentials
Native database roles are a good first step, but they leave big security gaps. First, the data reader role lets Goose read all user tables and views. If a table holds emails, phone numbers, card numbers, or national IDs, the agent gets them. A fixed role cannot hide specific columns or mask sensitive values inside a query result. Even a deny data reader role blocks all user tables and views, which is too broad.
AI Agent Permissions + Kubernetes API Server Access: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Second, static passwords create a high risk for engineering teams. Developers often store database keys in local files so Goose can read them. If a key leaks, anyone can log in with the same access as the agent. When ten engineers share one login for their agents, audit logs lose their value. You see the shared login name in the server log, not the person who ran Goose.
Third, database roles apply at the account level, not per query. An engineer might need Goose to run one safe update during an incident. Giving the agent permanent write rights means it keeps that power for every future prompt. Teams need a way to check queries in real time and mask sensitive fields in results. Dynamic data masking rewrites matched fields like emails or card numbers before the agent reads them. Per-command approvals also let humans check risky writes before the database runs them.
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
What is the safest SQL Server role for Goose AI?
Combine the fixed data reader role with the deny data writer role. This setup lets Goose read user tables and views while blocking all data changes.
Should I use a standard login or a contained database user for Goose?
Use a contained database user if Goose only needs one or a few databases. Use a login in master if the agent must query many databases on one instance.
Can SQL Server fixed roles stop Goose from reading customer emails or card numbers?
No, fixed database roles cannot filter out sensitive fields inside a table. You need dynamic data masking to rewrite emails, phone numbers, or card numbers in results.
Related guides
In this post