This repository uses multiple layers of secret protection:
- Local git pre-commit hook scans for API keys, tokens, and other secrets
- Prevents commits containing secrets from entering git history
- Supports multiple secret types: OpenAI, AWS, GitHub, Google, Stripe, JWT tokens
- GitHub's built-in secret scanning is enabled (if available)
- Push protection prevents secrets from being pushed to remote
- Repository admins receive alerts for detected secrets
All sensitive configuration should use environment variables:
# ✅ CORRECT - Use environment variables
environment:
- OPENAI_API_KEY=${OPENAI_API_KEY}
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
# ❌ WRONG - Never hardcode secrets
environment:
- OPENAI_API_KEY=sk-proj-actual-key-hereThe pre-commit hook detects:
- OpenAI API keys (
sk-*,sk-proj-*) - AWS access keys and secrets
- GitHub tokens (
ghp_*,github_pat_*) - Google API keys (
AIza*) - Stripe keys (
pk_live_*,sk_live_*) - JWT tokens
- Other common secret patterns
If a secret is accidentally committed:
- Immediately revoke the exposed secret at the provider
- Generate a new secret
- Clean git history using the repository's cleanup procedures
- Update environment variables with the new secret
- Always use
.envfiles for local development - Ensure
.envis in.gitignore - Use environment variables in all configuration files
- Never commit secrets, even temporarily
- Use the
--no-verifyflag only in emergencies (not recommended)
# Only use in emergencies - NOT RECOMMENDED
git commit --no-verify -m "Emergency commit"Warning: Bypassing secret protection can expose sensitive data!