AWS Security Blog

Introducing AWS Credential Daemon

Developer workstations have quietly become one of the hardest and most overlooked places in the enterprise to secure. Unlike tightly secured production environments, a developer’s laptop is built for speed and broad reach. To get work done, developers and their coding agents hold standing access across code repositories, build pipelines, and cloud accounts. Today, we’re announcing the open source release of AWS Credential Daemon (credsd), along with preview integration in the AWS Command Line Interface (AWS CLI), bringing hardware-backed local credential custody to the AWS CLI, local AI coding agents, and Strands Box.

Historically, the AWS CLI and AWS SDKs wrote static access keys, single sign-on (SSO) tokens, and session caches into plaintext files on disk under ~/.aws/. That approach prioritized simplicity and portability, relying only on OS file permissions to separate local users, leaving same-user credential isolation unaddressed if a human at the keyboard was deciding what code to run.

That model breaks down when developers run local AI coding agents alongside extended sign-in sessions. An AI agent running on your laptop inherits everything your user account can reach, because OS file permissions and discretionary access control (DAC) can’t tell the difference between you typing in a terminal and an agent running under your user ID (uid). Without that distinction, agents automatically inherit extended sign-in sessions, now configurable up to 90 days for individual AWS Identity and Access Management (IAM) users and roles, allowing developers and tools to remain signed in through AWS Sign-In without daily re-authentication.

These shifts expose three risks on the workstation:

  • Ambient authority beyond the task: Agents and local tools inherit reusable credentials carrying a developer’s full permissions, with no access decision made at the time of use or ability to audit who did what. The agent’s reach goes far beyond its current task, and its tokens keep working until they expire or are revoked.
  • Prompt injection through untrusted inputs: While traditional tools ran fixed code, AI agents can read untrusted content and decide what to run next. Because the agent holds direct access to the developer’s keys, an external attacker can trick it into misusing permissions or leaking credentials directly from disk.
  • Portable session files: When long-lived static keys or refresh tokens sit in readable plaintext files, even a well-meaning agent trying to unblock a task might copy or export them somewhere credentials do not belong. A single leaked or copied file from ~/.aws/ can give an attacker persistent cloud access they can replay.

When we started work to reduce these risks, we focused on two goals. First, we wanted plaintext long-lived and cached credential material completely off the disk and replaced with hardware-backed, on-demand session vending, without changing how developers sign in. Second, for teams running local AI agents that need stronger containment, we wanted a way they could pair credsd with an execution sandbox and inline session scoping, so agents never touch raw credentials or inherit full developer permissions.

How AWS Credential Daemon works

Figure 1: AWS Credential Daemon local custody and vending

Figure 1: AWS Credential Daemon local custody and vending

We designed credsd around a simple principle: securing local credentials shouldn’t require developers to learn new AWS CLI commands or rewrite application code. Integrated directly with the AWS CLI (in preview) and Strands Box, credsd gives developers the same command-line experience they rely on today while sealing sign-in sessions and static secrets away from local processes and AI agents, as shown in Figure 2:

  • For developers: You continue to use aws login, aws sso login (coming soon), and aws configure exactly as you did before. The first time you sign in, the AWS CLI asks once whether to let credsd seal your session using your machine’s secure hardware, covering standard sign-ins and extended sign-in sessions of up to 90 days. From that point on, credsd refreshes sessions in the background and vends short-lived credentials on demand to the AWS CLI (during preview, AWS SDKs and tools can connect using a credential_process profile). For every AWS credential source, what comes back from the daemon is a session, never long-term credentials.
  • For security teams: Long-lived refresh tokens, signing keys, and static IAM access keys are encrypted at rest under a key held by the machine’s secure hardware or keychain, so a copied file is no longer a usable credential. Every credential request is recorded locally with the kernel-reported uid, process ID, and executable path of the caller. When paired with Strands Box, AI agents can reach AWS and third-party APIs from inside a contained sandbox without the credential being placed in the agent’s environment.

Securing everyday AWS CLI workflows (preview)

Moving an existing macOS or Linux workstation off plaintext files takes only a few minutes inside the AWS CLI. Some AWS CLI commands are available in today’s preview (aws login and aws configure for new profiles), while others are coming soon. See preview scope and limitations for the full list.

Step 1: Install the daemon through the AWS CLI

Update to the latest AWS CLI version that supports the credential daemon, then run aws configure credential-daemon install to download the signed platform package and register the background service:

$ aws configure credential-daemon install
Installed aws-credential-daemon for this user.
Linked ~/.aws/credential-daemon.sock to /Users/alice/.../credential-daemon.sock.
Your next sign-in will ask whether to store its session here.

Installing the daemon doesn’t change your profiles. On Linux, running the same command installs aws-credential-daemon as a system service with sudo so it works across multiple users (other users on the machine run aws configure credential-daemon link).

Step 2: Seal your sign-in sessions automatically

The next time you sign in with aws login or aws sso login (coming soon), the CLI detects credsd and asks once whether to move that profile into the daemon:

$ aws login --profile dev
The credentials daemon is installed on this machine. Store this profile's session there instead of in ~/.aws? [Y/n] y

Signed in as arn:aws:sts::123456789012:assumed-role/Dev/alice
Credentials are stored in the credential daemon.
Use "--profile dev" to use the new credentials, such as "aws sts get-caller-identity --profile dev"

Your answer is saved to the profile in ~/.aws/config, any plaintext session file in ~/.aws/login/cache/ is deleted, and future sign-ins for dev go straight to credsd without prompting again. The profile is left holding only the storage choice and the name of its credential in the daemon, credential_storage = daemon and credential_daemon = <name>, neither of which is a secret.

Step 3: Migrate existing static IAM access keys

For new profiles, you can seal IAM access keys directly in the daemon using aws configure. To move an existing profile’s IAM access keys out of ~/.aws/credentials during the initial preview, seal the key using the creds CLI:

$ creds bootstrap --credential ci aws-iam-user \
    --access-key-id AKIAIOSFODNN7EXAMPLE \
    --region us-east-1

Creds prompts for the secret access key and seals the key in credsd, which exchanges it for temporary AWS Security Token Service (AWS STS) GetSessionToken credentials on demand. After you configure your ci profile to the daemon using credential_process in ~/.aws/config and delete the plaintext entry from ~/.aws/credentials, consider rotating the key in IAM, because old copies in backups or dotfiles remain usable until you do.

Coming soon in a later preview update, you will also be able to run aws configure migrate-credentials --all --dry-run to preview which existing profiles would be included in a bulk move and migrate them in one step through the AWS CLI. Even so, a long-term credential that’s never created in the first place is more secure, so use aws login or aws sso login whenever possible.

Running AI agents safely with isolation

Sealing credentials in credsd stops an AI agent or a malicious script from reading long-lived tokens and static keys off your hard drive. However, if an AI coding agent runs directly as your OS user without containment, it can still ask the CLI or SDK for a short-lived credential and act with your full developer permissions.

To give AI agents access to AWS and third-party services without exposing credentials to the agent process, Strands Box integrates with credsd, fetching credentials directly from the daemon with no AWS CLI profile or credential_process in between.

First, store the agent’s credential in credsd using the creds client:

$ creds bootstrap --credential oncall aws-idc-sso \
    --start-url https://d-1234567890.awsapps.com/start --sso-region us-west-2 \
    --account-id 123456789012 --role-name OncallAgent \
    --identity-type agent

creds bootstrap declares a new credential configuration in the daemon, where --credential sets the name (oncall in this example) used to reference it. aws-idc-sso is one of the credential sources credsd supports, alongside AWS Sign-In sessions, IAM access keys, IAWS IAM Roles Anywhere certificates, and non-AWS token sources. --identity-type agent marks the credential as belonging to an agent rather than a person, which governs which environments and callers can use it. Run creds list anytime to see the credential names currently sealed in your daemon.

Next, name that credential in the box’s egress route instead of passing AWS keys into the agent’s environment variables:

# box.toml
[egress.aws]
destinations = ["*.amazonaws.com"]
secret.ref = "credsd://oncall"

Allow the same destinations in the box’s Dogwood policy (policy.dw), then start the box:

$ box run --config box.toml

When the agent calls AWS, the Strands Box egress gateway asks credsd over its local Unix socket for a short-lived session for oncall and SigV4-signs the request as it leaves the box. Inside the sandbox, the agent only ever sees placeholder keys, while credsd keeps the sign-in sealed on the device, refreshes it in the background, and records each request in its local audit log.

The same pattern extends to third-party tokens. A sandboxed coding agent can call GitHub using an [egress.github] route. By sealing your GitHub token in credsd with creds bootstrap instead of exporting it in your shell, Strands Box injects the token into outbound requests as an Authorization: Bearer <token> header at the egress gateway without the secret ever sitting in your shell history, on disk, or in the agent’s sandbox:

[egress.github]
destinations = ["github.com"]
secret.ref = "credsd://github"
secret.type = "token"
secret.placement = "header"
secret.inject = "always"

Bounding what the agent can do

While isolation keeps the credential out of the agent’s reach, a scope-down ceiling bounds what that credential can do if the agent is directed to somewhere you didn’t intend.

When credsd issues credentials for an agent’s environment, it applies an inline scope-down policy at issuance through sts:GetScopedCredentials, so the session AWS returns is already narrower than the role behind it. Because the limit is applied by AWS when the credential is created rather than enforced locally, it travels with the credential, and nothing holding that session can widen it.

Combining a dedicated IAM role for the agent with an inline sts:GetScopedCredentials policy gives you two independent guardrails, a role scoped to agent tasks, and an individual session narrowed to the specific run.

What this means for your security posture

  • Zero credential visibility: Strands Box fetches the credential and signs requests at the egress boundary, so it’s never placed in the agent’s environment variables or written into the sandbox file system. Even if the agent is compromised by a prompt injection, there’s no credential file or environment variable inside the sandbox to exfiltrate.
  • Unified custody across AWS and third-party APIs: In addition to AWS credentials, credsd can seal OAuth tokens, bearer JSON Web Tokens (JWTs), and static API keys for third-party services. A workstation then keeps one local custody boundary across every service it authenticates to, rather than a separate solution per provider.

Things to consider

Keep these design points in mind as you migrate your teams.

  • Clean up leftover plaintext keys: If static keys remain in ~/.aws/credentials or shell profiles (.bashrc, .zshrc), AWS SDKs resolve them first and local agents can still read them off disk. Move existing static keys into credsd and remove exported shell keys during setup.
  • Verify your OS storage tier: credsd seals the master key in the data protection keychain on macOS and in a TPM 2.0 on Linux, and credsd status reports the backend the installed service uses. On a host without the hardware TPM, installation fails rather than downgrading. When that happens, an administrator can explicitly choose the file backend, which keeps the master key in a 0600 file and therefore depends on full-disk encryption (such as LUKS or FileVault) for protection at rest. Treat that as a deliberate exception, not a default.
  • Use dedicated roles for CloudTrail attribution: credsd logs caller process details and tags known agents locally, but this best-effort telemetry stays on the host. To reliably separate agent and developer actions in AWS CloudTrail, assign the agent a dedicated IAM role paired with sts:GetScopedCredentials.
  • Preview limitations for AWS SDKs: AWS CLI integration with credsd is currently in preview on macOS and Linux. Because moving a profile into credsd removes plaintext files that AWS SDKs currently expect to read, local SDK applications must use a credential_process profile workaround during preview. See Installing AWS Credential Daemon for the configuration snippet and recovery steps.

Conclusion

AWS Credential Daemon (credsd) takes long-lived secrets out of readable files on the workstation without changing how developers work. By partnering directly with the AWS CLI, credsd moves developers off plaintext storage with a single question per profile and provides hardware-sealed validation for agentic and CLI workloads alike.

AWS Credential Daemon is open source under the Apache 2.0 license. Download it or contribute to the project at the AWS Credential Daemon GitHub repository.

If you have questions about this post, contact AWS Support or start a new thread on AWS re:Post.


Abhi Yadav

Abhi Yadav

Abhi is a Principal Product Manager at Amazon Web Services. His work centers on giving customers practical controls to govern what AI agents can access and do in the cloud. He’s spent 20 years in identity and access management, spanning workforce identity, access governance and, more recently, agentic identity. Prior to AWS, he led product efforts at Google to shape controls for AI security. Abhi is an active contributor to security standards and to the development of the broader IAM community.

Khaled Sinno

Khaled Sinno

Khaled is a Principal Engineer at Amazon Web Services. His current focus is on identity and access management in AWS and more generally on providing identity and security controls for customers in the cloud. In the past, he’s worked on availability and security within AWS RDS (databases) while also contributing more broadly to the security space of database and search services. Prior to AWS, Khaled led large engineering teams in the FinTech industry, working on distributed systems in finance and trading platforms.

Author

Jeff Lombardo

Jeff is a Solutions Architect expert in identity and access managment, application security, and data protection. Through 17 years as a security consultant for enterprises of all sizes and business verticals, he delivered innovative solutions with respect to standards and governance frameworks. Today at AWS, he helps organizations enforce best practices and defense in depth for secure cloud adoption.