How to Configure OpenHands Redshift Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up openhands redshift approval by adding human checks before the agent runs SQL queries. You also restrict the database role so the agent holds only minimal read permissions. Many engineering teams start by giving their coding agent a standard developer database user. This wide role lets the agent drop tables or read private rows by mistake. A clear approval step stops risky commands before they reach your data warehouse. How openhands redshift approval works in practice OpenHands run

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 approval by adding human checks before the agent runs SQL queries. You also restrict the database role so the agent holds only minimal read permissions. Many engineering teams start by giving their coding agent a standard developer database user. This wide role lets the agent drop tables or read private rows by mistake. A clear approval step stops risky commands before they reach your data warehouse.

How openhands redshift approval works in practice

OpenHands runs as an autonomous coding agent inside an isolated container workspace. The agent writes code, runs shell commands, and queries databases to finish tasks. When the agent needs data from Amazon Redshift, it builds a SQL query string. You can set up the agent runtime to pause before running shell or database tools. This pause asks a human operator to check the exact command text first.

On the database side, admins set up a dedicated Redshift role for the agent. This role grants read permissions only on specific schemas and safe views. You should never share a human admin key with an automated container. Instead, teams pass scoped database credentials into the agent workspace at startup. The agent logs in with that role and waits for the user to approve actions.

What native controls solve and where gaps remain

Native database roles and agent pause prompts solve the basic login problem. Redshift role rules decide which tables and schemas the agent can read or change. The agent prompt lets a developer reject obvious mistakes in the terminal window. Together, these two steps stop an agent from wiping out a production schema.

Still, native database roles only check who logs in at the start. They do not inspect what each individual SQL statement does in flight. Once a role has read access to a table, every query returns full rows. A valid select query can still pull thousands of customer emails or phone numbers. Also, local terminal prompts depend on the operator watching the screen all day. Teams cannot route those local prompts to Slack or central audit logs by default. If an engineer turns off the local pause setting, the database accepts every query.

Approval Chains & Escalation + Redshift Security: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Why query-level checks matter for AI agents

Coding agents generate new queries based on the task prompt and table structure. Even a read-only query can lock large tables or expose sensitive customer data. Teams need a way to review single statements when an agent queries critical tables. They also need data masking that rewrites emails and card numbers in query results. Separating query approval from the agent container keeps rules consistent across every developer machine. Central logs then show who approved a query and what the database returned.

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 query Amazon Redshift without full admin rights?

Yes, you should create a dedicated database user with read-only schema permissions. This limits what the agent can touch even if a bad query runs.

Why are Redshift roles not enough for AI agent safety?

Database roles apply to the whole session after the user logs in. They cannot pause a single risky query or rewrite phone numbers in results.

What queries should require human approval from an agent?

Require human review for any statement that alters schemas, deletes rows, or reads sensitive tables. Simple read queries on public test tables can run without a manual pause.

The query runs. The emails stay hidden.