How to Configure Windsurf SQL Server Prevent Delete
To set up a windsurf sql server prevent delete workflow, restrict the database user role. You can assign a read-only role or block write permissions in the database. Teams often connect AI coding agents to databases using personal developer accounts. On June 2, 2026, Cognition renamed Windsurf to Devin Desktop while keeping the same features. Its agent can run terminal commands on its own with user permission. The agent uses a dedicated terminal that loads the user shell settings. This means she
SQL Injection Prevention + Kubernetes API Server Access: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
To set up a windsurf sql server prevent delete workflow, restrict the database user role. You can assign a read-only role or block write permissions in the database. Teams often connect AI coding agents to databases using personal developer accounts. On June 2, 2026, Cognition renamed Windsurf to Devin Desktop while keeping the same features. Its agent can run terminal commands on its own with user permission. The agent uses a dedicated terminal that loads the user shell settings. This means shell aliases and local variables are available to the agent. The legacy Cascade agent also reaches external tools through configured MCP servers. If the local database account has broad permissions, the agent inherits those powers. A single bad query from the agent can wipe out production table rows.
How windsurf sql server prevent delete works with native roles
SQL Server manages permissions through server logins and database users. A database user is the identity of a login inside a specific database. When someone needs many databases on an instance, teams create a login in master. For one or a few databases, a contained database user is another option. That contained user has a password and does not tie to a master login. An admin must enable contained databases on the server and database first. Across the platform, SQL Server supports thirteen types of database users.
Once you create the user for the agent, you assign fixed database roles. You cannot change the base permissions assigned to these fixed database roles. Every role, including the public role, has basic permission to reach the database. Members of the data reader role can read all data from user tables. They can also read from all user views. By contrast, the data writer role can add, change, or delete table data. The database owner role can run all maintenance tasks and drop the database. To block deletes while allowing inserts, fixed roles are too broad. If you assign the deny data writer role, you block all writes. That user cannot add, modify, or delete any data at all. To stop only deletes, admins must grant custom table permissions instead of fixed roles.
How to separate agent identities from developer accounts
Many developers store database passwords in their shell config files. Because the Devin Desktop terminal loads shell settings, the agent reads those stored secrets. If a developer logs in as a database owner, the agent does too. The safest native approach is to create a separate login for the agent. You give that agent account the data reader role for safe fixing. You can also add the deny data writer role to block every write action. The developer keeps their own account for manual migration work. This split stops the agent from running destructive commands through MCP servers or terminals.
What native roles solve and what they leave open
Native SQL Server roles decide who can log in and which tables they touch. Putting an agent in the data reader role blocks all delete statements. Still, static database roles apply the exact same rules to every query. Sometimes an engineer wants the agent to insert test rows or update one record. If you grant write rights for that task, you reopen the risk of mass deletes. Native roles also cannot inspect the content of a query while it runs. A read-only agent can still pull sensitive emails, phone numbers, or card numbers. Static database roles do not rewrite matched fields in query results. They also do not require live human approval for risky statements in flight.
SQL Injection Prevention + Kubernetes API Server Access: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
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
Can fixed SQL Server roles block only delete statements?
No, fixed roles do not separate deletes from inserts or updates. The data writer role allows all three, and the deny role blocks all three. You must set custom table or schema permissions to deny only delete actions.
How does the Windsurf agent reach a SQL Server database?
Windsurf, now called Devin Desktop, runs terminal commands with user permission. Its terminal loads your shell settings, including database variables and aliases. The legacy Cascade agent can also query databases through configured MCP servers.
Why is the database owner role risky for AI coding agents?
Members of the database owner role can run any config or maintenance task. They can delete all rows from any table and even drop the entire database. An AI agent with this role can cause severe data loss from one prompt.
Related guides
In this post