How to Configure Claude Code MariaDB Approval
You set up claude code mariadb approval by using manual tool checks and read-only roles. This forces a human check before the agent runs shell commands or database queries. Most teams start by linking a local database tool or Model Context Protocol server. That setup works well for local test tables with fake rows. Problems start when an agent uses a shared database role with broad write rights. One bad query can alter live tables or pull raw user rows into prompts. How native claude code mari
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 claude code mariadb approval by using manual tool checks and read-only roles. This forces a human check before the agent runs shell commands or database queries. Most teams start by linking a local database tool or Model Context Protocol server. That setup works well for local test tables with fake rows. Problems start when an agent uses a shared database role with broad write rights. One bad query can alter live tables or pull raw user rows into prompts.
How native claude code mariadb approval works
Claude Code reaches databases in two main ways. First, it can use a Model Context Protocol server made for database queries. The vendor docs show how MCP servers give the agent access to external databases. They suggest using a read-only database user in the connection string. This stops the agent from changing or deleting your data during a run. Second, the agent can run database client commands through its built-in Bash tool.
When you use Manual mode, the Bash tool asks the user for permission first. Only a small built-in list of safe read commands can skip this manual check. Every database client call in the shell waits for the developer to say yes. The vendor docs also remind teams to trust each MCP server before using it. Together, local user prompts and database roles form the base layer of control.
What native setup solves and where gaps remain
Read-only MariaDB roles and local prompts solve basic accidents during daily coding work. A read-only user blocks the agent from dropping tables or changing rows by mistake. Manual mode in the terminal stops shell commands from running behind the developer's back. For small apps without private data, these built-in checks give a good starting point.
Still, local prompts and static database roles leave big gaps for live systems. Database roles decide who can log in and which tables they can read. They do not inspect what an individual SQL query does while it runs. If an agent needs write access to fix a bug, static roles fail. Giving the local setup a write role means every approved prompt gets full access.
Claude Code Security + Approval Chains & Escalation: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Also, local approval happens on the developer's own machine. The person writing code is the same person clicking yes on the terminal prompt. When people get tired, they often approve long SQL queries without reading every line. A second person on the security or data team cannot review that query first. Static roles also cannot rewrite sensitive fields like emails or phone numbers in results. If a table holds card numbers or national IDs, a read query pulls them.
Why teams separate login keys from query checks
Putting raw database passwords on every laptop creates extra risk for the whole team. Both MCP connection strings and shell tools usually need a local password or key. If an agent reads local files, it might find those saved database keys. Good security means keeping database keys off user machines and checking queries in flight. Teams also need clear logs showing which person and agent ran each MariaDB query.
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 Claude Code connect to a MariaDB database?
It connects through a Model Context Protocol server or by running shell commands. In both cases, it uses the database user credentials you set up.
Does Manual mode block all bad MariaDB queries on its own?
No, Manual mode only asks the local user before running a Bash command. If the user clicks yes, the database runs whatever the role allows.
Why are read-only MariaDB users not enough for production data?
Read-only users still pull raw rows from every table they can reach. They do not rewrite emails, phone numbers, or card numbers in query results.
Related guides
In this post