How to Configure GitHub Copilot CockroachDB Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up github copilot cockroachdb approval by pairing editor tool checks with database roles. You also require a human check before any AI agent runs a write query. Engineering teams often connect AI coding assistants straight to their databases to speed up work. They give the agent a local database string so it can inspect tables and test queries. When that role has broad permissions, the assistant can change or delete live data by mistake. How github copilot cockroachdb approval works in

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 github copilot cockroachdb approval by pairing editor tool checks with database roles. You also require a human check before any AI agent runs a write query. Engineering teams often connect AI coding assistants straight to their databases to speed up work. They give the agent a local database string so it can inspect tables and test queries. When that role has broad permissions, the assistant can change or delete live data by mistake.

How github copilot cockroachdb approval works in practice

GitHub Copilot uses agent mode inside your code editor to run tasks for you. It reaches external systems like CockroachDB through local terminal commands or Model Context Protocol servers. When the assistant wants to run a database command, the editor shows a prompt. The developer must click to approve the action before the tool runs the command. You can also set up CockroachDB with specific roles for the assistant to use.

A safe setup starts with a read-only database user for daily coding tasks. This role lets the AI assistant read schemas and check row counts without changing data. When the assistant needs to change a table or update rows, it needs a higher role. Teams often rely on the editor prompt as their main check for these changes. The developer reads the proposed query in the chat window and decides if it is safe. If the developer approves, the local client sends the query straight to the CockroachDB cluster.

What native editor and database controls leave open

Database roles and editor prompts solve the first part of the safety problem. CockroachDB roles decide who can log in and which tables they can touch. Editor prompts make sure a human sees that a tool wants to run a command. Still, this basic setup leaves a big gap during live work. Once a user logs in with a write role, the database trusts every valid query.

Developers get tired when they see dozens of approval prompts in their editor every hour. It is easy to click approve on a shell script without reading every single line. Even a read-only query can cause trouble if it pulls raw customer records into chat. A broad select statement might return emails, phone numbers, card numbers, or national IDs. Without query-level checks and data masking, those fields go straight into the AI context window. Native database roles cannot pause a single drop statement while letting safe updates run.

Approval Chains & Escalation + GitHub Actions Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Adding statement checks and data masking for AI queries

To close this gap, teams need to check each SQL statement while it runs. Instead of trusting an entire database session, you should check the exact command inside it. Read queries can run right away so the coding assistant stays fast and helpful. When the assistant sends an update or schema change, the system should pause that single query. A peer or team lead can then review the exact SQL text in chat.

At the same time, field-level masking can rewrite matched fields in results before they return. If a query pulls emails or card numbers, the mask swaps them for safe placeholders. The assistant still gets the row shape it needs to write and test code. Your team gets clear logs of every query the AI agent tried to run.

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

Can GitHub Copilot run CockroachDB queries on its own?

Yes, when you give it terminal tools or a database server in agent mode. By default, the editor asks the user to approve tool calls before they run. If a user turns on auto-approve settings, the agent can run queries without pausing.

Why is a read-only CockroachDB role not enough for AI agents?

A read-only role stops the agent from deleting tables or changing rows. Still, it still lets the agent read sensitive columns like phone numbers or national IDs. It also blocks the agent when you actually want help running a safe schema change.

How do teams approve only risky queries from an AI assistant?

Teams split read tasks from write tasks at the query level instead of the login level. Safe select statements run right away with masking turned on for sensitive fields. Commands that change data or schemas wait for a human to approve them in Slack.

The query runs. The emails stay hidden.