How to Configure Goose DynamoDB Credentials
To set up goose dynamodb credentials, assign a narrow AWS IAM role to your local session. The agent reads your active shell keys to log in with the database service. Many teams start by placing long-lived root keys in local text files. This practice gives an automated tool full control over every table in your account. If the agent makes a mistake, it can wipe out production items in seconds. How goose dynamodb credentials work in AWS Goose runs on your machine and uses your local shell varia
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.
To set up goose dynamodb credentials, assign a narrow AWS IAM role to your local session. The agent reads your active shell keys to log in with the database service. Many teams start by placing long-lived root keys in local text files. This practice gives an automated tool full control over every table in your account. If the agent makes a mistake, it can wipe out production items in seconds.
How goose dynamodb credentials work in AWS
Goose runs on your machine and uses your local shell variables to run tasks. When the agent needs database items, it uses the standard AWS credential chain. It checks your shell variables, local profile files, and single sign-on tokens. The AWS identity system checks these keys against the attached IAM policy rules.
To keep this setup safe, you must build a custom IAM role first. This role should grant only the specific actions the agent needs for its job. For example, allow read actions on one specific table instead of the whole account. Next, require engineers to log in through your company identity provider before starting work. This login flow creates temporary session tokens on the engineer's laptop. Goose picks up those short-lived tokens when it runs database scripts or CLI tools. When the session timer ends, the keys expire and stop working right away. You never have to store static secret keys in plain text files.
What native IAM roles solve and what they miss
Native IAM roles solve the basic problem of who can log in. They also stop an agent from touching tables outside its assigned project scope. Using short-lived tokens from single sign-on lowers the risk of stolen laptop keys. Your security team can also view basic API calls inside AWS CloudTrail logs. This setup is a strong first step for any team using AI agents.
Still, cloud IAM rules only check permissions at the action and table level. Once an agent has permission to scan or update a table, IAM steps back. The cloud role cannot check the exact request payload while it runs in flight. A single bad prompt could tell the agent to delete thousands of live rows. If the IAM role allows item deletion, the database will run every single command. Also, native IAM does not rewrite sensitive fields inside the returned item results. If a table holds emails, phone numbers, card numbers, or national IDs, raw values return. The agent reads those raw values and sends them straight to the language model. Finally, CloudTrail logs the API call but misses the agent prompt that caused it.
Ephemeral Credentials + DynamoDB Fine-Grained Access: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Best practices for safer agent database sessions
Teams should separate read tasks from write tasks when setting up agent roles. Give the agent a read-only role for daily debugging and data checks. Require a separate human step whenever the agent wants to change or delete items. You should also scope IAM policy rules down to exact table resource names. Never use wildcard stars in your resource blocks for agent roles.
Masking sensitive fields is another vital step for safe AI workflows. Masking rewrites matched fields in results before the agent processes the output. This step keeps card numbers and national IDs out of external model logs. Teams also need clear audit logs that link every query to a specific user.
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 static AWS keys in my Goose settings file?
No, never store static AWS keys in local text files. Use temporary session tokens from your single sign-on tool instead so keys expire fast.
Can AWS IAM stop Goose from reading specific sensitive attributes?
IAM can block specific attribute names using fine-grained policy rules. Still, it cannot rewrite or mask emails or card numbers inside allowed attributes.
How do I limit what tables the agent can change?
Create a dedicated IAM role that lists the exact table resource names. Grant read-only actions by default and block delete or table drop actions.
Related guides
In this post