Get the AWS Keys Off Your Computer A Claude Code prompt published by Steven Mays, lead AI engineer, walks developers through replacing long-lived AWS access keys with short-lived `aws login` credentials, after October 2026's "Black October" wave of AI-found vulnerabilities and package malware that targeted AWS keys and AI tool sessions. Mays cites Aikido listing `~/.aws/credentials` among the targets of `tensorlake` `0.5.144` and Datadog reporting that `litellm` `1.107.0` malware collects AWS credentials and sessions for Claude, Codex, Gemini, Cursor and Copilot. The switch is incomplete: `aws login` credentials refresh every 15 minutes for a session of at most 12 hours but still land on disk in `~/.aws/login/cache`, the AWS CLI 2.39.3 checks the shared credentials file before login so an old key still wins until deleted, and AWS's SDK reference table as of 2026-11-06 lists login credentials as unsupported in 4 of 17 SDKs and tools, including the SDK for Go V2 and the SDK for JavaScript 2.x. Get the AWS Keys Off Your Computer Black October put AI-found bugs in the headlines, and the same month, package malware went after AWS keys on developer machines. Here is a Claude Code prompt that replaces long-lived keys with short-lived credentials, and what the switch still leaves exposed. Steven Mays Lead AI Engineer https://mays.co/about 7 min read October 2026 picked up a name: “Black October”. It was a name that was circulating X formerly twitter to describe the deluge of cybersecurity incidents since frontier models started finding serious bugs. AWS keys on developer machines are a major target, and we need to start taking cybersecurity seriously. What AI Changed AI models are finding serious bugs. CNBC reports that researchers at Wiz and Calif found the PHP flaws with AI models, and former CISA director Chris Krebs told CNBC that “3% of all critical vulnerabilities ever discovered have been found in the last month.” A stolen credential skips that work. Wiz says most of its incidents are still being analyzed, but Fireworks, Zeabur, and Lightning “all attribute their incident root causes to credential access.” October’s package malware went looking for AWS keys and AI tool sessions. Aikido lists ~/.aws/credentials among the targets of tensorlake 0.5.144 . Datadog says the litellm 1.107.0 malware collects AWS credentials and “sessions for Claude, Codex, Gemini, Cursor, Copilot and other AI coding tools”. What aws login Changes AWS docs say aws login issues credentials that refresh every 15 minutes, for a session of at most 12 hours. They still land on disk, in ~/.aws/login/cache . I infer a stolen cache works until the session ends, up to 12 hours, but I didn’t test that. Wiz says the Shai-Hulud 2.0 malware also looks for short-lived tokens. The Old Key Still Wins After aws login , the old key still wins until you remove it, because the AWS CLI 2.39.3 source checks the shared credentials file before login. So aws sts get-caller-identity , the check in AWS’s own walkthrough, passes against the old key and proves nothing. The CLI also refuses a login on a profile that holds a key, so hide the file: AWS SHARED CREDENTIALS FILE=/dev/null aws login . The Claude Code Prompt Read it before you paste it. Doing It by Hand The AWS CLI guide https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sign-in.html has the aws login steps, and the IAM guide https://docs.aws.amazon.com/IAM/latest/UserGuide/id-credentials-access-keys-update.html covers deactivating and deleting a key. Keep this order: sign in with AWS SHARED CREDENTIALS FILE=/dev/null , run aws configure list with the same override and require type login , remove the key from ~/.aws/credentials , repeat the check without the override, deactivate the key in IAM, and delete it after a few days with no breakage. Trade-offs aws login still leaves live credentials on disk. I found no AWS doc on revoking a session, and aws logout only clears the local cache. Some tools can break: on 2026-11-06, the AWS SDK reference table lists login credentials as unsupported in 4 of its 17 SDKs and tools, including the SDK for Go V2 and the SDK for JavaScript 2.x. Check which SDK your deploy tool uses. For several accounts, use IAM Identity Center. For CI, use GitHub’s OIDC integration, not stored keys. For one person in one account, pick aws login . The tradeoff: you sign in again at least every 12 hours, and a tool on an unsupported SDK needs another credential source. Resources and References - CNBC https://www.cnbc.com/2026/10/23/php-vulnerabilities-ai-cybersecurity.html : “Black October” and the AI-found PHP flaws - NBC News https://www.nbcnews.com/tech/security/hackers-php-flaws-cybersecurity-crisis-rcna605112 : the early read on successful attacks - BleepingComputer https://bleepingcomputer.com/news/security/cisa-confirms-php2shell-vulnerabilities-now-exploited-in-attacks : the CISA listing - Wiz on Black October https://www.wiz.io/blog/black-october-for-ai-developer-platforms : the AI developer platform attacks - Aikido https://www.aikido.dev/blog/tensorlake-npm-package-compromised : the tensorlake compromise - Datadog https://securitylabs.datadoghq.com/articles/litellm-compromised-pypi-docker/ : the litellm compromise - Wiz on Shai-Hulud 2.0 https://www.wiz.io/blog/shai-hulud-2-0-ongoing-supply-chain-attack : behavior and credential counts - AWS Security Blog https://aws.amazon.com/blogs/security/simplified-developer-access-to-aws-with-aws-login/ : the aws login walkthrough - AWS SDK reference https://docs.aws.amazon.com/sdkref/latest/guide/feature-login-credentials.html : the SDK support table - AWS CLI 2.39.3 source https://github.com/aws/aws-cli/blob/2.39.3/awscli/botocore/credentials.py : ProfileProviderBuilder.providers lists the shared credentials file before login - Identity Center instances https://docs.aws.amazon.com/singlesignon/latest/userguide/identity-center-instances.html : what it needs - GitHub OIDC in AWS https://docs.github.com/en/actions/how-tos/secure-your-work/security-harden-deployments/oidc-in-aws : Actions without stored keys