How to Configure OpenHands Redshift Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up openhands redshift permissions by creating a scoped database role. Then you pass those login details into the agent runtime container. Most teams start by giving the agent a broad admin role to test tasks. This shortcut creates risk because an autonomous agent can run destructive queries or read private data. A safer setup limits the agent to specific schemas and tables from day one. How openhands redshift permissions work in practice OpenHands runs as an autonomous coding agent in

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 permissions by creating a scoped database role. Then you pass those login details into the agent runtime container. Most teams start by giving the agent a broad admin role to test tasks. This shortcut creates risk because an autonomous agent can run destructive queries or read private data. A safer setup limits the agent to specific schemas and tables from day one.

How openhands redshift permissions work in practice

OpenHands runs as an autonomous coding agent inside an isolated container. When the agent needs to check data, it uses standard database drivers. You pass the database host, user, and secret key into the container workspace. The agent reads these values and opens a direct session to your cluster.

Inside the data warehouse, role rules control what that user can do. You create a dedicated database group or role just for the AI agent. Next, you grant usage rights on specific schemas to that new role. You then allow the role to read only the tables needed for the task.

If the agent must write data, you create a separate scratch schema. You grant table creation and write rules only inside that safe workspace. You also turn off access to system catalogs and user management tables. This basic flow keeps the agent away from core production tables.

What native database roles solve and what they miss

Native database roles do a good job of blocking unauthorized schema access. They decide which user can log in and which tables they can read. If the agent tries to drop a locked table, the database blocks it. Role rules also help you group rights by project or team.

Still, static roles leave a large gap during live agent runs. A role decides who logs in, not what each query does in flight. Once the agent has read rights on a table, it can pull every row. If that table holds emails, phone numbers, or card numbers, the agent gets them.

Static credentials also sit inside the agent container as plain text values. Because OpenHands can run shell commands, a bad prompt might print those keys. Native database roles cannot hide secret keys from the local container workspace. They also cannot pause a risky query and ask a human for approval.

Redshift Security + AI Agent Permissions: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Scoping agent workloads for safer data operations

To reduce risk, teams break agent database tasks into smaller pieces. Instead of one shared role, you can create separate roles per task type. A reporting task gets a role that only reads summary views. A pipeline test gets a role that only sees fake sample rows.

You should also set query timeouts and workload limits on the agent user. If the agent writes a bad join, the database kills the slow query. This stops a rogue coding loop from using up all your cluster compute. Pairing strict role scopes with query limits keeps your warehouse stable.

Even with tight roles, teams still need visibility into every single statement. Standard database logs often bury agent queries among thousands of other app queries. Separating agent traffic makes it much easier to review what the model did.

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

Should OpenHands use a personal engineer account for database tasks?

No, you should never give an AI agent a personal engineer login. Create a dedicated machine user so you can track and limit its queries.

How do we stop the agent from reading customer PII in tables?

Native roles block whole tables or columns, while data masking rewrites matched fields in results. Masking lets the agent query tables while hiding emails, phone numbers, or national IDs.

What happens if the agent writes a query that locks a table?

You can assign the agent user to a workload queue with short timeouts. The database will cancel any query that runs past your time limit.

The query runs. The emails stay hidden.