- NEVER commit
.envfiles. - NEVER embed keys in code.
- ALWAYS use environment variables.
If a secret (API Key, Database URL) is committed to Git:
- Rotate the key immediately at the provider (AWS, OpenAI, DB Host).
- Purge the secret from Git history using
git filter-repoor start a fresh repo. - Audit logs for unauthorized usage during the exposure window.
- Run
pip auditandnpm auditregularly before major releases. - Keep
requirements.txtpinned.
- Ensure
dev_local.db(SQLite) is never deployed to production.