How to Configure OpenHands MySQL Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up openhands mysql approval by adding human review steps and scoped database roles. These controls pause the AI agent before it runs SQL statements against your data. Many engineering teams start by giving the agent a broad database login for testing. That wide role lets an automated tool alter tables or read sensitive rows without warning. How native openhands mysql approval and database roles work OpenHands runs as an autonomous coding agent inside a local container or workspace. It

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 openhands mysql approval by adding human review steps and scoped database roles. These controls pause the AI agent before it runs SQL statements against your data. Many engineering teams start by giving the agent a broad database login for testing. That wide role lets an automated tool alter tables or read sensitive rows without warning.

How native openhands mysql approval and database roles work

OpenHands runs as an autonomous coding agent inside a local container or workspace. It writes code, runs shell commands, and connects to external data stores like MySQL. You can turn on confirmation mode inside the agent settings to pause shell actions. When confirmation mode is active, the agent asks a human before running a terminal command.

On the database side, MySQL controls actions through user accounts and privilege grants. Admins create a dedicated database user for the agent with strict table permissions. You can grant read rights on specific schemas while blocking drop or delete actions. The database checks these static privileges when the agent opens a session and sends queries.

Teams combine these two native features to build a basic review workflow. The agent proposes a command, the user approves the step, and MySQL checks the role. This two-part setup forms the foundation for managing automated database tasks in development.

What native setup solves and where the gaps remain

Native agent prompts and MySQL grants stop many basic mistakes during daily work. A read-only database user blocks the agent from dropping a production table by accident. Agent confirmation prompts also stop the tool from launching surprise scripts on a developer machine. These static controls decide which account can log in and which tables it touches.

Still, static grants do not check what individual SQL statements do in flight. If an agent needs write permissions to fix a bug, it keeps those permissions everywhere. A single approved script might run ten safe queries and one bad update statement. Native MySQL roles cannot pause a single risky update while allowing safe reads on that account.

Approval Chains & Escalation + MySQL Access Governance: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Confirmation prompts inside the agent workspace also lack deep SQL awareness. A user sees a bash command or script name rather than the exact query text. Also, static roles do not mask sensitive columns when the agent queries customer tables. If a table holds emails, phone numbers, or card numbers, a read query returns raw values. Dynamic data masking is needed to rewrite matched fields in results before the agent reads them.

Best practices for reviewing agent database queries

Start by separating the accounts used for reading data from accounts that change data. Give the agent a restricted read role for most debugging and schema inspection tasks. Only switch to a write role when a task requires a specific data change.

Next, require explicit human sign-off for any query that modifies rows or table structures. Reviewers should read the exact SQL statement rather than just the script file name. Keep a clear audit log of who approved each query and when it ran. Finally, apply field masking on tables that store national IDs, emails, or phone numbers.

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

Can MySQL pause a single query for human approval on its own?

No, MySQL does not have a built-in prompt to pause individual queries for human review. It either runs or rejects a statement right away based on the user role.

Does OpenHands inspect SQL queries inside scripts before running them?

OpenHands can ask for confirmation before it runs a shell command or script file. It does not parse database protocol traffic to check individual SQL statements inside that script.

How do teams protect sensitive columns during agent debugging sessions?

Teams use restricted database views or dynamic masking rules on sensitive columns. Masking rewrites matched fields like card numbers or emails in query results during the session.

The query runs. The emails stay hidden.