How to Configure Gemini CLI Cassandra Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up gemini cli cassandra approval by enabling command checks in your local agent. You also assign a narrow role to the database user before the session starts. Teams often let AI tools run shell commands with wide database permissions. That mistake lets a single bad prompt drop tables or read private rows. How gemini cli cassandra approval works in practice The terminal agent reads your local project files and suggests shell commands. When it needs database data, it calls your local qu

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 gemini cli cassandra approval by enabling command checks in your local agent. You also assign a narrow role to the database user before the session starts. Teams often let AI tools run shell commands with wide database permissions. That mistake lets a single bad prompt drop tables or read private rows.

How gemini cli cassandra approval works in practice

The terminal agent reads your local project files and suggests shell commands. When it needs database data, it calls your local query tool. By default, the agent can ask for your okay before running a shell command. You read the command text on your screen and say yes or no.

Your local shell holds the login keys for the database cluster. The agent uses those same local keys when it runs the query tool. On the database side, an admin creates a role for this user. That role lists which keyspaces and tables the session can read or change. The database checks the role when the session starts and when queries run.

This two-part setup splits the check between the user and the database. The human checks the shell command inside the terminal app. The database checks the role permissions tied to the login key. Both steps must pass before any query changes data in the cluster.

Why native roles and local prompts fall short

Local prompts help catch obvious mistakes, but people get tired of reading them. After ten safe read queries, a developer often turns on auto-run mode. Once auto-run is on, the agent runs any command that the database role allows. If the role can write data, the agent can delete rows without a pause.

Static database roles also struggle with day-to-day AI tasks. A developer might need to fix one broken row during an incident. Giving their role write permissions opens up the whole table for the entire session. Native roles decide who can log in and use a table. They do not ask a teammate to approve one specific write query in flight.

Approval Chains & Escalation + Cassandra Role Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Local keys also create a risk on the developer laptop. Any tool running in that user shell can read the database login file. Also, raw query results flow straight back into the AI model context. If a table holds emails, phone numbers, or card numbers, the model gets them. Native database roles do not rewrite matched fields in results for AI tools.

How to build a safer workflow for database agents

Start by separating read tasks from write tasks in your team workflow. Give the local agent a read-only database role for normal coding work. Never store admin keys in plain text files on a developer laptop. Keep the local agent prompt check turned on for any command that writes files.

Next, require a second person to check any query that changes live data. Do not grant permanent write permissions to the account the agent uses. Instead, route live queries through a check that inspects each statement before it runs. Add data masking so the system rewrites emails and national IDs in query results. This keeps private user data out of external AI model logs.

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 the agent run database queries without asking me first?

Yes, if you turn off command prompts in your local agent settings. Always keep manual checks on when the agent uses a database tool.

Do database roles stop an AI agent from reading sensitive columns?

Standard roles usually work at the keyspace or table level. If the role can read a table, the agent gets every column in it by default.

How do we keep private data out of the AI model prompt?

Use a masking rule that rewrites phone numbers and card numbers in flight. This changes the sensitive text before the query result reaches the agent.

The query runs. The emails stay hidden.