How to Configure OpenHands MariaDB Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up an openhands mariadb approval flow by pausing agent database tasks until a human checks them. This step stops automated software agents from running bad commands on your live tables. Many teams start by giving their coding agent a standard database role. They store a static password inside the local workspace for the agent to read. When permissions are too wide, the agent can drop tables or read private rows by mistake. A clear review step keeps your data safe while the agent works.

Approval Chains & Escalation + End-to-End Encryption: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up an openhands mariadb approval flow by pausing agent database tasks until a human checks them. This step stops automated software agents from running bad commands on your live tables. Many teams start by giving their coding agent a standard database role. They store a static password inside the local workspace for the agent to read. When permissions are too wide, the agent can drop tables or read private rows by mistake. A clear review step keeps your data safe while the agent works.

How openhands mariadb approval works in native setups

OpenHands runs as an automated coding agent inside its own workspace container. It writes code, runs shell scripts, and talks to outside data stores. To talk to MariaDB, the agent loads a client tool inside its container. Native MariaDB controls rely on user accounts and static grant tables. Database admins create a role and set rules for which tables that role can read or change. You can also turn on confirmation mode inside the agent framework. This mode asks a human user to click approve before the agent runs a shell action. The human reads the planned shell action in the chat window and lets it run. Meanwhile, MariaDB checks the network host and password when the client logs in. Once the login passes, MariaDB lets the session run any query allowed by that role.

What native controls solve and where gaps remain

Native database roles and agent confirmation prompts solve basic login and workspace risks. MariaDB grants make sure an outside user cannot log in without a known password. They also block a read role from changing data in restricted schemas. Agent confirmation prompts stop the bot from running shell tasks without a human look. Still, a big gap remains during live database sessions. Database grants only check who logs in and which broad tables they can touch. They do not pause a single bad delete query inside an allowed table. Also, agent prompts only show the raw shell command, not the deeper SQL batch inside a script. If the agent runs a migration script, the human might approve the script name without seeing a bad table drop inside it. Also, the agent container still holds raw database passwords in its workspace memory. If a prompt tells the agent to print its setup variables, those keys can leak into chat logs. When the agent queries a customer table, raw emails, phone numbers, and card numbers flow straight into the model context.

Building a safe review flow for agent queries

To fix these gaps, teams must separate query review from the agent container. First, remove write rights from the default role that the agent uses for daily checks. The agent should only hold read rights on safe test tables by default. Second, never store root or admin database keys inside the agent workspace. Third, move the human check to the database query level instead of the shell level. Reviewers need to see the exact SQL statement before MariaDB runs it. When the agent wants to alter a table or update rows, the workflow should pause that single query. A team lead can then check the SQL text in Slack or Teams and approve it. You should also mask sensitive columns so that queries rewrite emails and national IDs in results.

Approval Chains & Escalation + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Add wire guardrails and masking beside MySQL

Database grants and TLS setup decide who can reach MySQL. Even so, an open session can run broad updates or read raw personal data from allowed tables. In practice, hoop.dev runs beside the database as a sidecar for your MySQL. It keeps your login setup and drivers as they are while checking queries on the wire.

With hoop.dev MySQL support, guardrails refuse bad queries before they run and return a readable MySQL error. Data masking rewrites matched sensitive values in result rows in memory. Furthermore, hoop.dev holds SOC 2 Type II and generates evidence for GDPR, HIPAA, and PCI DSS programs. Read the docs and source on GitHub.

Frequently asked questions

Why is agent confirmation mode not enough for MariaDB safety?

Agent confirmation mode only checks the shell command that starts a script. It does not inspect individual SQL statements inside a file or stop credential leaks in the container.

How can we stop OpenHands from reading private customer data in MariaDB?

Limit the agent database role to specific views or apply data masking on query results. Masking rewrites matched fields like phone numbers and card numbers before the agent reads the output.

Should OpenHands use a shared team account to log into MariaDB?

No, shared accounts make it hard to track which queries came from the agent versus a human. Give the agent its own locked-down identity and log every statement it sends.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.