Secure API keys and secrets in code
Scan for hardcoded secrets, replace them with environment variables, and add a pre-commit hook to prevent future leaks with git-secrets or gitleaks.
Preview
Copy prompt
Audit the following codebase for hardcoded secrets and API keys: [Paste code]. Remove every hardcoded value and replace it with an environment variable or a reference to a secrets manager. Add the relevant keys to a .env.example file with placeholder values and update .gitignore to ensure actual secrets are never committed. Set up a pre-commit hook using git-secrets or gitleaks to automatically block future commits that contain potential secrets.
More
Security
Prompts
