Secret scanning detects credentials committed to code, logs, or issues, and push protection blocks them before they land. Agents write and commit code quickly, so scanning in the editor, in pre-commit hooks, and on the server is a cheap safety net.
Read in this order
- OfficialPush protection (GitHub Docs)Start here: how push protection stops a leaked secret before it reaches the repo.
- Open sourceGitleaksA fast open source scanner you can run in pre-commit hooks and CI.
- Open sourceTruffleHogA scanner that also verifies whether a found secret is still live.