How to Configure OpenHands Redis Read Only Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up openhands redis read only permissions by creating a restricted database user. Then you pass those specific login details into the agent runtime workspace. Many teams skip this step and hand out full admin passwords instead. Broad permissions let an automated coding agent delete keys or change live data. A single bad command from the agent can break your main app. How openhands redis read only permissions work in practice Redis uses an internal control list to manage what each user

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 read only permissions by creating a restricted database user. Then you pass those specific login details into the agent runtime workspace. Many teams skip this step and hand out full admin passwords instead. Broad permissions let an automated coding agent delete keys or change live data. A single bad command from the agent can break your main app.

How openhands redis read only permissions work in practice

Redis uses an internal control list to manage what each user can do. You define a new user profile inside the database and limit its commands. This profile allows read commands and blocks all write and delete actions. You also blocks admin tasks that might change how the server runs.

Next, you place these user details into the OpenHands workspace settings. The coding agent reads these values when it starts a new task. It uses this limited role to log in and inspect cached data. If the agent tries to change a value, the database rejects the command. The server checks the user rules before it runs any query.

What native read rules solve and what they miss

Native database roles stop the agent from altering or wiping out your cache. They also block the agent from changing server settings or dropping key spaces. This setup protects your system state when the agent tests new code. It is a solid first step for any team running automated tools.

Still, static roles only check who logs in and which command category runs. They do not inspect the actual data returned by a read command. A read role still lets the agent pull every key in the store. Cached records often hold private user details like emails, phone numbers, or card numbers. When the agent reads those keys, that private data enters the model context.

Static roles also create secret management work for your ops team. You must store a plain password inside the agent workspace settings. If a prompt flaw tricks the agent, it might print that password in logs. Also, a broad scan command can slow down a busy single-threaded cache. Native permissions decide who logs in, not how individual commands behave in flight. Teams need a way to mask sensitive fields in results and log every query.

Read-Only Root Filesystem + Redis Access Control Lists: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Steps to keep agent sessions safe

Start by scoping the user role to specific key prefixes whenever you can. Do not let the agent read key spaces that hold user session tokens. Rotate the password for the agent role on a regular schedule. Check your server logs to see which commands the agent runs most often.

You should also limit which network paths can reach the data store. Keep the cache on a private network and restrict external traffic. Combine native user rules with controls that rewrite sensitive fields in query results. This approach keeps emails and national IDs out of external model prompts.

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 runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Can OpenHands still break a cache with read only permissions?

Yes, the agent can run heavy read commands that scan millions of keys. Since the database processes commands on a single main thread, big reads cause lag. You should block expensive scan operations in the user profile.

Does a read role hide private data from the coding agent?

No, a native read role returns the full value of any allowed key. If a key holds card numbers or emails, the agent receives that raw text. You need data masking to rewrite matched fields in results before the agent reads them.

How should teams store database logins for OpenHands?

Teams should avoid putting long-lived passwords in plain text files or repo settings. Pass credentials through isolated workspace variables and rotate them after major agent runs. Even better, remove static passwords from the agent workspace completely.

The query runs. The emails stay hidden.