
AWS re:Invent 2026|Get the Long-Lived Keys Off Your Disk: How the AWS Credential Daemon Protects Agents and CLIs
One-line takeaway: Coding agents, MCP servers, and throwaway npx scripts all run as you and can read a plaintext key in ~/.aws; the AWS Credential Daemon (credsd) seals the long-lived secret in a hardware-backed store and hands each process only a short-lived session it can never mint or extend.
Series: agentic-ai (8 articles)
- …
- 8AWS re:Invent 2026|Get the Long-Lived Keys Off Your Disk: How the AWS Credential Daemon Protects Agents and CLIs This article
- The claim
Here is a position worth arguing. Once you let autonomous tools run on your laptop, storing a long-lived AWS access key in plaintext is the wrong default, no matter how careful you are. The threat is not some exotic remote exploit. It is the ordinary fact that every process running under your user can open the same files you can. The fix is not another policy reminder. It is to move the secret behind a boundary the calling process cannot cross, and give that process an expiring credential instead. AWS shipped the local piece for this at re:Invent 2026 as the open-source AWS Credential Daemon, currently in preview [1].
- Why
~/.awsbecame a real attack surface
Picture a normal developer machine a few years ago. The CLI and a couple of SDKs read the credentials in
~/.aws , and roughly the same set of trusted tools ran every day. Now look at what executes under your account in an agentic workflow: a coding agent that shells out, MCP servers you added for a single task, and one-off npx packages pulled in on the spot. They all inherit your permissions, and any of them can read a static secret sitting on disk [1]. A key that never expires turns one compromised or careless process into durable access. Rotating it after the fact is a reaction, not a boundary.- The design: seal the secret, mint short sessions
The daemon inverts what the process ever sees. The long-lived credential stays sealed under a hardware-backed key, and the daemon serves short-lived credentials to the CLI, SDKs, and agents over a local socket; the project describes itself as a local daemon that keeps AWS credentials and other secrets encrypted on the machine [5]. The platform backends differ by operating system. On macOS the signed package keeps its key in a data-protection keychain item that only the signed
credsd app can open, and on Linux it uses the TPM [1]. A process asks for credentials and gets back a session with an expiration. It never receives the secret that created that session, so it cannot mint a new one after the session dies.
Figure by the author (illustrative). The sealed-secret and short-lived-session flow follows the daemon design and the AWS CLI User Guide material summarized in [1].
- Why short-lived is the correct unit
This is not a new idea; the daemon is a local enforcement point for a principle AWS already documents. IAM temporary security credentials are short-term, configurable from a few minutes to several hours, and once they expire AWS no longer recognizes them or allows API requests made with them [3]. Because they are generated on demand rather than stored, you avoid distributing or embedding long-term credentials, and you do not have to explicitly revoke them when work ends, an expired credential cannot be reused [3]. AWS Prescriptive Guidance puts the same requirement directly in its startup baseline: use short-lived credentials for access to your resources [4]. The daemon's job is to make that guidance automatic on a laptop rather than something you remember to do.
- Plaintext file versus the daemon
Dimension | Static key in ~/.aws/credentials | AWS Credential Daemon |
|---|---|---|
Where the long-lived secret lives | Plaintext file, readable by your processes | Sealed in keychain (macOS) or TPM (Linux) |
What a calling process receives | The secret itself | A short-lived session with expiration |
Exposure after expiry | Key stays valid until rotated | Expired session is rejected, cannot be reused |
Integration | Direct file read | credential_process , works with CLI, SDK, Terraform, CDK |
Per-request visibility | None built in | Best-effort audit of the calling process tree |
- How it plugs into the tools
The daemon relies on a standard extension point rather than forking every SDK.
credential_process names an external command the CLI runs to retrieve credentials; the command writes JSON to stdout with Version set to 1 , including AccessKeyId , SecretAccessKey , SessionToken , and Expiration [2]. A profile points at the daemon through that setting, which is also how Terraform and the CDK pick it up [1]. The JSON contract is the reason no application code has to change, anything that already honors the SDK process credential provider just works.- The migration traps
Three details will bite you if you skip them. The most important is cleanup: remove the static
aws_access_key_id and aws_secret_access_key for that profile from ~/.aws/credentials , and clear the AWS_* key variables from your environment, because the CLI and SDKs read those before credential_process ; leaving them in place silently defeats the daemon [1]. Use the absolute path to the creds binary in the profile, not a shell-relative name. Platform support is also partial in preview: macOS on Apple silicon and Linux are available, Windows is planned, and a Linux host without a TPM falls back to a file backend that is not hardware-protected, so you should know which one you actually have [1]. On top of that, preview commands, configuration, and on-disk formats can change between releases without a migration path [1]. At least one same-week launch has a rough edge here, the Redshift extension for DuckDB does not accept a credential_process profile in its default secret setup and asks for a CREDENTIAL_PROVIDER profile instead [1]. Check that kind of compatibility before you mix preview features.- Audit and telemetry boundary
The daemon keeps a per-request audit log of the calling process tree, but the project itself labels that as best-effort telemetry rather than a guaranteed identity record [1]. Do not treat process names as proof of who acted. If you want CloudTrail to distinguish an agent's requests from yours, the recommended path is to give the agent its own credential and IAM role, the same pattern that makes every action attributable in Greenlight and the IAM workload identity work [1]. Keep the local audit log focused on process identifiers and decisions, never the secret or full request payloads, and retain it on a fixed schedule. That gives you a usable trail without building a per-person history of every command.
Next steps
- Audit one machine and list every long-lived key in
~/.awsand everyAWS_*variable; those are the secrets to move or delete.
- Install
credsdon a macOS Apple silicon or TPM-equipped Linux host, bootstrap an Identity Center sign-in, and point one profile at it throughcredential_process.
- Delete the plaintext key and environment variables for that profile, then confirm a CLI call still works and that the returned session carries an expiration.
- Give each coding agent its own credential and IAM role so CloudTrail separates agent actions from yours, and keep audit logs free of secrets and payloads.
Topics: re:Invent-2026, ai-agents, credential-security, short-lived-credentials, developer-tooling
Personal opinion disclaimer: this reflects my reading of the re:Invent coverage, the open-source project description, and AWS documentation. The daemon is a preview whose commands and formats can change without a migration path, the strongest operational claims come from AWS or an AWS employee, and the file-backend fallback means not every installation is hardware-protected; verify the current README and your own platform backend before rolling it out beyond a single machine.
References
- Guimaraes, M. (2026). Three re:Invent 2026 launches developers should try first. AWS Builder Center (AWS employee; vendor primary source for the daemon details). https://builder.aws.com/content/3MviYl3hvmyKmedG0ExigqLMkcG/three-reinvent-2026-launches-developers-should-try-first
- Amazon Web Services. AWS CLI Configuration Variables: credential_process. AWS CLI Command Reference (vendor specification). https://docs.aws.amazon.com/cli/v1/topic/config-vars.html
- Amazon Web Services. Temporary security credentials in IAM. AWS IAM User Guide (vendor documentation). https://docs.aws.amazon.com/IAM/latest/UserGuide/id\_credentials\_temp.html
- Amazon Web Services. ACCT.13 Use short-lived credentials for access to your AWS resources. AWS Prescriptive Guidance (vendor guidance). https://docs.aws.amazon.com/prescriptive-guidance/latest/aws-startup-security-baseline/acct-13.html
- LibHunt. (2026). Credsd, a Local Credential Daemon (third-party project summary). https://www.libhunt.com/posts/1571227-credsd-a-local-credential-daemon
Series: agentic-ai (8 articles)
- …
- 8AWS re:Invent 2026|Get the Long-Lived Keys Off Your Disk: How the AWS Credential Daemon Protects Agents and CLIs This article
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article