How to Configure Goose MariaDB Read Only Access
You set up goose mariadb read only access by creating a restricted database user. Then you pass those select-only credentials to your local AI agent setup. Many teams start by handing the agent a shared developer password. This shortcut gives the AI tool full power to change or drop tables. A single bad prompt can wipe out production rows in seconds. Scoping permissions down to read queries is a vital first step. How to set up goose mariadb read only access Setting up safe database access sta
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 goose mariadb read only access by creating a restricted database user. Then you pass those select-only credentials to your local AI agent setup. Many teams start by handing the agent a shared developer password. This shortcut gives the AI tool full power to change or drop tables. A single bad prompt can wipe out production rows in seconds. Scoping permissions down to read queries is a vital first step.
How to set up goose mariadb read only access
Setting up safe database access starts inside your MariaDB server. A database admin creates a dedicated account just for the AI agent. This account receives permission to read tables and view schemas only. You leave out permissions that let the user insert, update, or delete data. You also block the account from making structural changes to tables.
Next, you bind this user to specific network hosts or IP addresses. This step stops outsiders from using the account from unknown networks. Once the database role is ready, you move to the developer machine. Goose uses extensions and local system settings to talk to external data sources. The engineer stores the MariaDB host, port, username, and password on their laptop.
When the developer asks a question, the agent reads the schema first. It builds a select query and sends it over the open session. MariaDB checks the account privileges before running the statement. If the agent tries to change a row, the database rejects the command. The agent receives the error and adjusts its approach right away.
Where native MariaDB read roles fall short for AI agents
Native database roles solve the problem of accidental data writes and deletions. The database server blocks any attempt to alter rows or drop tables. Still, database roles only decide who logs in and which tables they read. They do not inspect what individual select statements do in flight.
A read role still lets the agent pull every row from permitted tables by default. If a table holds customer emails, phone numbers, or card numbers, the agent reads them. The local tool then sends those raw query results to an external model provider. Sensitive customer records leave your network inside the model prompt context. Data masking is needed to rewrite matched fields in results before they leave.
Auditor Read-Only Access + Customer Support Access to Production: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Static database credentials on laptops also create a long-term key management problem. Engineers store plain passwords in local text files to keep the agent working. If a laptop is lost, those database keys are exposed to attackers. Rotating those keys forces every developer to update their local setup by hand. Also, shared read accounts ruin your database audit logs. Every query from every developer shows up under the same generic username.
Managing query risks and data exposure
Beyond privacy leaks, an AI agent can hurt database uptime with read queries. A model does not always know how large a production table is. It might write a complex join across millions of unindexed rows. MariaDB will run that read query because the user has select privileges. The heavy query can lock up CPU and memory on the database server. Real user traffic slows down while the database works on the agent request.
Teams can set basic resource limits inside MariaDB to drop long queries. Still, managing those limits across dozens of databases and users takes constant work. Security teams need a way to link every query to a real human identity. They also need to scrub sensitive fields like national IDs from query results.
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 is an open-source proxy that runs as a sidecar for your MySQL. It reads plain queries, prepared statements, and cursors on the wire.
First, hoop.dev guardrails block banned actions before MySQL runs them. An AI Analyzer you configure can score intent, and hoop.dev data masking rewrites sensitive string columns in results. Every query and verdict goes to the resource audit trail. Find the open-source binary on GitHub.
Frequently asked questions
Can Goose still alter tables with a MariaDB read role?
No, MariaDB blocks any insert, update, delete, or drop commands when you grant select permissions only. The server rejects write queries before they touch your stored data.
Does a read role stop the AI agent from reading sensitive data?
No, a standard select privilege returns all columns in the allowed table by default. This includes emails, phone numbers, card numbers, and national IDs unless you add masking.
Why avoid storing MariaDB passwords in local agent files?
Local config files store plain passwords on developer laptops where malware can steal them. Removing static keys from laptops reduces the risk of a credential leak.
Related guides
In this post