How to Configure Goose CockroachDB Approval
You set up a goose cockroachdb approval flow by pairing local agent prompts with database roles. This requires a human check before any tool runs a query against your cluster. Most engineering teams start by giving the AI agent a standard database user account. They rely on local terminal prompts to pause the agent before it runs a command. When those database roles are too broad, a single bad approval can drop critical tables. Teams need clear boundaries between what the agent suggests and what
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 a goose cockroachdb approval flow by pairing local agent prompts with database roles. This requires a human check before any tool runs a query against your cluster. Most engineering teams start by giving the AI agent a standard database user account. They rely on local terminal prompts to pause the agent before it runs a command. When those database roles are too broad, a single bad approval can drop critical tables. Teams need clear boundaries between what the agent suggests and what the database allows.
How native goose cockroachdb approval works
Goose runs on a developer machine as a local AI agent. It reads local files, plans tasks, and runs shell commands or database queries. To talk to CockroachDB, the agent uses standard database drivers or command line tools. You can set up the agent to ask the user before running any tool. When the agent wants to query CockroachDB, it pauses and shows the planned command. The developer reads the SQL text on their screen and clicks approve or deny.
On the database side, CockroachDB manages access through role-based access control. Admins create specific roles and grant them privileges on databases, schemas, or tables. The developer logs in using a client certificate or a password tied to a role. Once logged in, the agent inherits every permission granted to that user role. CockroachDB checks the role privileges when the query arrives and then runs the statement. This two-part setup combines local user checks with database role rules.
Where native database roles fall short
Native roles and local prompts solve basic access control for small projects. CockroachDB roles stop unauthorized users from logging into the cluster at all. Local agent prompts stop the AI from running commands in the background without notice. Together, they keep casual mistakes from hitting production data during simple tasks.
Still, this native setup leaves a major gap during active sessions. Database roles decide who can log in and which tables they can touch. They do not inspect what individual statements do in flight once the session starts. If a role can update a table, it can update one row or every row by default. Local prompts also rely on the person running the agent to review every query. A developer cannot approve their own high-risk production changes for audit reasons. Also, local prompts do not create a central audit log for the security team. When an agent queries tables with phone numbers or card numbers, raw values return directly. Native database roles do not rewrite matched fields in query results for the agent.
Approval Chains & Escalation + End-to-End Encryption: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Planning a safer approval workflow
A strong approval setup separates the person asking for access from the reviewer. Instead of local terminal clicks, teams route sensitive queries to a central team chat. Peer reviewers can read the exact SQL statement before it touches the database. They check the query scope and approve or reject the request from their chat app.
Teams should also separate read actions from write actions across all database sessions. Agents often need to read schema details or sample rows to plan a fix. Giving them read access with field masking keeps emails and national IDs safe. When the agent needs to write data or change a schema, it triggers a review. This keeps daily work fast while guarding production tables from bad agent commands.
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 runs beside each supported service as an open-source proxy, a sidecar for your database or API.
First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.
Frequently asked questions
Can CockroachDB pause a single query for human approval on its own?
No, CockroachDB evaluates role grants right away when a statement arrives. It either runs the query or rejects it based on existing table permissions.
Why are local agent prompts not enough for production databases?
Local prompts let the person running the agent approve their own database commands. They do not enforce peer review or store central logs for security audits.
How should teams handle sensitive data when Goose queries CockroachDB?
Teams should apply data masking to rewrite emails, phone numbers, and card numbers in results. This lets the agent debug issues while keeping sensitive values out of model prompts.
Related guides
In this post