How to Configure Windsurf MariaDB Prevent Delete

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up windsurf mariadb prevent delete rules, assign read-only roles to your agent. You must also require user prompts before the editor runs terminal commands. Teams often give coding agents their own local database keys for quick fixes. When those roles have broad write permissions, a single bad query can wipe tables. How windsurf mariadb prevent delete rules work in practice Cognition renamed the editor to Devin Desktop, though it keeps the same core features. Its Cascade agent can run

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 windsurf mariadb prevent delete rules, assign read-only roles to your agent. You must also require user prompts before the editor runs terminal commands. Teams often give coding agents their own local database keys for quick fixes. When those roles have broad write permissions, a single bad query can wipe tables.

How windsurf mariadb prevent delete rules work in practice

Cognition renamed the editor to Devin Desktop, though it keeps the same core features. Its Cascade agent can run terminal commands on its own with user permission. The agent uses a dedicated terminal that loads your local shell settings. Because it loads your shell, the agent inherits your local aliases and variables. It also uses Model Context Protocol servers to reach external databases.

To stop destructive queries natively, you must create a custom MariaDB user role. Database admins grant this role select privileges while holding back delete rights. You can add update and insert rights if the agent must write data. You then point the agent tool settings to this limited database account. When the agent tries to remove rows, MariaDB blocks the action right away. You should also keep terminal command prompts active inside the editor settings. This prompt lets a human check every command before the agent runs it.

What native database roles solve and what they miss

Native MariaDB roles do a great job of blocking full table drops. They decide who can log in and which broad table privileges apply. This setup works well when an agent only needs to read schema details. It stops the worst mistakes before they reach your stored records.

Still, static roles leave a big gap during daily coding work. Native setup decides who logs in, not what individual statements do in flight. Sometimes an agent needs to clean up one test row during a task. If you grant delete rights for that task, the agent can delete anything. MariaDB cannot tell a safe single-row removal from a query without a filter. Also, because the dedicated terminal reads shell variables, the agent might find admin keys. If the agent uses an admin key from your shell, role limits fail. Static database grants also cannot mask sensitive fields like emails or phone numbers. Raw card numbers and national IDs flow straight into the model context.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Why human command prompts are not enough for database safety

Relying on human prompts for every query causes alert fatigue for busy engineers. Developers often approve long scripts without reading every single SQL statement inside them. An agent can wrap a harmful delete command inside a larger migration file. Once the user clicks approve, the database runs the whole file at once.

Teams also share database user accounts across multiple local tools and scripts. Updating passwords and roles across every developer machine takes too much manual work. When a project needs fast fixes, developers often switch back to admin accounts. That quick shortcut leaves tables open to accidental removal all over again. True safety requires checking each SQL statement right before the database runs it.

Check MySQL queries and results on the wire

MySQL grants control who logs in. They do not check single queries or mask sensitive columns once a session starts. With hoop.dev, you run an open-source proxy, a sidecar for your MySQL, inline in the MySQL wire protocol. On every query an AI agent or human runs against production MySQL, RDS, or Aurora, hoop.dev decides to pass, mask, block, or hold it for review.

Multi-statement batches and prepared queries are split and checked one by one by hoop.dev guardrails, which refuse banned queries with a native MySQL error or hold risky ones for approval. On the response path, hoop.dev data masking rewrites string values in returned rows in memory, and every decision is logged. See the MIT-licensed project on GitHub.

Frequently asked questions

Can the Cascade agent use my local shell database credentials?

Yes, the agent uses a dedicated terminal that loads your normal shell settings. Any database keys stored in your shell profile are open to the agent.

Does MariaDB let me block deletes on specific tables only?

Yes, MariaDB lets admins grant permissions at the database or individual table level. You can allow deletes on a scratch table while blocking them everywhere else.

How does the editor connect to MariaDB without running shell commands?

The editor connects to external databases through configured Model Context Protocol servers. These servers use the database credentials you define in the local config file.

The query runs. The emails stay hidden.