How to Configure OpenHands Redis Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up openhands redis permissions by creating dedicated database users with scoped rules. You then give those specific login credentials to your agent runtime. Engineering teams often use the default database admin user during early testing. This broad role lets an autonomous coding agent run any command against the cache. A single bad prompt or agent mistake can wipe keys or expose sensitive records. How openhands redis permissions work in practice OpenHands runs as an autonomous coding

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 redis permissions by creating dedicated database users with scoped rules. You then give those specific login credentials to your agent runtime. Engineering teams often use the default database admin user during early testing. This broad role lets an autonomous coding agent run any command against the cache. A single bad prompt or agent mistake can wipe keys or expose sensitive records.

How openhands redis permissions work in practice

OpenHands runs as an autonomous coding agent that executes tasks inside a sandbox. During a task, the agent might need to inspect cache state or test app logic. Redis manages user roles through its native user control list system. Admins define a specific user profile for the OpenHands agent inside the database.

This profile lists the exact command groups and key patterns the agent may use. For example, you can allow read commands while blocking admin or flush operations. You can also limit the agent to keys that start with a specific test prefix. When the OpenHands workspace starts, it reads the assigned username and password from its store.

The agent authenticates its session with the Redis server using those scoped credentials. The database checks every incoming command against the user profile before running it. If the agent tries to run a blocked command, the database rejects the request right away.

What native roles solve and where gaps remain

Native Redis user rules do a great job of blocking broad command categories. They stop an agent from running server administration commands or deleting whole keyspaces. They also separate agent traffic from production app traffic at the user level. Still, static database permissions only check who logs in and which command type runs.

They do not inspect the actual data payloads returning from permitted keys. If an agent has read permissions on a key pattern, it reads the full value. Those values often hold user session objects containing emails, phone numbers, or card numbers. Static database roles cannot rewrite matched fields in results to hide those sensitive strings.

Redis Access Control Lists + AI Agent Permissions: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Static roles also stay active for the entire life of the credential. If an OpenHands agent needs temporary write permissions to fix a bug, someone must edit the user rule. Teams often forget to revoke those extra write rules after the task ends. Also, standard database logs rarely link a specific command back to the developer who triggered the agent.

Best practices for scoping agent cache sessions

Start by creating a read-only user role for all default OpenHands agent tasks. Block dangerous commands that scan the whole keyspace or pause the server thread. Restrict the agent user to a dedicated key prefix that holds only synthetic or non-sensitive data.

Never share database credentials between your production services and your autonomous coding agents. Rotate the agent password often and remove write permissions as soon as debugging finishes. Keep a clear audit trail of which human operator starts each agent session. Also review how sensitive fields like national IDs or emails appear inside cached payloads.

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

Why should OpenHands use a separate Redis user?

A separate user stops an autonomous agent from running destructive admin commands. It also keeps agent test workloads away from your main app keys.

Can native Redis rules mask sensitive data inside a key?

No, native Redis permissions only allow or block permissions the key itself. If the user can read the key, the server returns the full stored value.

Which Redis commands should you block for coding agents?

You should block server control commands, bulk deletion commands, and blocking keyspace scans. Allow only simple read and write operations on safe key prefixes.

The query runs. The emails stay hidden.