Secrets
A secret is never revealed, whatever its source — the value never reaches the transcript, and exposure is handled by rotation, not by deletion.
A secret is any credential, token, key, password, connection string, signed URL
or session cookie — regardless of source. Local .env* files are only one
source.
It also covers: cloud provider CLIs and dashboards (Railway, Vercel, Fly, AWS,
GCP, Supabase, Cloudflare), CI/CD variables, secret managers (Vault, Doppler,
1Password, SSM, Secret Manager), Kubernetes secrets and ConfigMaps,
docker inspect, container and pod environments, process environment (env,
printenv, /proc/*/environ), process command lines (ps -ef,
ps -eo args, ps aux) — a wrapper shell that exported a key shows it in
full, shell history, keychains, ~/.aws/credentials, ~/.ssh/*, kubeconfig,
.npmrc / .pypirc / .netrc, API responses, log output, stack traces, and
database rows.
The value never reaches the transcript. Not in prose, not in tool output you chose to print, not "just the first 8 characters", not base64'd, not in a file you write, not in a commit, not in a screenshot, not passed to another agent or an external service.
Rules
- Refer to a secret by name, never by value — "
DATABASE_URLis set", "the RailwaySTRIPE_SECRET_KEYdiffers from local". That is enough to reason and to act. - Redact at the source, before printing. If a command would emit secrets,
filter it where it runs —
railway variables --kv | cut -d= -f1,env | cut -d= -f1,| sed -E 's/=.*/=<redacted>/'— rather than running it raw and redacting afterwards. Afterwards is already too late. - Prefer commands that do not return values at all. List keys, check
presence, compare hashes or lengths, or let the platform pipe the value itself
—
railway run,vault exec,op run,--from-literalfrom a file path. - Never copy a secret between environments by reading it. Move it with the platform's own mechanism, or have it pasted directly into the target.
- Never auto-load,
cat, or otherwise dump.env*files. Read a specific key only when asked, and answer about it without echoing the value. - Never commit secrets or credentials. Never add a
.env*, keyfile or dump to a commit "temporarily". - Placeholders in examples and documentation are always fake:
sk-REDACTED,<your-token>.
If a secret is exposed anyway
Printed by a command, sitting in a diff, committed, or pasted by mistake:
- Stop and say so immediately. Name the secret and where it leaked.
- Treat it as compromised. The fix is rotation, not deletion of the message.
- Never quote it back while reporting it.
Two pages carry the commands that respect this without thinking about it:
Railway for
generating a value straight into the platform, and
tools for why ps with full arguments is never
safe.