How to Configure OpenHands MariaDB Prevent Delete
You set up an openhands mariadb prevent delete rule by limiting the agent database role. You remove delete rights from the account that the AI agent uses to log in. Engineering teams often give coding agents broad database accounts to move fast during testing. When a role has too much power, one bad prompt can wipe out live tables. A clear permission plan stops the agent from running harmful commands on your data. How openhands mariadb prevent delete works with native roles OpenHands runs tas
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.
You set up an openhands mariadb prevent delete rule by limiting the agent database role. You remove delete rights from the account that the AI agent uses to log in. Engineering teams often give coding agents broad database accounts to move fast during testing. When a role has too much power, one bad prompt can wipe out live tables. A clear permission plan stops the agent from running harmful commands on your data.
How openhands mariadb prevent delete works with native roles
OpenHands runs tasks inside a workspace and talks to external databases using standard drivers. To stop row removal, database admins build a specific MariaDB account for the agent. This account gets permission to read tables, insert new rows, and update current values. Admins leave out permissions that erase rows, drop tables, or empty entire schemas. When the agent tries to run a delete command, the database blocks the query.
You can scope these database rules down to a single schema or specific tables. Some teams allow the agent to delete rows only in a scratch schema. At the same time, the main production schema keeps strict rules that forbid deletions. The database engine checks these privileges before it runs any query from the agent. This native setup gives teams a solid baseline for safe AI agent tasks.
What native roles solve and where gaps remain
Native MariaDB privileges work well when an agent never needs to remove any data. The database checks who logs in and enforces the static rules on that account. Still, static database roles cannot check the context or size of a single query. If a task requires the agent to clean up one test record, you face a dilemma. Granting delete rights for one task opens the door to broader mistakes later.
Also, an agent without delete permissions can still ruin data using an update command. An update statement without a filter can overwrite every phone number or email in a table. Static accounts decide who logs in, not what individual statements do in flight. Teams also need a way to keep raw card numbers and national IDs safe. Masking rewrites matched fields in results so sensitive strings do not leak into agent logs.
End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Setting up safe agent workflows for database tasks
Start by auditing every database account that your coding agents use across your systems. Replace shared admin credentials with dedicated roles that have only the permissions needed today. Separate your read queries from your write queries whenever your workflow allows it. Keep the agent credentials stored in a secure secret store instead of plain files.
Next, review how your team handles exceptions when an agent must run a risky command. Instead of expanding the database role forever, require a human to check the exact query. Pair this review step with full query logging so you can trace every agent action. Good logs show who approved the task and what the database returned.
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 is an open-source proxy that runs as a sidecar for your MySQL. It reads plain queries, prepared statements, and cursors on the wire.
First, hoop.dev guardrails block banned actions before MySQL runs them. An AI Analyzer you configure can score intent, and hoop.dev data masking rewrites sensitive string columns in results. Every query and verdict goes to the resource audit trail. Find the open-source binary on GitHub.
Frequently asked questions
Can OpenHands still drop tables if I revoke delete rights in MariaDB?
Yes, unless you also revoke drop and alter rights from that MariaDB user account. MariaDB treats row deletion and table removal as separate permissions that you must manage together.
How do I let an agent fix bad data without granting delete rights?
You can add a status column to your tables and let the agent update it. This soft delete pattern marks rows as inactive while keeping the actual records intact.
What happens when OpenHands hits a MariaDB permission error?
The database returns an access denied error to the agent workspace right away. The agent reads this error message and tries a different way to finish the task.
Related guides
In this post