Skip to main content

mariadb-guard

❖ Communityv26.10.6

Companion to mariadb-dev; install it together with mariadb-dev, whose MCP server it redirects to. A pre_tool_call hook that blocks the agent from running the mariadb/mysql command-line clients (and similar) for what the mariadb MCP tools do, so no database password reaches a command line, plus a short system-prompt rule saying so. Pure Python, no dependencies, no network calls, no file access. Setting MARIADB_PLUGIN_ALLOW_CLI=1 disables it.

Open in Hermes Desktop
hermes plugins install mariadb-guard

What it adds

Hooks 1

pre_tool_call

README

From the reviewed commit fde0a1f ↗; it updates when the author re-pins.

MariaDB guard plugin for Hermes Agent

Version 26.10.6

A companion to the mariadb-dev and mariadb-sql plugins. It stops the agent from using the MariaDB and MySQL command-line clients for what the mariadb MCP server's tools do, so that work goes through the MCP server.

Why

A command-line client run from the agent's terminal needs the password on its command line (-p<password>) or in its environment. From there it reaches the process list, logs, and the conversation the model provider sees. A connection opened through the MCP server reads its password from the operating system's secret store, so the agent never sees a password at all.

To give the agent a server, configure it in the MCP server yourself, either interactively with mariadb-shell -- mcp setup or with its command-line options. For a local test server, the agent deploys a sandbox with a random root password it generates; the password is stored with the sandbox's connection.

What it does

It looks at only five clients, and each only where an MCP tool does the job:

Client Blocked when Use instead
mariadb, mysql it runs SQL db.execute_sql, db.execute_sql_script
mariadb-shell, mysqlsh it runs SQL (SQL mode) db.execute_sql, db.execute_sql_script
mariadb-shell, mysqlsh it calls -- <object> <method> that a tool wraps, such as -- util dump-schemas the matching tool, here util.dump_schemas
mariadb-dump its output is piped into another client util.copy_instance, util.copy_schemas, util.copy_tables
  • A blocked terminal call gets an explanation naming the tool to use instead. A client is caught behind a path, env, a pipe, &&, sh -c "..." or $(...).
  • Everything else runs: --version and --help, Python or JavaScript mode, a dump written to a file, mariadb-shell -- mcp setup, an API call no tool wraps, and every other client. The agent keeps the features the MCP tools do not have yet.
  • A system-prompt section says the same before the first tool call.

Installation

Hermes runs hooks only from a Python plugin, and a Python plugin cannot also carry skills and an MCP server. So the guard is a package of its own, installed next to mariadb-dev (or mariadb-sql):

hermes plugins install mariadb/ai-plugins#hermes/guard-plugin --enable

Then start a new Hermes session.

Turning it off

If you want the agent to run the clients itself, start Hermes with MARIADB_PLUGIN_ALLOW_CLI=1 in its environment, or run hermes plugins disable mariadb-guard. The model cannot turn it off: the variable is read from Hermes' own environment, not from the command the model runs.

Limits

The guard reads the command the way a shell would split it, but it does not run it. A command built at run time ($(echo mariadb) -e ...), or a client started from execute_code instead of terminal, is not caught. The guard is a safety net, not a sandbox; the MCP server's instructions and the plugin's system-prompt section are what steer the agent in the first place.

License

GPL-2.0, see LICENSE.

← Back to the catalog · catalog built Nov 3, 2026