How to Configure OpenHands Cassandra Permissions
You set up openhands cassandra permissions by making a dedicated database role for your AI agent. Then you limit that role to the specific keyspaces and tables the agent needs. Many teams skip this step and hand the agent a shared admin account. Broad roles let an autonomous coding tool drop tables or read private customer records by mistake. A strict setup keeps your data safe while the agent writes code and runs checks. How openhands cassandra permissions work in practice OpenHands runs as
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 openhands cassandra permissions by making a dedicated database role for your AI agent. Then you limit that role to the specific keyspaces and tables the agent needs. Many teams skip this step and hand the agent a shared admin account. Broad roles let an autonomous coding tool drop tables or read private customer records by mistake. A strict setup keeps your data safe while the agent writes code and runs checks.
How openhands cassandra permissions work in practice
OpenHands runs as an autonomous software engineer inside a local or cloud container sandbox. It writes scripts, runs shell commands, and queries databases to fix bugs or build features. When the agent needs to interact with Cassandra, it uses standard driver credentials from its sandbox. The database checks those credentials against its internal role manager before running any query.
To lock this down, database admins turn on password or certificate checks in the cluster settings. Next, they create a specific role just for the OpenHands agent to use. Cassandra uses role-based rules to control what that user can do inside the cluster. Admins grant read or modify rights on one test keyspace instead of the whole database. They can also restrict permissions down to single tables when the task is narrow.
Once the role is ready, the team puts the login details into the agent container. The agent reads these values from its local settings and starts a database session. Every query the agent sends must pass the role check inside Cassandra first. If the agent tries to touch another keyspace, the database blocks the action right away.
What native database roles solve and what they miss
Native roles in Cassandra are great at drawing hard lines around your keyspaces and tables. They stop an agent from reading billing tables when it only needs product catalog data. They also block schema changes if you only grant select rights to the agent role. This basic step prevents a lot of damage during routine coding tasks.
Still, native database permissions only decide who can log in and which tables they see. They do not inspect what individual queries do while the session is active. If an agent has modify rights on a table, it can still run a bad delete query. A single mistake in a script can wipe out thousands of rows in seconds.
Static roles also cannot hide private fields inside a table that the agent needs to read. When the agent queries a user table, the results include emails, phone numbers, and card numbers. Those sensitive values flow straight into the agent logs and out to the language model. Native Cassandra roles are all-or-nothing at the table level for read operations.
Cassandra Role Management + AI Agent Permissions: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Finally, storing static passwords inside the agent sandbox creates a secret management headache for your team. Because the agent can run arbitrary bash commands, it can print its own environment variables. Anyone who reads the task logs might see the plain text database password. Rotating those keys across every developer laptop and cloud runner takes hours of manual work.
Managing agent database sessions in production
Teams running AI agents against real data need finer controls than static roles provide. Start by splitting agent roles by task type rather than sharing one bot account. Give bug-triage agents read-only roles, and save write roles for isolated staging keyspaces. Audit your database role grants every week to remove leftover test permissions.
You should also track every query the agent runs and tie it to the human user. When an engineer starts an OpenHands task, your logs should show both identities clearly. Also, look for ways to rewrite sensitive fields like national IDs in query results. Filtering data in flight keeps private records out of external model prompts while keeping schemas intact.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Can OpenHands share a Cassandra role with my main backend app?
No, sharing roles between your app and an AI agent is a bad idea. Your backend app needs broad write permissions that an autonomous coding agent should not have. Always create a separate Cassandra role with minimal rights for the agent.
How do I stop OpenHands from reading sensitive customer columns in Cassandra?
Native Cassandra permissions apply to whole tables and do not mask individual columns in results. If the agent queries a customer table, it receives the emails and phone numbers inside. You need dynamic data masking in flight to rewrite those fields before the agent sees them.
Where should I store Cassandra credentials for OpenHands?
Avoid hardcoding database passwords in repo files or plain text config files inside the workspace. Pass credentials into the sandbox runtime as secret variables that clear out when the task ends. Better yet, remove static keys from the sandbox so the agent cannot leak them.
Related guides
In this post