NewWork mode: your Claude Code or Codex on work calls, answering from your project's codeSkip to content
Middle+0 views

What tools do you use, and how do you address secrets in environment variables and repositories?

Practice

AI answer

I do not store secrets in source code, configuration files in the repository, or its history. For CI/CD, I use the platform's protected secret store or a separate secrets manager (for example, Vault or a cloud Secret Manager); where possible, I issue short-lived credentials through federation or workload identity. I limit access according to the principle of least privilege and rotate secrets regularly.

For local development, I use a .env file added to .gitignore and a safe .env.example without real values. Environment variables are convenient for passing secrets to a process, but they are not a storage solution by themselves: access to them should be restricted, and they should not be written to logs, dumps, or diagnostic messages. If a secret gets into the repository, I revoke or rotate it first—deleting the file from the latest commit is not enough; then I check the history and logs for further exposure.