Level 3 of 3 · step 16 of 18
Turn on automatic secret scanning and clean keys out of your code's history
Passwords left in code get found by bots that search for them.
Time it takes: About 30 minutes per code projectWhy this step matters now
Passwords and API keys pasted into code end up on GitHub and in backups. Bots search public code for them all day, and deleting the line does not remove it from the history.
Steps on GitHub for each code repository
- In the repository's Settings, open the code security section and turn on Secret scanning and Push protection.
- Both are free on public repositories. Private ones need GitHub's paid Secret Protection, or a free tool like gitleaks or trufflehog.
Clean the keys out of the history
- Change the key first (the next step).
- Then remove it from the history with a tool like git filter-repo.
Message whoever runs your website, app or AI tools
Send it to: Your web developer, IT company or the person who set up your AI tools. Change any word you like.
Can you check six things for us this month?
1. Every test or staging copy of our site asks for a login, or is deleted.
2. Every API we use requires a key or login, including internal ones.
3. Each AI agent or document search tool can reach only what its job needs, and a human being approves anything it sends, pays or deletes.
4. Secret scanning is on for our code, with no working keys in its history.
5. Any key that leaks gets changed the same day.
6. The office router has no unused port forwards, and UPnP is off.
Tell me which ones are done and what the rest would take.
If something goes wrong, try this
- The scan finds dozens of old keys: change the ones that still work first, starting with payment, cloud and AI keys.
How you know this step is doneScanning runs on every push, and no working key sits in the code or its history.
← Give AI agents and document search tools only the files and actions their job needsChange any key that leaks the same day →
If this helped, send it to another business owner you would hate to see scammed.