GitHub adds fast AI classifier to block unstructured secrets at push

GitHub has built a fine-tuned classifier with Microsoft Applied Sciences that extends push protection to unstructured secrets such as internal database passwords. According to GitHub, the model assesses a set of candidate secrets in under two milliseconds and could more than double the number of secrets it can prevent.
- GitHub says one in three pull requests now involves an AI agent, up from fewer than one in 10 a year ago.
- Screened pushes grew 2.84 times while pushes with credentials grew 2.59 times, with no detectable per-push trend.
- A new ModernBERT classifier, built with Microsoft Applied Sciences, evaluates candidate batches in under two milliseconds.
- GitHub says it could more than double the number of secrets it prevents; push protection is in private preview.
- The model reaches Enterprise Cloud and GitHub Teams with Secret Protection later this month and consumes AI credits.
Agents are changing the pace of code creation
GitHub says one in three pull requests on the platform now involves an AI agent, up from fewer than one in 10 a year ago. If that pace holds, the company argues, most code pushed to GitHub could be written by an agent within two years, and much of it may never be fully read by a human.
The post, written by the product lead for secret scanning, rejects the idea that AI has made developers careless. Between Q2 2024 and Q2 2026, screened pushes grew 2.84 times while pushes carrying credentials grew 2.59 times. Across nine complete quarters, GitHub found no statistically detectable trend in per-push prevalence. In Q2 2026, 574M public pushes were screened, and 0.47% contained secrets.
GitHub also points to developer behavior. The share of push-path blocks that developers overrode fell linearly from 6.63% to 3.93% over the same period. In the company's words, developers are "being outpaced" rather than becoming careless.
Prevention scales with compute, remediation with people
GitHub says a new secret appears in publicly visible code about once every two seconds, and that this rate has doubled yearly for three years. At a fixed rate, more activity means more exposures, and if each one needs a human response, the workload grows with it. The mean time to manually revoke a secret is around 40 days, and roughly one in five took more than 90 days.
The company describes two existing layers. Through its secret scanning partnership program, which covers more than 150 technical partners, GitHub reports public exposures to issuers so they can respond. In Q2 2026, public scanning reported an average of 26 credential matches a second, including repeat observations. Many partners revoke tokens immediately, including OpenAI API keys, Google Cloud account credentials, Slack webhooks, Hugging Face user tokens and SendGrid keys.
Push protection acts earlier, stopping recognizable credentials before they enter repository history. In the past month, GitHub says, push protection blocked a secret at least once every second. When additional secret types are included, it stops about 30% of newly detected secrets before they enter history. The other 70% are found after the credential is already lost.
The four-body problem and the ModernBERT classifier
Unstructured secrets are harder. A provider token may have a recognizable prefix, but an internal database password may have no identifying pattern. GitHub calls the challenge a "four-body problem": precision, latency, throughput and cost are coupled constraints. A false positive interrupts a developer and makes the next block harder to trust, while a slow or expensive check limits how often it can run.
GitHub's answer is a ModernBERT classifier that assesses candidate secrets in context without generating code or prose. According to GitHub, it is more precise than existing LLM-based pipelines, evaluates candidate batches in under two milliseconds and is cost efficient enough to run in the critical path. The model uses surrounding code to block password-like values in a database URL, Kubernetes Secret manifest and Dockerfile, while allowing a placeholder such as changeme.
Availability and what it means for users
The push protection feature is in private preview. Later this month, it will be available to organizations with GitHub Secret Protection across Enterprise Cloud and GitHub Teams, and it will consume AI credits.
- Organizations with AI secret detection are automatically updated to the new model starting today. Alerts from post-push scans remain included with secret scanning at no additional cost.
- The model will ship with GitHub Enterprise Server 3.23 in public preview, bringing AI-detected alerts to Secret Protection customers in air-gapped environments.
- The classifier is being added to the /security-review command in the Copilot CLI and Copilot App, so Copilot users can address secrets before a push without a GitHub Secret Protection plan. AI credit usage will be attributed to GitHub Secret Protection in AI usage insights.
GitHub says its goal is for the number of people an organization needs to keep credentials safe to stop scaling with the amount of code it writes.
GitHub: Secret protection must scale with software


