How to Configure Windsurf CockroachDB Read Only Access
To set up windsurf cockroachdb read only access, create a restricted database user first. Then pass that user role to the agent through terminal variables or an MCP server. On June 2, 2026, Cognition renamed Windsurf to Devin Desktop with the same features. Many teams start by giving the coding agent their own local database keys. Broad keys let an automated agent alter tables or delete production rows by mistake. Scoping permissions down to read queries keeps your cluster data safe during codin
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.
To set up windsurf cockroachdb read only access, create a restricted database user first. Then pass that user role to the agent through terminal variables or an MCP server. On June 2, 2026, Cognition renamed Windsurf to Devin Desktop with the same features. Many teams start by giving the coding agent their own local database keys. Broad keys let an automated agent alter tables or delete production rows by mistake. Scoping permissions down to read queries keeps your cluster data safe during coding tasks.
How windsurf cockroachdb read only access works
Windsurf, now called Devin Desktop, runs a built-in coding agent named Cascade. This agent can run terminal commands on its own once a user gives permission. It opens a dedicated shell using zsh on macOS or bash on Linux. That shell loads the local user profile, along with all aliases and stored variables. If a developer stores database keys in their shell profile, the agent inherits them. The Cascade agent also talks to external tools through Model Context Protocol servers.
To restrict the agent, database admins first create a dedicated role inside CockroachDB. Admins grant this role select privileges on specific schemas or tables only. They leave out insert, update, drop, and delete rights on every database object. Next, the developer puts the read-only credentials into their local shell or MCP setup. When the agent runs a database client or queries an MCP tool, CockroachDB checks the role. The database engine blocks any command that tries to change data or table structures.
What native roles solve and what they miss
Native database roles stop the agent from changing rows or dropping tables. They set a hard boundary at the storage engine level. Even if a prompt goes wrong, the database rejects every write query right away. This setup is a strong first step for any team using AI coding tools.
Still, a database role only decides who can log in and which tables open. It does not inspect what individual select statements do while they run in flight. A read-only user can still pull thousands of customer emails, phone numbers, or card numbers. Once the query finishes, those raw values flow straight into the agent context window. From there, sensitive records are sent to the external model provider. A static role also stays active on the laptop until an admin revokes it.
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.
Why local agent credentials create audit gaps
When five developers share one read-only database user, cluster logs show only that single role. Security teams cannot tell which person or agent session ran a specific query. Rotating that shared password breaks the local setup for every engineer on the team. Giving each developer a unique read-only user adds extra setup work across many clusters. Teams also lack a central place to pause agent queries during an active incident. Data masking is missing too, since native roles return raw values instead of rewriting matched fields in results.
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
Is Windsurf the same tool as Devin Desktop?
Yes, Cognition announced on June 2, 2026 that Windsurf is becoming Devin Desktop. It keeps the same editor features, terminal runner, and Cascade agent under the new name.
How does the agent reach a CockroachDB cluster?
The agent runs database CLI tools in a dedicated shell with user permission. It can also query the cluster through a configured Model Context Protocol server.
Does a read-only role hide sensitive customer fields from the model?
No, a read-only role still lets select queries return full rows to the agent. Without field masking to rewrite emails or card numbers, raw data enters the prompt context.
Related guides
In this post