GitHub adds an AI classifier to block passwords and other unstructured secrets before they're pushed
GitHub built a fine-tuned classifier with Microsoft Applied Sciences that extends push protection to unstructured secrets, such as database passwords with no recognizable format, by looking at surrounding code. GitHub says it checks a batch of candidates in under two milliseconds and could more than double the secrets blocked before they enter repository history. It's in private preview, expanding later in October to Secret Protection customers.
GitHub's existing push protection blocks credentials it recognizes by format before they enter a repository's history. Across all the secret types it detects, that stops only about 30% of newly found secrets; the other 70% are found after exposure, and manual revocation takes about 40 days on average, with roughly one in five taking more than 90 days. GitHub says a new secret appears in publicly visible code about once every two seconds.
The new classifier, developed with Microsoft Applied Sciences, examines the code around a candidate to catch unstructured secrets like plain database passwords. GitHub says it assesses a whole set of candidates in less than two milliseconds and could more than double the number of secrets push protection prevents. GitHub's data also pushes back on the idea that AI agents make developers careless: from Q2 2024 to Q2 2026, screened public pushes grew 2.84 times while pushes containing credentials grew 2.59 times, with no detectable rise in the share of pushes carrying secrets, and the share of blocks developers overrode fell from 6.63% to 3.93%.
The feature is in private preview and becomes available later in October to organizations with GitHub Secret Protection on Enterprise Cloud and Team plans, consuming AI credits. It ships in public preview with GitHub Enterprise Server 3.23, including air-gapped environments, and the classifier is being added to the /security-review command in Copilot CLI and the Copilot app, so Copilot users can check for secrets before pushing even without Secret Protection.