How to Configure Windsurf MySQL Read Only Access

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up windsurf mysql read only access by creating a database user with select permissions. Then you pass those login details to your agent through local shell variables or an MCP server. Teams often start by sharing standard developer accounts with the coding agent. That broad role lets an automated tool alter tables or drop data by mistake. How windsurf mysql read only access works Cognition renamed Windsurf to Devin Desktop in June 2026, while keeping the same IDE and features. Inside

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 windsurf mysql read only access by creating a database user with select permissions. Then you pass those login details to your agent through local shell variables or an MCP server. Teams often start by sharing standard developer accounts with the coding agent. That broad role lets an automated tool alter tables or drop data by mistake.

How windsurf mysql read only access works

Cognition renamed Windsurf to Devin Desktop in June 2026, while keeping the same IDE and features. Inside the editor, the agent can run terminal commands in a dedicated shell with user permission. It uses zsh on macOS and bash on Linux. That shell loads your profile, so local aliases and variables stay available to the tool. The legacy Cascade agent also links to external MCP servers defined in your local settings.

To limit database actions, admins create a dedicated MySQL account that only allows select queries. You grant this role permission to read specific schemas and tables. Next, you store the login details in your shell profile or the MCP server settings. When the agent needs schema details or sample rows, it opens a session using that restricted account. The database engine checks the role at login and blocks any write or delete statements.

What native database roles solve and what they miss

A read-only role stops the agent from changing rows, dropping tables, or altering schemas. This basic step protects data integrity when an agent explores a database to write code. It ensures that a bad command from the terminal or MCP tool cannot corrupt records.

Still, MySQL permissions only decide who can log in and which tables they can read. They do not inspect what individual queries do in flight. An agent with select rights across a customer table can still pull every row at once. Those query results often hold sensitive fields like emails, phone numbers, card numbers, or national IDs. When the agent reads those rows, the raw values enter the model context and leave your machine.

Static database credentials also create key management work for your engineering team. Storing passwords in shell profiles leaves secrets sitting on developer laptops. Also, database logs only show that the shared read-only user ran a query. They do not tie each select statement back to the specific developer who prompted the agent.

Auditor Read-Only Access + MySQL Access Governance: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Securing agent database queries in flight

Safe agent setups need controls that work at the query level, not just at login. Teams should avoid storing long-lived database passwords in local shell files or MCP settings. Instead, engineers should log in with their own work identities before the agent runs a task.

Data masking is also vital when coding agents inspect live or staging databases. Masking rewrites matched fields in query results, such as emails, phone numbers, and card numbers. The agent still sees the table structure and data types it needs to write code. At the same time, sensitive customer values stay out of the model prompt. Detailed query logs also help teams track every statement an agent runs by user identity.

Check MySQL queries and results on the wire

MySQL grants control who logs in. They do not check single queries or mask sensitive columns once a session starts. With hoop.dev, you run an open-source proxy, a sidecar for your MySQL, inline in the MySQL wire protocol. On every query an AI agent or human runs against production MySQL, RDS, or Aurora, hoop.dev decides to pass, mask, block, or hold it for review.

Multi-statement batches and prepared queries are split and checked one by one by hoop.dev guardrails, which refuse banned queries with a native MySQL error or hold risky ones for approval. On the response path, hoop.dev data masking rewrites string values in returned rows in memory, and every decision is logged. See the MIT-licensed project on GitHub.

Frequently asked questions

Did Windsurf change its name to Devin Desktop?

Yes, Cognition renamed Windsurf to Devin Desktop on June 2, 2026. The product keeps the same IDE features, terminal access, and MCP support.

How does the agent run MySQL queries from the editor?

The agent can run CLI commands in a dedicated zsh or bash terminal with your permission. It can also query databases through an MCP server configured on your machine.

Does a MySQL read-only role hide sensitive customer data from the model?

No, a read-only role still lets the agent select all columns in an allowed table by default. You need field-level masking to rewrite emails, phone numbers, or card numbers in results.

The query runs. The emails stay hidden.