<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/secure-aws-credentials-for-claude-code-and-other-coding-agents-k6lqcfsib" -->

---
title: Secure AWS credentials for Claude Code and other coding...
description: Running 'aws sso login' before 'claude' gives the coding agent access to every AWS role your SSO session can assume, including AdministratorAccess. The...
canonical: https://daily.dev/posts/secure-aws-credentials-for-claude-code-and-other-coding-agents-k6lqcfsib
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Secure AWS credentials for Claude Code and other coding agents | daily.dev
og:description: Running 'aws sso login' before 'claude' gives the coding agent access to every AWS role your SSO session can assume, including AdministratorAccess. The...
og:url: https://daily.dev/posts/secure-aws-credentials-for-claude-code-and-other-coding-agents-k6lqcfsib
og:image: https://api.daily.dev/og/posts/k6LqcfsIB.png
og:image:alt: Secure AWS credentials for Claude Code and other coding agents
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Secure AWS credentials for Claude Code and other coding agents

**[cloudonaut](https://daily.dev/sources/cloudonaut)** · 9 min read · 0 upvotes · 0 comments

## Summary

Running 'aws sso login' before 'claude' gives the coding agent access to every AWS role your SSO session can assume, including AdministratorAccess. The sbx-aws-developer tool fixes this by running agents in Docker Sandboxes and feeding them only temporary, least-privilege credentials from a host-side broker. The broker refreshes credentials every minute via 'aws configure export-credentials' and writes them read-only into the sandbox; the agent never sees '~/.aws' or the SSO session itself. Credentials last as long as the permission set's session duration, one hour by default and up to twelve. It requires sbx 0.45+ (tested on 0.54) and Docker.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://cloudonaut.io/secure-aws-credentials-for-claude-code-and-coding-agents>

## Questions this post answers

### How do I give Claude Code access to AWS without exposing my SSO session credentials?

Run Claude Code inside a Docker Sandbox and use a host-side credentials broker that hands it temporary, least-privilege AWS credentials instead of mounting '~/.aws' directly. The sbx-aws-developer broker runs 'aws configure export-credentials' every minute per profile, writing fresh credentials to a read-only mount at '/mnt/aws-credentials', so the agent never sees the real SSO session.

_Developers isolating AI agents from AWS secrets can track setups like this one on daily.dev._

### Why can't a proxy just inject AWS credentials into a coding agent's sandboxed requests?

AWS doesn't use a static API key header; each request is signed with Signature Version 4, and the signature covers the request itself, so a proxy cannot inject it afterward. That's why Docker Sandboxes' usual approach of overwriting an auth header fails for AWS, requiring instead a broker that hands the sandbox temporary credentials so the agent signs its own requests.

_Anyone designing secret-injection proxies for AI agents can follow AWS-specific gotchas like this on daily.dev._

### How long do temporary AWS credentials issued to a sandboxed coding agent remain valid?

They last as long as the session duration configured on the IAM Identity Center permission set, one hour by default and up to twelve hours maximum. Stopping the credentials broker does not revoke credentials an agent already copied; they stay valid until they expire, so permission sets with a short session duration are recommended.

_Teams tuning session duration for agent credentials can keep up with practices like this via daily.dev._

## Similar posts on daily.dev

- [A better way to limit Claude Code \(and other coding agents\!\) access to Secrets – blog](https://daily.dev/posts/a-better-way-to-limit-claude-code-and-other-coding-agents-access-to-secrets-blog-yu0vomcjx) · Hacker News · 1 upvotes · 0 comments
- [The Agent Never Sees the Key: Proving Credential Brokering in DigitalOcean Action Gateway](https://daily.dev/posts/the-agent-never-sees-the-key-proving-credential-brokering-in-digitalocean-action-gateway-whpn33mhj) · DigitalOcean Community · 0 upvotes · 0 comments
- [AI agents are running wild on developer machines. Incredibuild has a fix.](https://daily.dev/posts/ai-agents-are-running-wild-on-developer-machines-incredibuild-has-a-fix--zyhgtuphr) · The New Stack · 1 upvotes · 0 comments
- [I gave Claude Code its own disposable computer, and stopped caring what it installed](https://daily.dev/posts/i-gave-claude-code-its-own-disposable-computer-and-stopped-caring-what-it-installed-iqddqhras) · XDA Developers · 2 upvotes · 1 comments

---

Tags: [#security](https://daily.dev/tags/security), [#aws](https://daily.dev/tags/aws), [#docker](https://daily.dev/tags/docker), [#claude-code](https://daily.dev/tags/claude-code), [#secrets-management](https://daily.dev/tags/secrets-management)

[View this post on daily.dev](https://daily.dev/posts/secure-aws-credentials-for-claude-code-and-other-coding-agents-k6lqcfsib)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Secure AWS credentials for Claude Code and other coding agents","url":"https://daily.dev/posts/secure-aws-credentials-for-claude-code-and-other-coding-agents-k6lqcfsib","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/secure-aws-credentials-for-claude-code-and-other-coding-agents-k6lqcfsib"},"datePublished":"2026-11-24T12:16:52.106Z","dateModified":"2026-11-24T12:17:18.656Z","description":"Running 'aws sso login' before 'claude' gives the coding agent access to every AWS role your SSO session can assume, including AdministratorAccess. The...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a600193facfbdf7caa3c56b69ad4ca70?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/a600193facfbdf7caa3c56b69ad4ca70?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"cloudonaut","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"cloudonaut","logo":"https://media.daily.dev/image/upload/t_logo,f_auto/v1/logos/455b5978ef0444049989d58a197e093d","url":"https://daily.dev/sources/cloudonaut"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/secure-aws-credentials-for-claude-code-and-other-coding-agents-k6lqcfsib","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"security,aws,docker,claude-code,secrets-management","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"cloudonaut","item":"https://daily.dev/sources/cloudonaut"},{"@type":"ListItem","position":3,"name":"Secure AWS credentials for Claude Code and other coding agents"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/secure-aws-credentials-for-claude-code-and-other-coding-agents-k6lqcfsib#faq","mainEntity":[{"@type":"Question","name":"How do I give Claude Code access to AWS without exposing my SSO session credentials?","acceptedAnswer":{"@type":"Answer","text":"Run Claude Code inside a Docker Sandbox and use a host-side credentials broker that hands it temporary, least-privilege AWS credentials instead of mounting '~/.aws' directly. The sbx-aws-developer broker runs 'aws configure export-credentials' every minute per profile, writing fresh credentials to a read-only mount at '/mnt/aws-credentials', so the agent never sees the real SSO session. Developers isolating AI agents from AWS secrets can track setups like this one on daily.dev."}},{"@type":"Question","name":"Why can't a proxy just inject AWS credentials into a coding agent's sandboxed requests?","acceptedAnswer":{"@type":"Answer","text":"AWS doesn't use a static API key header; each request is signed with Signature Version 4, and the signature covers the request itself, so a proxy cannot inject it afterward. That's why Docker Sandboxes' usual approach of overwriting an auth header fails for AWS, requiring instead a broker that hands the sandbox temporary credentials so the agent signs its own requests. Anyone designing secret-injection proxies for AI agents can follow AWS-specific gotchas like this on daily.dev."}},{"@type":"Question","name":"How long do temporary AWS credentials issued to a sandboxed coding agent remain valid?","acceptedAnswer":{"@type":"Answer","text":"They last as long as the session duration configured on the IAM Identity Center permission set, one hour by default and up to twelve hours maximum. Stopping the credentials broker does not revoke credentials an agent already copied; they stay valid until they expire, so permission sets with a short session duration are recommended. Teams tuning session duration for agent credentials can keep up with practices like this via daily.dev."}}]}
```

