How to Configure OpenHands DynamoDB Read Only Permissions
You set up openhands dynamodb read only permissions by attaching a restricted IAM role. This role lets the AI agent read table items while blocking all write actions. Many engineering teams start by giving their coding agents broad cloud admin keys. That shortcut speeds up early tests, but a bad prompt can delete live data. A read-only setup keeps the agent from changing or dropping your tables. How openhands dynamodb read only permissions work in AWS OpenHands runs tasks inside a local conta
Read-Only Root Filesystem + DynamoDB Fine-Grained Access: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up openhands dynamodb read only permissions by attaching a restricted IAM role. This role lets the AI agent read table items while blocking all write actions. Many engineering teams start by giving their coding agents broad cloud admin keys. That shortcut speeds up early tests, but a bad prompt can delete live data. A read-only setup keeps the agent from changing or dropping your tables.
How openhands dynamodb read only permissions work in AWS
OpenHands runs tasks inside a local container or a remote cloud box. When the agent needs to check DynamoDB data, it uses standard AWS tools. You must give that container a valid cloud role so it can log in. Instead of pasting static secret keys, teams attach an IAM role to the host. You can also pass temporary role tokens into the agent container at startup.
Next, you build an IAM policy that grants only read actions for DynamoDB. This policy allows the agent to describe tables, get single items, and run queries. It leaves out permissions to put items, update rows, or delete tables. You should also scope this policy to specific table names and cloud regions. When OpenHands tries to write data, AWS blocks the call right away.
What native IAM roles solve and what they miss
Native IAM permissions do a great job of blocking table changes and deletions. They decide which cloud role can log in and which actions can run. This protects your database state if the AI agent writes a bad script. It also stops the agent from creating new tables that raise your cloud bill.
Still, a read-only IAM role cannot inspect what happens inside a read query. Once the role has read permissions on a DynamoDB table, it sees every field. A table often holds sensitive customer data like emails, phone numbers, and card numbers. When OpenHands queries that table, those raw values flow into the agent context window. From there, the model provider processes the data, and agent logs store it.
Read-Only Root Filesystem + DynamoDB Fine-Grained Access: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
IAM also struggles with heavy table scans that hurt live database speed. An agent with read rights can still run a full scan across millions of rows. That single command can eat up your read capacity and slow down customer apps. Cloud IAM checks who runs the action, not what the request does in flight.
Scoping agent read sessions for safer debugging
To keep live data safe, teams need controls that work at the request level. First, avoid giving the agent container permanent cloud credentials that sit on disk. Short-lived sessions reduce the risk of leaked keys inside agent workspace files. Second, limit read roles to specific non-sensitive tables whenever you can. If the agent must check live tables, plan how to handle private fields. Masking rules that rewrite emails, phone numbers, or national IDs in results help a lot. They let the agent debug schema issues while keeping private records out of prompts.
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 run full table scans with read-only permissions?
Yes, standard read-only policies allow both single item lookups and full table scans. To prevent heavy scans, you can remove scan permissions in your custom IAM policy. That forces the agent to query specific keys or indexes instead.
Should I put AWS secret keys in the OpenHands workspace?
No, storing static keys inside the workspace risks leaking them in logs or commits. Attach an IAM role to the compute host or pass short-lived session tokens instead. This ensures credentials expire soon after the agent finishes its task.
Does a read-only IAM policy hide sensitive fields in DynamoDB items?
Standard read policies apply to the whole item unless you set strict attribute conditions. Even with attribute rules, IAM blocks the whole read rather than masking single values. Rewriting fields like card numbers or emails requires filtering results in flight.
Related guides
In this post