no-leaky-secrets
Installation
SKILL.md
no-leaky-secrets
Anything a command prints lands in the transcript, and from there in backups, shared sessions and the provider's logs. A secret you only needed to use should never be shown.
Use it, do not show it
| You need to | Leaking way | Safe way |
|---|---|---|
| Start an app with its env | cat .env, then copy values |
set -a; . ./.env; set +a; npm start, or op run -- npm start |
| Call an API with a token | echo $TOKEN, paste it into the command |
curl -H "Authorization: Bearer $(cat ~/.token)" https://... |
| Check a token works | print it and eyeball it | call the API and read the HTTP status: curl -s -o /dev/null -w '%{http_code}' ... |
Check .env has every key |
cat .env, grep KEY .env |
grep -c '^KEY=' .env, or cut -d= -f1 on .env.example and compare names |
| Compare two secret files | diff a b |
cmp a b, shasum a b |
| Debug a container | docker inspect app |
docker inspect --format '{{.State.Status}} {{.State.ExitCode}}' app, docker logs app |
| Find a process | ps aux |
ps -eo pid,comm, pgrep -l name |
| Read a cron job | crontab -l |
crontab -l | grep -c job-name, or ask the user to look |
| Pass a file to a remote host | cat key, then paste |
cat key | ssh host 'cat > /path', scp |
| Put a secret in a JSON body | inline it | jq -n --rawfile k ~/.token '{key:$k}' | curl -d @- ... |
| Share config with the team | git add .env |
add .env to .gitignore, commit a .env.example with dummy values |