Skip to content
Minute Campus.

How AI gets attackedLesson 041 min

What happens when an API key lands on GitHub?

An API key is a password for software, letting a program use a paid service in your name. When one is pushed to a public repository, anyone can read it, and automated tools search public code for this. GitGuardian counted over twenty-eight million new secrets in public GitHub commits in 2025. Over six in ten keys that worked in 2022 still worked in January 2026.

Remember

Revoke an exposed key at once, then keep keys out of your code.

Sources

Checked at the source.

Every claim in the lesson was checked against these before it was recorded.

  1. 1The State of Secrets Sprawl 2026GitGuardian · read 4 Oct 202628.65 million new secrets in public GitHub commits in 2025; over 64% of 2022 credentials still valid in January 2026.
  2. 2About secret scanningGitHub Docs · read 4 Oct 2026Scans full Git history and advises rotating the affected credential immediately.

Transcript

The lesson, word for word.

Read it at your own pace, or search the page for a term.

What happens when an API key lands on GitHub? An API key is a password for software. It lets a program use a paid service in your name. Developers sometimes paste one into their code and push that code to a public repository. Now anyone can read it, and automated tools search public code for exactly this. One security company, GitGuardian, counted more than twenty-eight million new secrets in public GitHub commits in twenty twenty-five. And when it retested keys that had worked in twenty twenty-two, more than six in ten still worked in January twenty twenty-six. Nobody had switched them off. That is the real mistake. Deleting the line does not help, because the old version stays in the history. The fix has two steps. First, revoke the key at once and make a new one. Second, keep keys out of code: use environment variables or a secrets manager.

Questions? Comment on the lesson on YouTube

New lessons every day.

Follow Minute Campus where you already scroll.