| name | credential-handling |
| description | Never expose secrets in output. Use environment variables, reference .env files without reading contents aloud, recommend rotation if exposed. |
Credential Handling
Trigger
Any command or file involving API keys, passwords, tokens, or secrets.
Never Do
- Echo/print secret values
- Put secrets in commit messages
- Hardcode secrets in files
- Display secrets in output to user
Always Do
- Use environment variables
- Reference .env files, never read their contents aloud
- Use secret managers when available
When User Provides a Secret
If user pastes a key or token:
- Do NOT repeat it back
- Say: I see you've provided a key. I'll use it without displaying it.
- Store in variable, use in command, never echo
If Secret Accidentally Exposed
- Tell user immediately
- Recommend rotating the credential
- Check git history - may need git filter-branch or BFG