How to Configure Windsurf MySQL Prevent Delete

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up a windsurf mysql prevent delete rule, revoke delete grants from your MySQL user. You also need to require human approval before the agent runs terminal commands. Teams often let AI coding tools use local developer accounts to reach databases. When those roles have broad write grants, one bad query can wipe out whole tables. How to set up a windsurf mysql prevent delete workflow Cognition renamed Windsurf to Devin Desktop, though the IDE and features remain the same. Its Cascade agen

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 windsurf mysql prevent delete rule, revoke delete grants from your MySQL user. You also need to require human approval before the agent runs terminal commands. Teams often let AI coding tools use local developer accounts to reach databases. When those roles have broad write grants, one bad query can wipe out whole tables.

How to set up a windsurf mysql prevent delete workflow

Cognition renamed Windsurf to Devin Desktop, though the IDE and features remain the same. Its Cascade agent can run terminal commands on its own if you give permission. The agent uses a dedicated shell that loads your local profile and variables. It can also reach external tools through Model Context Protocol servers.

Because the shell loads your profile, the agent inherits your local database keys. If your local MySQL user has full admin rights, the agent does too. A native setup starts inside the MySQL server itself. You create a specific database user just for the coding agent.

Next, you grant that user permission to read and insert rows on target tables. You leave out permission to drop tables or delete rows. Then you update the local shell or server settings so the agent uses this restricted role. You should also set the IDE to ask for user approval before running shell commands.

What native MySQL grants solve and what they miss

Database role grants work well for stopping an agent from running direct delete queries. If the Cascade agent tries to remove rows, the MySQL server blocks the query right away. This protects your tables even if an engineer approves a bad terminal prompt by mistake. It gives you a solid baseline rule at the storage level.

Still, static database roles only check who logs in to the server. They do not inspect what individual queries do in flight beyond basic command types. For example, an agent might need delete rights in a staging database to clean up test data. Once you grant that right, MySQL cannot block a query that lacks a filter clause.

MySQL Access Governance + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Static roles also do not stop an agent from reading sensitive columns during a debug task. If the role can read a customer table, every query returns raw emails and card numbers. Plus, shared roles make it hard to see which person or agent ran a specific command. Teams need a way to check each query and mask fields like phone numbers in results.

Inspect every MySQL query and response in flight

Static grants and network rules block bad logins. They cannot pause a risky query for review or mask emails in a result set. By design, hoop.dev sits inline in the MySQL protocol as a sidecar for your MySQL. For every plain query, prepared statement, or cursor an agent or human runs in production, hoop.dev decides to pass, mask, block, or hold it for review.

First, hoop.dev guardrails block banned actions before MySQL runs them, and an AI Analyzer you configure can score intent or escalate for approval. Next, hoop.dev data masking rewrites sensitive string columns in results in memory, and every verdict goes to the audit trail. Find the open-source binary on GitHub.

Frequently asked questions

How does the Windsurf agent connect to a MySQL database?

Windsurf, now called Devin Desktop, runs commands in a dedicated terminal or uses Model Context Protocol servers. Both paths use the database keys and variables stored in your local shell profile.

Can IDE prompt settings alone stop accidental MySQL deletes?

Prompt instructions guide the AI model, but they are not hard security boundaries. The model can still write a bad script or run a destructive command if a user approves it.

Why are static MySQL roles hard to manage for AI agents?

Agents often need write rights to build features, fix bugs, and clean up test rows. A static role cannot allow single-row cleanup while blocking a query that wipes the whole table.

Teams that document these role rules and review logs each month catch config drift early. Clear ownership for each role keeps live systems simple to run and easy to audit across the whole team.

The query runs. The emails stay hidden.