How to Configure Windsurf CockroachDB Guardrails

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up windsurf cockroachdb guardrails by restricting database roles and requiring prompt approvals. This stops the AI coding agent from running harmful queries against your cluster. Cognition renamed Windsurf to Devin Desktop, though it keeps the same IDE and features. Its agent runs terminal commands in a dedicated shell and uses Model Context Protocol servers. Teams often give local tools a broad admin user to speed up daily coding. When an AI agent inherits those broad rights, a bad prom

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 cockroachdb guardrails by restricting database roles and requiring prompt approvals. This stops the AI coding agent from running harmful queries against your cluster. Cognition renamed Windsurf to Devin Desktop, though it keeps the same IDE and features. Its agent runs terminal commands in a dedicated shell and uses Model Context Protocol servers. Teams often give local tools a broad admin user to speed up daily coding. When an AI agent inherits those broad rights, a bad prompt can drop tables. It can also pull sensitive rows into the model context.

Setting up native windsurf cockroachdb guardrails

A safe setup starts inside both the editor and your database cluster. In Windsurf, now called Devin Desktop, the agent asks for user permission before running commands. It launches a dedicated shell that loads your local profile, aliases, and variables. You should set the editor to require manual review for every terminal execution. This ensures a human checks each database call before the shell runs it.

Next, you must lock down the Model Context Protocol server settings in your editor. The legacy Cascade agent connects to external systems through a local JSON file. If you link a database server there, do not pass a root database user. Instead, create a dedicated database role inside your CockroachDB cluster just for the agent. Grant that role select rights only on the specific tables needed for coding tasks. Never give this role permission to drop tables, change schemas, or read secret tables.

You should also check your local shell profile for stored database credentials. Because the agent shell loads your profile, it can read your exported variables. Remove admin database strings from your main shell profile so the agent cannot use them. Store only the restricted read-only role credentials in the local workspace for the agent.

What native database roles solve and what they miss

Native database roles and editor prompts solve the basic problem of who can log in. They stop the agent from running admin commands if you assign a read-only user. Manual terminal prompts also give developers a chance to stop obvious destructive commands. For small projects with fake data, these built-in controls give you a good start.

AI Guardrails + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Still, static roles and client prompts leave a large gap during live sessions. Database roles decide who logs in, not what individual statements do in flight. A read-only role still lets the agent pull millions of customer rows at once. If a table holds emails, phone numbers, or card numbers, the query returns them. Those raw values then flow straight into the AI model context window.

Client-side command approvals also break down when a team scales up. Developers get tired of reading long SQL queries in a small prompt window. After approving dozens of safe reads, a user might approve a risky write by mistake. Also, local credentials sit on the developer laptop in plain text files. They stay valid until someone rotates them by hand. Native controls cannot mask fields in results or approve single write queries from Slack.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev sits inline in the protocol beside each supported service as an open-source proxy, a sidecar for your database or API. For every query or command an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human approval.

First, hoop.dev guardrails block banned queries before they run or hold risky ones for review, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II and is open source 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 runner, and agent workflows.

How does the Windsurf agent connect to a CockroachDB cluster?

The agent runs CLI tools in a dedicated shell that loads your local variables. It can also query databases through local Model Context Protocol servers.

Why are read-only CockroachDB roles not enough for AI agents?

Read-only roles still return sensitive fields like emails, phone numbers, and card numbers. Without field masking, those raw values go straight to the AI model provider.

The query runs. The emails stay hidden.