How to Configure Windsurf CockroachDB Sandbox
You set up a windsurf cockroachdb sandbox by giving the AI agent a scoped database role. Then you let the agent run commands through its built-in terminal or an MCP server. Teams often start by placing a full database key in a local shell file. This quick path lets the coding agent read and write data right away. Still, broad permissions create real risks when an agent runs SQL queries on its own. One bad prompt can change schemas or expose sensitive test rows. How a windsurf cockroachdb sandb
AI Sandbox Environments + End-to-End Encryption: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up a windsurf cockroachdb sandbox by giving the AI agent a scoped database role. Then you let the agent run commands through its built-in terminal or an MCP server. Teams often start by placing a full database key in a local shell file. This quick path lets the coding agent read and write data right away. Still, broad permissions create real risks when an agent runs SQL queries on its own. One bad prompt can change schemas or expose sensitive test rows.
How a windsurf cockroachdb sandbox works in practice
Cognition changed the name of Windsurf to Devin Desktop on June 2, 2026. The tool keeps the same IDE features and uses the Cascade agent to help developers. This agent can run terminal commands on its own if the user gives permission. It opens a dedicated shell that uses zsh on macOS or bash on Linux. That shell loads the user's normal shell files, aliases, and local variables.
Because the shell loads local variables, the agent can use database keys stored there. It can also reach external tools through MCP servers defined in its local settings. When you set up a windsurf cockroachdb sandbox, you start at the database level. You create a separate database or cluster meant only for testing and building. Next, you create a dedicated SQL user with a role that only touches test tables. Finally, you pass those login details to the agent's shell or MCP server.
During a coding session, the agent reads your code and suggests schema changes. With your approval, it runs migration scripts or test queries in the terminal. The database checks the role at login and allows queries that match those grants.
Why native roles leave gaps during agent sessions
Database roles and sandbox clusters solve the first layer of risk. They keep the AI agent out of your main production system. They also decide which user can log in and which tables that user can see. If the agent only has rights to a test schema, it cannot drop other databases.
Still, static database grants do not watch what happens inside an active session. Once the agent logs in, the database trusts every command that role sends. A developer might copy real customer data into the sandbox to debug a hard bug. If the agent queries that table, the results flow right into the model context. Those results might hold emails, phone numbers, card numbers, or national IDs. Native roles cannot rewrite matched fields in results before the agent reads them.
AI Sandbox Environments + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Local keys also create a sharing problem for growing engineering teams. Storing database passwords in shell files means every laptop holds a live secret. If an agent runs a bad command, the database log only shows the shared role name. You cannot easily link a specific SQL statement back to one developer's prompt. Teams also struggle to pause a single dangerous drop command without breaking the whole role.
What to check before you grant agent permissions
Before you let an agent touch your sandbox, review how you manage data and keys. First, check what kind of data lives inside your test tables. Make sure your team does not load raw emails or card numbers into the sandbox. If realistic data is required, use fake rows or mask those fields during queries.
Second, review how the Cascade agent gets permission to run terminal commands. Avoid letting the agent run every shell command without a human check when destructive rights exist. Separate the role that runs read queries from the role that alters tables. This split stops a routine debugging prompt from changing your database structure by mistake.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.
Before a query runs, hoop.dev guardrails check the statement against your rules, an AI Analyzer you configure can score intent or hold risky calls for human approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Did Windsurf change its product name?
Yes, Cognition renamed Windsurf to Devin Desktop on June 2, 2026. The app keeps the same IDE features, and the Cascade agent still runs terminal commands and MCP tools.
How does the agent reach a CockroachDB sandbox?
The agent runs commands in a dedicated zsh or bash shell that loads your shell files. It uses database keys from those files or talks to an MCP server you set up.
Why are read-only roles not enough for a sandbox containing copied data?
A read-only role still returns every column in a table when the agent runs a query by default. Without field masking, emails, phone numbers, and card numbers enter the AI model context.
Related guides
In this post