Skip to main content
SecurityOctober 12, 20264 min read

GitHub Trains a Model to Catch Leaked Secrets

Get technical support

Which of these can actually be exploited?

Since October 7, GitHub's AI-detected secret alerts run on a new model trained to spot credentials with no recognizable format, such as plain passwords in config files. It is included with Secret Protection and Advanced Security, and push protection is in preview.

What Changed

Since October 7, 2026, GitHub's AI-detected secret alerts come from a new model built for one job. It reads the code around a value to decide whether it is a credential, which lets it flag secrets that have no recognizable format, such as a plain password in a config file. Customers who already had AI-detected password alerts were moved to the new model automatically.

Why Patterns Were Not Enough

Secret scanning has long relied on patterns. A GitHub token, an AWS access key or a Stripe key each has a recognizable shape, so a pattern finds them reliably. A database password like the one below has no shape at all.

database:
  user: app
  password: Autumn-Rainfall-2026

Only the context says it is a secret, the key name and the file it sits in, and that context is what the model reads.

Where You Can Use It

  • Secret scanning alerts. Included with GitHub Secret Protection and GitHub Advanced Security at no extra charge. GitHub Enterprise Server 3.23 has it in public preview.
  • Push protection. In preview for GitHub Team and GitHub Enterprise Cloud customers with Secret Protection or Advanced Security, once an administrator turns it on. It stops a push that contains a likely secret before the secret lands in the repository.
  • Copilot security review. AI secret checks in Copilot's /security-review command are coming to private preview. They do not need a Secret Protection license, and they stay off until you opt in.

Watch the AI Credits

Alert scanning costs nothing extra. Push protection and the Copilot checks use AI Credits once you opt in, and GitHub says that billing starts "in the coming weeks". Push protection is billed to the organization that owns the repository, even when a check lets the push through.

A budget alert on its own does not stop spending. To cap it, open Billing and licensing, then Budgets and alerts, create a SKU-level budget for Advanced Security and Secret Protection AI Credits, and turn on "Stop usage when budget limit is reached".

A Found Secret Still Needs Rotating

Detection is a safety net. Treat any secret that reached a repository as known and rotate it, because deleting it from the latest commit leaves it in the history. The lasting fix keeps secrets out of code altogether, through environment variables, a secrets manager or short-lived credentials. GitHub has not published accuracy figures for the model, so review its alerts before acting on them in bulk.

Where It Fits

Our guides on handling secrets in CI without leaking them into logs and giving applications AWS credentials without storing any cover the prevention side, and our note on how GitHub now revokes stolen tokens without locking out the rest covers what happens after a leak. Secret scanning and credential hygiene are part of our security and compliance work.

Sources

Or read how we handle it in Security & Compliance.