How to Configure OpenHands CockroachDB Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up openhands cockroachdb approval, combine agent action pauses with database roles. This step forces a human to check risky database queries before they run. Engineering teams often give coding agents broad database credentials to speed up work. Broad permissions let an autonomous agent change schemas or delete production rows by mistake. Setting up strict review steps keeps your distributed data safe during automated tasks. How openhands cockroachdb approval works in practice OpenHand

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 openhands cockroachdb approval, combine agent action pauses with database roles. This step forces a human to check risky database queries before they run. Engineering teams often give coding agents broad database credentials to speed up work. Broad permissions let an autonomous agent change schemas or delete production rows by mistake. Setting up strict review steps keeps your distributed data safe during automated tasks.

How openhands cockroachdb approval works in practice

OpenHands runs as an autonomous coding agent inside a local or remote container. It writes code, runs shell commands, and talks to databases to finish tasks. You can set up the agent to pause before it runs terminal commands. This confirmation mode makes the agent wait for a human to click approve.

On the database side, CockroachDB uses role-based rules to control user actions. Database admins create specific roles that limit who can read or change tables. You assign these roles to the database user that the agent uses. If the agent tries to run a blocked command, the database rejects it.

Teams link these two systems by giving the agent a restricted database user. For daily read tasks, the agent queries the database without waiting for help. When the agent needs to write data, it asks a developer for help. The developer reads the proposed query in the agent interface and approves it. In some setups, the developer must switch the database role for that session.

What native controls solve and where gaps remain

Native database roles and agent confirmation prompts stop many common mistakes right away. Database grants keep an agent from dropping tables if it lacks admin rights. Agent prompts let developers stop bad shell scripts before they touch the network. Together, they build a basic wall between autonomous code and your core data.

Still, static roles and local agent prompts leave big gaps in daily work. Database roles only check who logs in, not what a specific query does. If an agent needs write rights for one row, it gets table-wide rights. That single grant lets the agent update or delete thousands of rows at once.

Agent confirmation prompts also struggle when they check database work at the shell. The agent only sees the outer shell command, not the inner SQL statements. If the agent runs a migration script, the human only approves the script name. The reviewer does not see the exact queries going over the wire.

Approval Chains & Escalation + End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Static database passwords also sit inside the agent container as plain text variables. Any script running in that container can read those keys and use them. Plus, local agent logs do not tie into central team chat apps well. Developers must watch the agent screen all day to approve simple database writes.

Why query-level checks matter for distributed databases

CockroachDB spreads data across many nodes to keep apps running during hardware failures. A bad update or heavy full-table scan can slow down the whole cluster. Autonomous agents often write queries that work on small test tables but fail at scale. They might lock too many rows or read sensitive user fields by mistake.

When teams review each statement in flight, they catch these issues early. A reviewer can check the exact SQL text before the cluster runs it. Teams also need a way to mask fields like emails or phone numbers. Rewriting matched fields in query results keeps sensitive data out of agent prompts. This step protects customer privacy while the agent debugs live app issues.

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 runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values 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

Can CockroachDB pause a single query for human approval on its own?

No, CockroachDB checks user roles right away and either runs or blocks queries. It does not have a built-in queue to hold queries for human review.

Does OpenHands inspect SQL statements inside application scripts?

No, the built-in confirmation mode only pauses before running a terminal command. It cannot parse or hold individual database queries hidden inside a script file.

How should we handle sensitive data when an agent queries CockroachDB?

Give the agent read-only roles on safe tables and mask sensitive fields in results. Rewriting card numbers and national IDs in results stops leaks into model logs.

The query runs. The emails stay hidden.