How to Configure Windsurf MariaDB Audit Log
You set up a windsurf mariadb audit log by turning on the native database audit plugin and tracking queries from the agent's database account. Next, you direct those log events to a safe file or external log server for your security team to check. Teams often give AI coding tools a shared database account to speed up local work. When that account has broad rights, the agent can read sensitive rows or drop tables by mistake. Without clear audit records, engineers struggle to trace which prompt or
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 windsurf mariadb audit log by turning on the native database audit plugin and tracking queries from the agent's database account. Next, you direct those log events to a safe file or external log server for your security team to check. Teams often give AI coding tools a shared database account to speed up local work. When that account has broad rights, the agent can read sensitive rows or drop tables by mistake. Without clear audit records, engineers struggle to trace which prompt or command caused an outage.
How a windsurf mariadb audit log works in practice
On June 2, 2026, Cognition renamed Windsurf to Devin Desktop. The editor keeps the same features and still uses the Cascade agent. This agent can run terminal commands on its own after the user gives permission. It opens a dedicated shell that loads the user's normal shell profile. It uses zsh on macOS and bash on Linux. Because the shell loads user settings, local aliases and saved database keys are open to the agent. The Cascade agent also reaches databases through Model Context Protocol servers set up on the machine.
When the agent queries MariaDB through the terminal or an MCP tool, the database sees a standard client login. To build a windsurf mariadb audit log, admins load the server audit plugin inside the database engine. You then set the plugin to record logins, queries, and table changes. Giving the AI agent its own database username makes filtering much easier. The database writes every query from that user to a local file or sends it to syslog. Security teams can then review these records to see what the agent ran during a coding session.
What native database logging solves and what it misses
The native MariaDB audit plugin gives you a solid historical record of database activity. It proves which database user logged in and when the session started. It also records the exact SQL statements that hit the server. This helps teams meet basic audit rules and find the root cause after a bad query runs. If an agent alters a schema, the log shows the statement and timestamp.
Still, native database logs only tell you what happened after the query finishes. The setup checks who logs in, not what individual statements do in flight. Because the agent shares the developer's shell variables, it often logs in with the developer's own database role. The database log cannot tell a human query apart from an AI agent query on the same account. Native logs also do not stop a bad drop statement from running. Also, the database still returns raw emails, phone numbers, and card numbers to the agent's terminal. Data masking that rewrites matched fields in results is missing from a simple log setup.
Audit Log Integrity + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Separating agent actions from human developers
To get clean logs, teams must separate agent credentials from human credentials at the start. If a developer stores a master database password in a shell profile, the agent inherits full rights. A better path is to create a dedicated, read-only database role just for local AI tools. You then point the agent's MCP server to use that specific role.
Even with separate roles, managing local keys across a whole team takes constant work. Developers switch projects often and may pass broad permissions back to the agent to fix a quick bug. Relying only on local setup files and post-event database logs leaves gaps in daily database safety. Teams need controls that inspect commands before they hit the database and mask sensitive fields in flight.
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
Does Devin Desktop change how Windsurf connects to MariaDB?
No, Devin Desktop is the new name for Windsurf and keeps the same IDE features. Its agent still reaches MariaDB through the built-in terminal or configured MCP servers.
Can MariaDB logs tell if an AI agent ran a query?
MariaDB only logs the database username and client host for each session. If the agent uses the developer's own database user, the log cannot separate AI queries from human queries.
Does the MariaDB audit plugin block dangerous AI queries?
No, the native audit plugin only records events to a log file after or during execution. It does not block destructive statements or rewrite sensitive fields like card numbers or national IDs.
Related guides
In this post