How to Configure OpenHands Cassandra Permissions
You set up openhands cassandra permissions by creating a narrow database role for the agent. Then you pass those role keys into the agent runtime container. Most teams start by giving their coding agent a broad admin role. They do this so the agent can test schemas and fix bugs fast. Broad roles let an autonomous agent drop keyspaces or read private user tables by mistake. How openhands cassandra permissions work in practice OpenHands runs tasks inside an isolated workspace container. The age
Cassandra Role Management + AI Agent Permissions: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up openhands cassandra permissions by creating a narrow database role for the agent. Then you pass those role keys into the agent runtime container. Most teams start by giving their coding agent a broad admin role. They do this so the agent can test schemas and fix bugs fast. Broad roles let an autonomous agent drop keyspaces or read private user tables by mistake.
How openhands cassandra permissions work in practice
OpenHands runs tasks inside an isolated workspace container. The agent writes scripts and runs shell commands inside this workspace. When the agent needs database records, it uses standard driver credentials from the workspace. You control what the agent can do through native Cassandra permissions.
Cassandra manages security through role-based rules. Database admins create a specific role for the OpenHands agent. You can scope this role to a single keyspace or one specific table. For read tasks, you grant only the select rule on permissions tables. For schema work, you grant modify or alter rules on a test keyspace. You also turn off superuser status and login privileges on other system roles.
Once the role is ready, you place the username and password into the agent workspace. The agent reads these values and opens a database session. Cassandra checks the role rules before it runs any query from the agent.
What native database roles solve and what they miss
Native Cassandra permissions do a good job of blocking unauthorized keyspaces. A read-only role stops the agent from deleting rows or dropping tables. It also keeps the agent out of system tables that hold cluster settings. This baseline setup stops many simple agent mistakes before they cause outages.
Still, static database roles only decide who can log in and which tables they touch. They do not inspect what individual statements do in flight. If an agent has select rights on a customer table, it can pull every row. Native roles will not rewrite sensitive fields like emails, phone numbers, or card numbers. The raw values go straight into the agent context window and model logs.
Cassandra Role Management + AI Agent Permissions: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Static keys inside the agent container also create a second risk. Because the agent can run shell commands, it can read its own local variables. A bad prompt or a coding loop might print those database keys into build logs. Also, if an agent needs temporary write rights, an admin must edit the role by hand.
Steps to harden agent database sessions
Start by separating your agent workloads from production data whenever you can. Point the OpenHands workspace at a staging keyspace with synthetic rows. If the agent must read real tables, build a dedicated role with select rights only. Never share human admin credentials with an automated coding container.
Next, limit network paths so only the agent workspace can reach the database port. Rotate the agent role password on a set schedule to limit key exposure. Review database audit logs often to see which queries the agent sends during each task. Look for large table scans or failed permission checks that show the agent is stuck.
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 OpenHands share a Cassandra role with other backend apps?
No, you should always make a separate role just for the OpenHands agent. Sharing roles makes it hard to track which queries came from the AI agent. A dedicated role also lets you revoke agent rights without breaking your main app.
How do I stop the agent from reading private user columns?
Native Cassandra permissions apply at the keyspace or table level, not on single columns. To hide columns natively, you must move private fields into a separate restricted table. You can also use a data masking rule that rewrites emails and phone numbers in query results.
What permissions does OpenHands need to test schema migrations?
Give the agent create, alter, and drop rules on a dedicated staging keyspace only. Never grant schema modification rules to an autonomous agent on a live production keyspace. Once the agent finishes testing the migration script, revoke those write rules right away.
Related guides
In this post