I once saw an entire database leak because someone copied an AWS CLI command straight from their terminal history into a Slack chat.
Sensitive data in AWS CLI is a silent trap. Access keys, secret keys, tokens, parameters, and config details can slip into places they should never be—logs, shared scripts, browser history, and CI pipelines. What makes it worse is that AWS CLI is often used in high-trust workflows. One wrong paste, one bad habit, one unreviewed commit, and you’ve exposed credentials that could take down your entire environment.
The AWS CLI stores credentials in ~/.aws/credentials and ~/.aws/config. If any user account on your machine, container, or CI process is compromised, those files are fair game. Inline parameters like --access-key-id or --secret-access-key make it worse, since they often end up in shell history or monitoring logs. Using aws ssm get-parameter with --with-decryption can leak secrets to stdout, which then silently pass into downstream systems without warning.
Secrets exposure happens more often in automation. Developers keep AWS credentials in environment variables for convenience, but those variables might spill into build logs or error traces. Long-lived IAM keys sitting unused in a repo history still work unless manually revoked. Redacting sensitive data after the fact doesn’t undo the damage—attackers only need one copy.