How to Add SQL Server to Folder Permissions
To understand how to add sql server to folder permissions, grant the database service account read or write rights on the host folder. The operating system checks this service identity whenever the database engine reads or writes local files. Database teams often need the engine to read backup files or write export logs. The database engine runs as a background service on the host machine. When an engineer runs a backup command, the engine asks the operating system to open the target directory.
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 understand how to add sql server to folder permissions, grant the database service account read or write rights on the host folder. The operating system checks this service identity whenever the database engine reads or writes local files.
Database teams often need the engine to read backup files or write export logs. The database engine runs as a background service on the host machine. When an engineer runs a backup command, the engine asks the operating system to open the target directory. If the service account lacks folder rights, the file operation fails right away.
How to add sql server to folder permissions in practice
First, find the exact service account that runs the database engine on your server. Next, open the folder properties in the host operating system. Add that specific service account to the access control list for the directory. Grant read permissions if the database only needs to import files or restore backups. Grant write and modify permissions if the engine must save new backup files there.
Keep folder permissions separate from internal database roles. Inside the database, a login connects to the server instance through the master database. A database user then maps that login to a specific database. Microsoft supports thirteen types of database users for different access needs. Teams can also use a contained database user with a password for one database. An admin must enable contained databases on the server and database first.
Engineers and AI agents still need internal database rights to trigger file operations. Fixed database roles control what a user can do inside the database itself. Members of the data reader role can read all data from user tables and views. Members of the data writer role can add, delete, or change table data. Members of the owner role can run all maintenance tasks and even drop the database.
Kubernetes API Server Access + AI Agent Permissions: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Security tradeoffs of folder access and static roles
Granting broad folder permissions creates real security risks on the host machine. If an attacker compromises a high-privilege database account, they can reach those allowed folders. You cannot change the permissions assigned to fixed database roles inside the engine. An owner role holder has full control over database maintenance and file output tasks. Static logins and long-lived passwords make this risk much worse for operations teams.
Shared credentials also hide which human or AI agent ran a file export query. Internal deny roles can block a user from reading or changing table data. Yet deny roles do not stop an admin account from misusing host folder paths. Even with strict folder rules, active database sessions can still expose sensitive table data. Unmasked queries return raw emails, phone numbers, card numbers, and national IDs in results. Data masking rewrites matched fields in query results to protect private records during sessions.
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, inline in the TDS wire protocol. On every batch an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.
Before a batch hits the server, hoop.dev guardrails refuse disallowed actions with a native TDS error or hold risky statements for approval. On the way back, hoop.dev data masking rewrites sensitive values in supported result columns in memory, and every decision is logged. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Why does the database fail to open a backup file after I grant user access?
The database engine uses its own background service account to touch host folders. You must grant folder permissions to that service account, not just your personal login.
Can I customize fixed database roles to limit file tasks?
No, you cannot change the permissions assigned to fixed database roles in the engine. Instead, assign users to lower roles like the data reader role for basic queries.
When should I use a contained database user instead of a server login?
Use a contained database user when someone needs access to only one or two databases. For access to many databases on an instance, use a login in master.
Related guides
In this post