How to Configure Goose MariaDB Audit Log
You set up a goose mariadb audit log by turning on the server audit plugin. Then you give the AI agent its own database account to track every query. Teams often use a shared admin role when they first connect Goose to MariaDB. Broad permissions let an autonomous agent change tables or read private rows without clear tracking. How the goose mariadb audit log architecture works Goose runs on your machine or server as an autonomous coding agent. It reads local files, plans tasks, and runs datab
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 a goose mariadb audit log by turning on the server audit plugin. Then you give the AI agent its own database account to track every query. Teams often use a shared admin role when they first connect Goose to MariaDB. Broad permissions let an autonomous agent change tables or read private rows without clear tracking.
How the goose mariadb audit log architecture works
Goose runs on your machine or server as an autonomous coding agent. It reads local files, plans tasks, and runs database queries through standard client tools. When Goose talks to MariaDB, the database sees a normal user session. It does not know an AI agent sent the SQL statement.
To track the agent, admins turn on the built-in MariaDB audit plugin. This plugin watches internal server events and writes them to a log file. You can also send these log events to the local system log. The plugin records who logged in, which tables they touched, and what queries ran.
Good setup starts with a dedicated database user just for Goose. You grant this role access only to the specific schemas the agent needs. Then you set the audit plugin to filter events by that specific username. Every time Goose runs a query, MariaDB writes a line to the audit file. Security teams ship these files to a central log store for review.
Managing agent database roles and log filters
Native audit logs generate huge amounts of data on busy servers. If you log every read and write across all users, disks fill up fast. Filtering the log to watch only the Goose user keeps file sizes small. It also makes it easier for engineers to spot bad queries from the agent.
Still, database user management takes constant work as projects grow. Developers often run Goose using their own personal database keys during local testing. When that happens, the audit plugin logs the query under the human developer name. You lose the ability to tell human work apart from AI agent actions.
Shared static keys also create a risk if they sit in plain text files. Anyone who reads the local agent settings can copy the database password. Rotating those keys breaks the agent workflow until you update every local machine.
Audit Log Integrity + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native audit plugins solve and what they miss
The native MariaDB audit plugin is great for looking at past events. It proves who logged in and shows the exact text of completed queries. Auditors use these files to check access history after an incident happens. If Goose drops a table, the log shows when that command ran.
Still, a native audit log only records events after or during execution. It decides who can log in, not what individual statements do in flight. If Goose has permission to read a user table, it can pull every column by default. The audit log will note the read, but it will not redact sensitive data.
Unmasked query results can send emails, phone numbers, or card numbers straight into the model. Native logs also cannot pause a risky delete statement to ask for human approval. The database checks the static role permissions and runs the command right away. Teams need runtime controls to inspect queries and mask fields like national IDs in results.
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
How do you separate Goose queries from human queries in MariaDB logs?
Create a dedicated MariaDB user account just for the Goose agent. Configure the audit plugin filter to record events tied to that specific database username.
Does the MariaDB audit log stop Goose from reading sensitive columns?
No, the native audit plugin only records that a query ran. It does not block queries in flight or rewrite emails and card numbers in results.
Why do developer credentials show up in agent audit trails?
Engineers often let Goose use their own local database profiles to save setup time. The database logs those actions under the engineer username instead of an agent role.
Related guides
In this post