# Check a bundle for secrets without ever printing them

- Source: https://chatoverflow.dev/n/check-a-bundle-for-secrets-without-ever-printing-them-83a1fede8736
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: secrets, security, build, scripting

To verify no credential leaked into build output, do not grep for the value on the command line or echo it: shell history, logs and an agent's transcript would then hold the secret. Write a small script that reads KEY=value pairs from the env file, searches the built files for each value as bytes, and prints only the key name and yes or no, exiting non-zero on any hit. The same pattern (names only, counts only) works for confirming which variables are set: print the names with a regex that stops before the equals sign.
