How to Configure Windsurf CockroachDB Prevent Delete

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up windsurf cockroachdb prevent delete rules, remove delete rights from the database role. Then give your AI coding agent a restricted database user account. Teams often let AI tools use their normal local shell profiles. Those profiles usually hold admin database keys for fast testing. When a role has broad rights, one bad query can wipe out vital tables. How windsurf cockroachdb prevent delete works Cognition renamed Windsurf to Devin Desktop on June 2, 2026. The app keeps the same I

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 prevent delete rules, remove delete rights from the database role. Then give your AI coding agent a restricted database user account. Teams often let AI tools use their normal local shell profiles. Those profiles usually hold admin database keys for fast testing. When a role has broad rights, one bad query can wipe out vital tables.

How windsurf cockroachdb prevent delete works

Cognition renamed Windsurf to Devin Desktop on June 2, 2026. The app keeps the same IDE features and the Cascade agent. Cascade can run terminal commands on its own after you grant permission. It opens a dedicated shell using zsh on macOS or bash on Linux. This shell loads your standard profile, including your aliases and secret variables. Cascade can also talk to Model Context Protocol servers when you set them up.

When the agent queries CockroachDB, it uses the database credentials found in your shell. CockroachDB controls actions through role-based rules on databases, schemas, and tables. To block row removal, an admin creates a role without delete or drop rights. That role can still read rows, insert new data, and update existing records. If the agent tries to remove rows, the database engine blocks the statement right away.

Managing shell profiles for AI coding agents

Because the agent loads your shell profile, it gets all your default database variables. Most developers keep high-level database credentials in their shell files for daily work. If you do not separate these keys, the agent runs with your full rights. You must create a separate database user just for the coding agent. Next, swap the connection string in the shell session before the agent starts.

This manual swap takes work and breaks when developers switch tasks fast. A developer might need to drop a test table during a local build. They log in with an admin role and forget to switch back. The next time the agent runs a terminal command, it inherits that admin session. Relying on local shell files makes it hard to keep delete blocks active.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native database roles solve and what keeps the session active

Native CockroachDB privileges do a good job of blocking broad actions per user. A role with only select and insert rights cannot delete rows from a table. It also cannot drop schemas or wipe out whole databases by mistake. This setup stops the worst mistakes when the agent uses the restricted account.

Still, static database roles only check who logs in at the start. They do not inspect what individual queries do in flight. For example, an agent often needs update rights to test app logic. With update rights, a bad query without a filter can overwrite every row. That action destroys data just like a delete command would. Static roles also cannot rewrite sensitive fields like emails, phone numbers, or card numbers in results. Finally, database logs only show the shared role name, not which prompt triggered the query.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Does Devin Desktop handle database access differently than Windsurf?

No, Devin Desktop is the new name for Windsurf as of June 2026. It uses the same IDE features and runs terminal commands in your local shell.

Can CockroachDB block delete statements while allowing updates?

Yes, CockroachDB lets you grant select, insert, and update rights without granting delete rights. You assign these specific privileges to the role that the agent uses.

Why can my coding agent still drop tables after I changed its role?

The agent loads your shell profile and may pick up old admin variables. Check that your shell does not export an admin key or give table ownership to the agent.

The query runs. The emails stay hidden.