How to Configure OpenHands Redis Credentials

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up openhands redis credentials by creating a scoped user in your cache engine. Then you pass those login details to your agent runtime through secret variables. Most teams start by sharing one root password across all agent workers. That shortcut gives every agent full power to read or wipe all stored keys. A safer setup pairs role rules with strict command limits. How openhands redis credentials work in agent workflows OpenHands runs AI agents that write code, run commands, and manag

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 credentials by creating a scoped user in your cache engine. Then you pass those login details to your agent runtime through secret variables. Most teams start by sharing one root password across all agent workers. That shortcut gives every agent full power to read or wipe all stored keys. A safer setup pairs role rules with strict command limits.

How openhands redis credentials work in agent workflows

OpenHands runs AI agents that write code, run commands, and manage task state. When you run multiple agent sessions, the app needs fast storage for session data. Teams often use a Redis cluster to hold queue jobs and active session state. The agent backend reads your secret variables at startup to log in.

A clean setup starts inside the Redis role list. Instead of the default admin account, you create a dedicated role for the agent app. This role only allows the commands that the app needs to read and write state. You also limit the role to a single key prefix for that specific app.

Next, you turn on TLS so login secrets and session payloads stays encrypted in transit. You store the user name, password, and host address in your secret manager. The container runtime reads those values when the worker starts up. Each worker logs in with the same scoped role and writes to its allowed prefix.

Why scoped roles and secret rotation matter

AI coding agents run inside sandboxes, but the main backend coordinates their work. If an agent task goes wrong, broad permissions can put shared state at risk. A default Redis account can flush the whole database or change server settings. It can also read keys that belong to other apps on the same cluster.

By restricting openhands redis credentials to one key prefix, you isolate the agent state. You should also block risky admin commands in the role rules. Even if a worker sends a bad command, the cache server will reject it. Regular secret rotation reduces risk further by expiring old passwords on a set schedule.

Teams should also separate dev and prod agent pools onto different role rules. A dev agent should never hold the keys to a prod state store. Separate roles make it easy to revoke one credential without breaking other teams.

Ephemeral Credentials + Redis Access Control Lists: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Where native role rules fall short at runtime

Native role rules and secret managers solve the startup login problem well. They verify who can log in and which key prefixes that role can touch. Still, static credentials stay active for as long as the worker container runs. If an engineer or agent inspects the worker runtime, those raw secrets sit in memory.

Role rules also operate at the command category and key prefix level. They do not inspect the payload inside a read or write command in flight. If session state holds sensitive data like emails or card numbers, the cache stores it raw. Anyone with read permissions on that prefix receives the full, unmasked values in their results.

Finally, native cache logs rarely link a single command back to a specific human user. Every worker uses the same shared app role to run commands. When an incident happens, audit logs show the shared app account rather than the person who started the job. Teams need runtime controls that inspect commands in flight and mask sensitive fields in results.

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

Where should I store openhands redis credentials for container deployments?

Store your user name and password in a dedicated secret manager or encrypted runtime store. Never hardcode passwords in compose files, source code, or plain text config files.

Which commands should I block on the Redis role for OpenHands?

Block all server admin and destructive commands on the agent role. The agent backend only needs basic read, write, list, and hash commands on its own key prefix.

How often should teams rotate Redis passwords for AI agents?

Rotate static passwords at least every thirty to ninety days, or right after any team change. Better yet, remove static passwords from worker nodes so agents never hold long-lived secrets.

The query runs. The emails stay hidden.