SQL Server Proxy Account

Published
Length
3 min read

Luis Felipe Dias

All posts

A sql server proxy account lets a user or task run jobs under another identity. It separates the person who starts an action from the account that runs it. Teams use this setup so regular users do not need high database rights. Instead, the database maps the request to a controlled account with specific permissions. How a sql server proxy account works in practice In SQL Server, a database user is the identity of a login inside a database. When people need access to many databases on an inst

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.

A sql server proxy account lets a user or task run jobs under another identity. It separates the person who starts an action from the account that runs it.

Teams use this setup so regular users do not need high database rights. Instead, the database maps the request to a controlled account with specific permissions.

How a sql server proxy account works in practice

In SQL Server, a database user is the identity of a login inside a database. When people need access to many databases on an instance, teams use a SQL login. This login lives in the master database and links to user accounts across the server.

For one or a few databases, a contained database user is another option. A contained user has a password and does not tie to a master login. An admin must first enable contained databases on the server and on the database. SQL Server supports thirteen types of database users in total.

Whether a human engineer or an AI agent runs a task, permissions come from roles. Admins assign the underlying account to fixed database roles to control what it can do. The permissions assigned to these fixed database roles cannot be changed. Every role, including the public role, holds the basic right to connect.

For read access, admins add the user to the fixed reader role. Members of this role can read all data from all user tables and views. For write access, the fixed writer role lets members add, delete, or change table data. At the top level, the owner role can run all maintenance tasks and drop databases.

Security and operational tradeoffs of static roles

Using a proxy identity or fixed role solves only part of the access problem. Static credentials and fixed roles work on an all-or-nothing basis inside the database. Once a session starts, the user or agent gets every permission tied to that role.

Database Proxy (ProxySQL, PgBouncer) + Cross-Account Access Delegation: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

For example, the fixed reader role grants read rights to every single user table. You cannot alter the permissions of a fixed database role to hide specific columns. Admins can use a deny reader role to block all table reads and metadata views. They can also use a deny writer role to block data changes across tables. Still, managing custom rules across hundreds of tables creates heavy work for the team.

Static accounts also leave active sessions exposed to bad queries and data leaks. If an engineer or AI agent uses a reader account, it reads raw table values. Sensitive fields like emails, phone numbers, card numbers, and national IDs return in plain text. If someone steals the static password, they can pull all data until you rotate keys.

Shared accounts also make auditing hard for security teams. When five engineers share one login, the server logs show only the shared account name. You cannot tell which person ran a slow query or exported a customer table. Modern teams need a way to check every query and mask sensitive fields in flight.

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 difference between a SQL Server login and a database user?

A login lets you enter the server instance through the master database. A database user is the identity that login uses inside one specific database. You can also use a contained database user that logs straight into one database.

Can I change the permissions of a fixed database role in SQL Server?

No, SQL Server does not let you change the permissions of fixed database roles. For example, the fixed reader role always reads all user tables and views. To limit table access, you must grant custom rights or use a deny role.

How do you block a user from reading or writing data in a database?

You can add the user to the fixed deny reader or deny writer roles. The deny reader role stops the account from reading any user tables, views, or metadata. The deny writer role stops the account from adding, changing, or deleting any table data.

The query runs. The emails stay hidden.