Introducing atmos auth logout: Secure Credential Cleanup
We're excited to announce a new authentication command: atmos auth logout. This command provides secure, comprehensive cleanup of locally cached credentials, making it easy to switch between identities, end work sessions, and maintain proper security hygiene.
Why This Matters
Most cloud practitioners never log out of their cloud provider identities. Not because they don't want to, but because the tooling doesn't make it easy.
When you authenticate with cloud providers, credentials get scattered across your filesystem:
- AWS:
~/.aws/credentials,~/.aws/config, session tokens - Azure:
~/.azure/directory with multiple authentication artifacts - Google Cloud:
~/.config/gcloud/with various credential files
Most cloud provider tools don't provide a simple, comprehensive logout command. You're left to:
- Manually hunt down and delete credential files across different locations
- Navigate through provider-specific web consoles to revoke tokens
- Hope that session expiration handles cleanup for you
This leads to credential sprawl: old, forgotten credentials littering your system, many still valid and exploitable.
The atmos auth logout command makes credential cleanup explicit, comprehensive, and easy.
What's New
Basic Usage
Logout from a specific identity:
atmos auth logout dev-admin
This removes credentials for dev-admin and all identities in its authentication chain:
Logging out from identity: dev-admin
Building authentication chain...
✓ Chain: aws-sso → dev-org-admin → dev-admin
Removing credentials...
✓ Keyring: aws-sso
✓ Keyring: dev-org-admin
✓ Keyring: dev-admin
✓ Files: ~/.aws/atmos/aws-sso/
Successfully logged out from 3 identities
⚠️ Note: This only removes local credentials. Your browser session
may still be active. Visit your identity provider to end your
browser session.
Interactive Mode
Run atmos auth logout without arguments for an interactive experience:
atmos auth logout
? Choose what to logout from:
❯ Identity: dev-admin
Identity: prod-admin
Identity: dev-readonly
Provider: aws-sso (removes all identities)
All identities (complete logout)
The interactive mode uses Charmbracelet Huh with Atmos theming for a polished experience.
Provider Logout
Remove all credentials for a specific provider:
atmos auth logout --provider aws-sso
This removes the provider credentials and all identities that authenticate through it:
Logging out from provider: aws-sso
Removing all credentials for provider...
✓ Keyring: aws-sso
✓ Keyring: dev-org-admin (via aws-sso)
✓ Keyring: dev-admin (via aws-sso)
✓ Keyring: prod-admin (via aws-sso)
✓ Files: ~/.aws/atmos/aws-sso/
Successfully logged out from 4 identities
Dry Run Mode
Preview what would be removed without actually deleting anything:
atmos auth logout dev-admin --dry-run
Dry run mode: No credentials will be removed
Would remove from identity: dev-admin
• Keyring: aws-sso
• Keyring: dev-org-admin
• Keyring: dev-admin
• Files: ~/.aws/atmos/aws-sso/credentials
• Files: ~/.aws/atmos/aws-sso/config
3 identities would be logged out
How It Works
Authentication Chain Resolution
Atmos intelligently resolves the complete authentication chain for your identity and removes credentials at each step:
aws-sso → dev-org-admin → dev-admin
↓ ↓ ↓
Removed Removed Removed
This ensures no orphaned credentials are left behind.
Comprehensive Cleanup
The logout command removes credentials from all storage locations:
- ✅ System keyring entries - Credentials stored securely by your OS
- ✅ AWS credential files -
~/.aws/atmos/<provider>/credentials - ✅ AWS config files -
~/.aws/atmos/<provider>/config - ✅ Empty directories - Cleans up provider directories after removal
Best-Effort Error Handling
The logout command continues even if individual steps fail, ensuring maximum cleanup:
Logging out from identity: dev-admin
Removing credentials...
✓ Keyring: aws-sso
✗ Keyring: dev-admin (not found - already logged out)
✓ Files: ~/.aws/atmos/aws-sso/
Logged out with warnings (2/3 successful)
Errors encountered:
• dev-admin: credential not found in keyring
This best-effort approach means you always get as much cleanup as possible.
Security Best Practices
Browser Sessions
atmos auth logout only removes local credentials. Your browser session with the identity provider (AWS SSO, Okta, etc.) remains active.
To completely end your session:
- Run
atmos auth logoutto remove local credentials - Visit your identity provider's website (AWS SSO, Okta, etc.)
- Sign out from the browser session
- Close all browser windows.
The command displays this warning after every logout to ensure you don't forget.
