Main Street AI ResourcesFree. No sign-up needed for this guide.
Resources / Main Street Security / Level 3, step 16

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 project

Why 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

  1. In the repository's Settings, open the code security section and turn on Secret scanning and Push protection.
  2. 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

  1. Change the key first (the next step).
  2. 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

How you know this step is doneScanning runs on every push, and no working key sits in the code or its history.

If this helped, send it to another business owner you would hate to see scammed.

See more tips like this. I send new ones as I make them, each a link back here. Unsubscribe anytime.