How to Configure OpenHands DynamoDB Permissions
You set up openhands dynamodb permissions by assigning a scoped AWS role to your agent container. Then you limit that role to the exact tables and actions your task needs. Many teams give coding agents a wide admin key to save time during setup. That broad role lets the agent change or delete tables across your whole account. A narrow role stops the agent from touching outside tables by mistake. How openhands dynamodb permissions work in AWS OpenHands runs inside a local container or a remote
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 dynamodb permissions by assigning a scoped AWS role to your agent container. Then you limit that role to the exact tables and actions your task needs. Many teams give coding agents a wide admin key to save time during setup. That broad role lets the agent change or delete tables across your whole account. A narrow role stops the agent from touching outside tables by mistake.
How openhands dynamodb permissions work in AWS
OpenHands runs inside a local container or a remote cloud box to write code. When the agent tests code or checks data, it uses the AWS SDK. The SDK looks for cloud keys inside the container to log in the DynamoDB session. If you put static keys in the box, the agent uses them for every run.
A safer way is to attach a cloud role to the host machine. The host gives short-term keys to the agent container when a task starts. In AWS, you attach a policy document to that role. This policy lists which DynamoDB tables the role can read or update.
You can scope the policy down to specific actions like reading items or querying indexes. You can also block table drops and schema changes in the policy rules. The cloud provider checks these rules every time the agent sends a request. If the agent tries a blocked action, AWS rejects the call right away.
What native cloud roles solve and what they miss
Native cloud roles are great at deciding which machine can log in. They also stop an agent from touching tables that belong to other teams. If you separate test tables from live tables, roles keep the agent in its lane. This setup gives you a strong first boundary in your cloud account.
Still, a cloud role only checks the table name and the API action type. Once the role allows a read action on a table, the agent gets full items back. DynamoDB tables often store customer emails, phone numbers, card numbers, or national IDs. A native role will not rewrite those fields in the query results.
When the agent reads a record, that raw data goes into the model prompt. It also lands in agent chat logs and debug files on the host. Also, a role that allows item deletes on a table allows deleting every item. Cloud roles do not stop a bad loop from wiping out a whole table. They also do not ask a human for approval before a single risky write runs.
DynamoDB Fine-Grained Access + AI Agent Permissions: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Scoping agent roles for safer table tasks
Start by creating a dedicated role just for your OpenHands tasks. Never reuse a developer key or a shared app role for an AI agent. Point the role policy at specific table names instead of using wildcards. Split your permissions into a read-only role and a separate write role.
Use the read-only role for bug hunts, log checks, and schema reviews. Only switch to the write role when the agent must test data changes. Set a short time limit on role sessions so old tokens expire fast. Turn on cloud audit logs to track which API calls the agent role makes.
Even with tight roles, you should watch what happens inside each session. Cloud logs show that a query ran, but they miss the agent prompt context. Teams need a way to inspect commands in flight and mask sensitive fields in results.
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
Should I put AWS keys in my OpenHands config file?
No, avoid putting static keys in text files or container settings. Attach an AWS role to the host or container task so tokens rotate on their own.
How do I stop OpenHands from deleting DynamoDB tables?
Remove table deletion and schema change actions from the AWS role policy. Or add an explicit deny rule for table drops on all resources.
Can AWS roles hide sensitive fields inside a DynamoDB item?
AWS policies can hide whole attributes by name if you list every key. They do not scan text values to rewrite emails, phone numbers, or card numbers.
Related guides
In this post