How to Configure OpenHands DynamoDB Credentials
You set up openhands dynamodb credentials by giving the agent runtime an AWS IAM role. You can also pass cloud keys into the agent container before it starts. Engineering teams often use broad developer keys during early agent tests. Those wide permissions let an autonomous coding agent drop tables or read production items. How openhands dynamodb credentials work in AWS OpenHands runs tasks inside an isolated workspace container on your host machine. When the agent writes code or runs scripts
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 credentials by giving the agent runtime an AWS IAM role. You can also pass cloud keys into the agent container before it starts. Engineering teams often use broad developer keys during early agent tests. Those wide permissions let an autonomous coding agent drop tables or read production items.
How openhands dynamodb credentials work in AWS
OpenHands runs tasks inside an isolated workspace container on your host machine. When the agent writes code or runs scripts, it uses standard AWS software tools. Those tools look for cloud keys inside the local workspace session.
Teams have two main ways to supply these keys to the agent. The first way puts static secret keys into the workspace startup variables. The agent reads these text values every time it sends a database call. Static keys stay valid until an engineer rotates or deletes them by hand. If a prompt causes the agent to print variables, those keys leak into logs.
The second way uses temporary role sessions from your cloud provider. When OpenHands runs on cloud compute, it can assume an attached machine role. The cloud platform refreshes the short-lived token in the background for the container. Teams running the agent on laptops can mount temporary single sign-on profiles instead. Both role methods avoid saving long-term secret strings on disk.
Once the agent holds valid keys, AWS checks the attached IAM policy rules. Good policies name the exact table resources the agent is allowed to touch. You can allow item reads on a test table while blocking table deletions. You can also use condition keys to restrict calls to specific partition keys.
What native IAM roles solve and where gaps remain
Native cloud roles do a good job of proving identity at login time. They confirm which workload is calling and which broad API actions are allowed. An IAM policy can block an agent from deleting a whole table resource. It can also stop an agent from reading tables in another account.
Still, cloud role permissions do not inspect the payload of individual commands in flight. Once an agent gets item read permissions, it can scan every attribute inside that table. If those items hold emails, phone numbers, card numbers, or national IDs, the agent gets them. Data masking rewrites matched fields in results before they reach the model context.
Ephemeral Credentials + DynamoDB Fine-Grained Access: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Write permissions create another big risk during autonomous coding runs. An agent with item write rules can run a bad loop that wipes thousands of records. Cloud IAM sees each bad write as a valid, allowed API request. There is no pause step for a human to check a risky command first.
Audit trails also become hard to read when many engineers share one agent setup. Cloud logs show that the shared agent role ran a query at a certain time. They do not tie that database call back to the specific user prompt or task.
Scoping permissions for autonomous agent tasks
Start by creating a dedicated IAM role just for your OpenHands agent workloads. Never reuse a human engineer profile or a broad backend service role. Point this role at non-production tables whenever the agent writes or tests new code.
Split your agent roles by the type of work the agent needs to do. Use a read-only role when the agent only checks schemas or debugs data bugs. Switch to a tightly scoped write role only when the task requires data updates. Keep table creation and deletion permissions off the agent role at all times.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits beside the service as an open-source proxy, a sidecar for your database or API.
Before a query runs, hoop.dev guardrails check the statement against your rules. An AI Analyzer you configure can score intent or hold risky calls for human review. Next, hoop.dev data masking rewrites sensitive fields in responses, and each verdict is logged per listener. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Should I pass static AWS keys into the OpenHands container?
No, avoid static keys whenever you can. Use short-lived IAM role sessions so keys expire on their own after the task ends.
Can AWS IAM stop an agent from reading sensitive columns in a table?
IAM can restrict which attributes a query asks for if you write strict policy rules. Still, it does not mask sensitive values like emails or card numbers inside returned text fields.
How do I limit which tables the coding agent can touch?
Write an IAM policy that lists the exact resource names of your test tables. Do not use wildcard symbols in the resource block of the agent policy.
Related guides
In this post