How to Configure Continue SQL Server Prevent Delete

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up a continue sql server prevent delete workflow, restrict the database user role. You must grant read or insert rights while blocking delete actions on user tables. Many engineering teams wire their AI coding assistants straight into local or staging databases. They often use shared accounts that carry broad read and write powers. When an assistant runs a bad query under a wide role, it can wipe tables. A single misunderstood prompt can remove vital test records or break a shared staging

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 continue sql server prevent delete workflow, restrict the database user role. You must grant read or insert rights while blocking delete actions on user tables. Many engineering teams wire their AI coding assistants straight into local or staging databases. They often use shared accounts that carry broad read and write powers. When an assistant runs a bad query under a wide role, it can wipe tables. A single misunderstood prompt can remove vital test records or break a shared staging setup.

How to set up continue sql server prevent delete roles

SQL Server manages data access through server logins and database users. A database user serves as the identity of a login inside one specific database. When someone needs access to many databases on an instance, teams create a login first. That login lives in the master database and maps to users in other databases. For one or a few databases, teams can use a contained database user instead. This user has a password and is not tied to a login in master. An admin must first turn on contained databases on the server and the database. SQL Server supports thirteen distinct types of database users for different access needs.

Once the user exists, admins often assign fixed database roles to control actions. The permissions tied to these fixed database roles cannot be changed by admins. For example, the data reader role lets a user read all user tables and views. The data writer role lets a user add, change, or delete data in all tables. A deny data writer role blocks a user from adding, changing, or deleting any data. Meanwhile, the database owner role can run all maintenance tasks and even drop the database.

Fixed roles group add, change, and delete rights together inside the data writer role. Because you cannot change fixed role permissions, you must use custom roles to block deletes. An admin creates a custom database role and adds the assistant database user to it. Next, the admin grants read, insert, and update rights on target schemas or tables. Finally, the admin applies an explicit deny rule for delete actions on those tables. In SQL Server, an explicit deny rule overrides any grant rules from other roles. When Continue sends a delete query, the database engine checks the role and rejects it.

What native roles solve and what they leave open

Native SQL Server roles decide who can log in and which broad actions they hold. Putting an explicit deny on delete stops the assistant from removing rows in those tables. It also keeps the setup simple because the rules live inside the database engine. Admins do not need to change how the coding assistant connects to the database.

SQL Injection Prevention + Kubernetes API Server Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Still, static database roles only check permissions at the table or schema level. They do not inspect what individual queries do in flight before they hit the engine. If the assistant needs update rights to test features, it can still ruin your data. An update statement without a filter can overwrite every row with blank values. To the database engine, that bad update looks like a valid write action. Also, static credentials sit in local text files on developer machines so the assistant works. Any tool or script on that machine can read that password and log in.

Native roles also fail to protect sensitive data inside the tables the assistant reads. If a user has the data reader role, they can read all columns in full by default. Queries from Continue will pull back raw emails, phone numbers, card numbers, and national IDs. Database roles cannot rewrite matched fields in results on the fly for AI tools. Finally, database logs tie every query to one shared user name instead of a person.

Add runtime guardrails beside SQL Server

Role grants and network rules are needed setup for SQL Server. Still, an allowed user or agent tool can send a bad delete or read raw customer fields over a valid session. In practice, hoop.dev runs beside the database as a sidecar for your SQL Server and checks TDS traffic without changing how clients log in.

With hoop.dev SQL Server controls, rules refuse banned statements before they run and can hold risky queries for human review. Matched sensitive values in supported result columns are masked before they reach the client. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for HIPAA, PCI DSS, SOX, and GDPR audits. See the source on GitHub.

Frequently asked questions

Can I change the fixed data writer role to block deletes?

No, SQL Server does not let you change permissions on fixed database roles. The data writer role always allows adding, changing, and deleting data across all user tables. You must create a custom role or apply an explicit deny rule on delete actions.

Does the deny data writer role stop only delete statements?

No, the deny data writer role blocks all write actions on user tables. Members of that role cannot add, change, or delete any rows in the database. Use it only when you want the coding assistant to have strict read-only access.

Should I use a login in master or a contained user for Continue?

Use a contained database user if the assistant only needs one or a few databases. This avoids creating a server login in master and keeps access inside the target database. An admin must enable contained databases on the server and database before you start.

The query runs. The emails stay hidden.