How to Configure OpenHands Redshift Read Only Access
You set up openhands redshift read only access by creating a restricted database user. Then you pass those login keys to the agent workspace. Many teams start by giving AI agents their own admin database keys. Broad permissions let an autonomous coding tool change tables or delete rows by mistake. A strict read role stops the agent from changing data while it writes code. How openhands redshift read only access works in practice OpenHands runs in a container where it writes code and runs term
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 redshift read only access by creating a restricted database user. Then you pass those login keys to the agent workspace. Many teams start by giving AI agents their own admin database keys. Broad permissions let an autonomous coding tool change tables or delete rows by mistake. A strict read role stops the agent from changing data while it writes code.
How openhands redshift read only access works in practice
OpenHands runs in a container where it writes code and runs terminal commands. When the agent needs data context, it opens a session to your data warehouse. To keep data safe, you first build a dedicated read group inside the warehouse. You grant this group permission to view target schemas and read current tables. You also set default privileges so the group can read future tables too.
Next, you create a specific database user for the AI agent. You assign this user to your new read-only group. Then you place the host address, user name, and password into the agent workspace. The agent reads these values from its local variables when it runs scripts. When the agent sends a query, the warehouse checks the role rules first. If the agent tries to drop a table, the database blocks the action.
What native database roles solve and what they miss
Native database roles are great for stopping direct writes and table drops. They set a hard boundary at the warehouse level for the whole session. Once you set up the role, the agent cannot alter schemas or delete rows. This protects your core business tables from bad code or false agent commands.
Still, database roles only decide who logs in and which tables they can read. They do not inspect what individual queries do in flight during a session. A read-only role still lets the agent pull millions of rows at once. If a table holds emails, phone numbers, or card numbers, the agent reads them. The raw sensitive values flow straight into the agent logs and model prompts. Native roles also require you to store static passwords inside the agent container. Anyone who can read the container workspace can take those database keys.
Auditor Read-Only Access + Customer Support Access to Production: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Managing agent queries and sensitive data in flight
Giving an AI tool full read rights to a schema is often too broad. Agents do not know which columns hold private user records or national IDs. When the agent explores a table, it often runs a broad select query. That query pulls raw customer records into the external language model context window.
Database admins can build custom views to hide private columns from the agent user. Yet building and updating views for every table takes a lot of team time. Schema changes break views, and teams must fix them by hand each week. Teams need a way to rewrite sensitive fields in query results on the fly. When data masking rewrites matched fields in results, the agent still sees the schema. It can test its queries while emails and card numbers stay hidden.
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 still drop tables if it uses a read-only database role?
No, the data warehouse blocks any write, update, or drop command from that user. The database engine checks the role rules before it runs the SQL statement.
Does a read-only role hide customer emails and phone numbers from the agent?
No, a standard read role returns all columns in the allowed tables by default. Unless you mask results or build custom views, the agent reads raw emails and phone numbers.
Why is storing database passwords in the agent container a risk?
The agent has full access to its own workspace and terminal. A bad prompt or buggy script could print those static keys into external logs.
Related guides
In this post