How to Configure Windsurf MySQL Sandbox
You set up a windsurf mysql sandbox by creating an isolated database and restricting agent roles. You then connect your coding agent through terminal commands or an MCP server. Teams often start by handing the agent a local root key to test code fast. When permissions stay too broad, a bad prompt can wipe tables or read sensitive rows. How a windsurf mysql sandbox works in practice In June 2026, Cognition renamed Windsurf to Devin Desktop while keeping the same IDE features. Its Cascade agent
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 mysql sandbox by creating an isolated database and restricting agent roles. You then connect your coding agent through terminal commands or an MCP server. Teams often start by handing the agent a local root key to test code fast. When permissions stay too broad, a bad prompt can wipe tables or read sensitive rows.
How a windsurf mysql sandbox works in practice
In June 2026, Cognition renamed Windsurf to Devin Desktop while keeping the same IDE features. Its Cascade agent can run terminal commands on its own when the user gives permission. The agent uses a dedicated terminal that runs zsh on macOS or bash on Linux. Because this terminal loads your normal shell setup, the agent inherits your shell aliases. It also reads any database keys stored in your local shell variables.
The legacy Cascade agent also talks to external tools through configured MCP servers. To build a safe sandbox, engineers first spin up a separate MySQL instance. This test database holds fake data or a small subset of production tables. Next, you create a dedicated MySQL user for the coding agent. You grant this role permission to read tables and run basic changes in the test schema. You then put those sandbox credentials into your shell setup or MCP server config.
What native database roles solve and what they miss
Native MySQL roles do a good job of controlling who can log in. They also limit which schemas and tables a specific user account can touch. If you only grant read access on a sandbox schema, the agent cannot drop tables. This setup stops an automated coding loop from breaking production schemas by mistake.
Still, native database roles only check permissions at login and at the table level. They do not inspect what individual queries do while they run in flight. Teams often copy real data into a sandbox so they can fix tricky bugs. Once the agent logs in, a select role lets it pull every column in that table by default. The database will return raw emails, phone numbers, card numbers, and national IDs into the prompt. Also, local shell variables leave plain database keys sitting on the developer machine. Native roles cannot rewrite sensitive fields in query results or approve single statements one by one.
MySQL Access Governance + AI Sandbox Environments: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Why shell inheritance increases risk for coding agents
Because the agent terminal loads your full shell setup, it sees all your saved keys. Many developers store staging or production database keys in their main shell profile. Even if you build a local MySQL sandbox, the agent might read another variable. A confused model could run a destructive script against the wrong host address. Separating the database is only half of the safety work for AI coding tools. You also need a way to keep raw keys off the local disk. And you need controls that inspect each query before the database runs it.
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
How does the Windsurf agent connect to a MySQL database?
Windsurf, now called Devin Desktop, connects through its Cascade agent using two main paths. It can run MySQL client commands in its dedicated terminal, or use a configured MCP server.
Why can the coding agent see my local database keys?
The dedicated terminal in Devin Desktop loads your user shell setup on macOS and Linux. Any database keys exported in your shell profile become available to the agent.
Do read-only MySQL roles stop sensitive data leaks in a sandbox?
No, a read-only role still lets the agent read every column inside allowed tables by default. If the sandbox holds real user rows, queries will return raw emails and card numbers.
Related guides
In this post