How to Configure Windsurf CockroachDB Credentials

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up windsurf cockroachdb credentials through local shell variables or Model Context Protocol settings. The coding agent reads these values to log in and run database queries. Many teams start by giving the agent a shared developer database account. If that role has broad permissions, one bad prompt can change or delete live data. Teams need a clear plan to manage how AI tools talk to databases. How windsurf cockroachdb credentials work in practice On June 2, 2026, Cognition renamed Win

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 credentials through local shell variables or Model Context Protocol settings. The coding agent reads these values to log in and run database queries. Many teams start by giving the agent a shared developer database account. If that role has broad permissions, one bad prompt can change or delete live data. Teams need a clear plan to manage how AI tools talk to databases.

How windsurf cockroachdb credentials work in practice

On June 2, 2026, Cognition renamed Windsurf to Devin Desktop. The app keeps the same features and workspace design as before. Its built-in agent can run terminal commands on its own after you grant permission. It opens a dedicated terminal session on your machine. It uses zsh on macOS and bash on Linux.

This terminal session loads your normal shell profile right away. Your existing shell aliases and saved keys are ready for the agent to use. If you store database secrets in your shell profile, the agent can use them. It runs command-line database tools using those local values.

The legacy Cascade agent also works with Model Context Protocol servers. You set up these servers in a local settings file on your computer. The database server reads your windsurf cockroachdb credentials from that file to start a session. Once logged in, the agent can check schemas, read tables, and write SQL statements. It acts with the exact same database rights as the user key you provided.

Why static database roles fall short for AI agents

Native database roles do a good job of controlling who can log in. You can create a specific CockroachDB user just for your coding agent. You can limit that user to specific databases or read-only tables. This basic setup stops an agent from dropping tables when it only needs to read.

Still, static roles cannot inspect what an individual query does in flight. Once the database checks the user key, every permitted query runs without another check. A read-only role can still pull thousands of rows of private customer records. Those results might hold emails, phone numbers, card numbers, or national IDs. That raw data flows straight back into the agent context and out to the model.

Ephemeral Credentials + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Storing plain keys on laptops also creates a long-term risk for your team. Because the terminal loads the user shell profile, any task can read those saved secrets. If an engineer needs write rights to test a migration, they often update the local key. People rarely switch that key back to a safe read-only role after the task finishes. Static setup decides who logs in, not what each command does at runtime.

Steps to limit risk with local database keys

Start by creating a dedicated database role for local coding work. Give this role read rights only on the schemas needed for current tasks. Never put root keys or production write secrets into your local shell profile. Keep test data separate from real user records whenever you build local apps.

Review every terminal command before you allow the agent to run it. Check what tables the query touches and how many rows it asks for. Rotate local keys often so old secrets do not sit on developer machines. Remove database keys from your local MCP settings file when you finish your work.

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 name to Devin Desktop?

Yes, Cognition renamed Windsurf to Devin Desktop on June 2, 2026. The editor keeps the same features, terminal tools, and agent workflows.

How does the agent read local shell variables?

The agent runs commands in a dedicated zsh or bash terminal with user permission. That terminal loads your shell profile, making your saved variables available to commands.

What is the risk of putting database keys in MCP settings?

Keys saved in local settings files stay on disk in plain text. Any tool or agent command running as your user can read and use them.

The query runs. The emails stay hidden.