GitHub has introduced a fine-tuned AI model that looks for unstructured secrets, such as passwords that follow no recognizable format, in code pushed to its platform, the company said Wednesday in a post on the GitHub Blog. GitHub says the classifier could more than double the number of leaked secrets it is able to block.

What Happened

The new detector is built on ModernBERT, an encoder model, and assesses each candidate string in context rather than generating code or text. GitHub says it evaluates candidates in under 2 milliseconds, fast enough to run inside the push path where developers' commits are checked before they reach a repository.

The model is in private preview. GitHub plans to make it generally available later in October for organizations that use GitHub Secret Protection on Enterprise Cloud and Team plans, and the expanded AI detection consumes AI credits. GitHub Enterprise Server 3.23 will include it in public preview for self-hosted and air-gapped environments, and it is available now through a security review command in Copilot CLI and the Copilot app.

RelatedNew curl Release Fixes 24 Flaws, Including a High-Severity Bug Reported With Anthropic’s Claude

The announcement, written by GitHub product manager Erin Havens, came with a set of statistics on how secrets leak. In the second quarter of 2026, GitHub screened 574 million public pushes and found secrets in 0.47% of them. Push protection blocked at least one secret every second over the past month, the company said. When developers hit a block, they are overriding it less often than before: the override rate fell steadily from 6.63% to 3.93% between the second quarter of 2024 and the second quarter of 2026.

Why It Matters

Pattern-based secret scanning works well for credentials with a known shape, such as cloud provider keys with fixed prefixes. Generic passwords, connection strings and internal tokens are harder to catch because they look like ordinary strings, and that category is the one the new model targets.

Speed matters because cleanup is slow. GitHub says it takes an average of about 40 days to revoke a leaked secret manually, and roughly one in five revocations takes more than 90 days. Stopping a credential at the push stage avoids that window entirely.

GitHub links the timing to AI coding agents. It says one in three pull requests on its platform now involves an AI agent, compared with fewer than one in 10 a year earlier, which raises the volume of code being pushed and the number of chances for a credential to slip through.

Context

Leaked credentials remain one of the most common ways attackers get into organizations, and public repositories are a steady source. Truffle Security recently reported finding more than 543,000 live credentials in public GitHub repositories. GitHub also runs a secret scanning partner program with more than 150 providers, which notifies issuers when their tokens appear in public code so they can be revoked.

What to Watch

The key date is general availability later in October. Because the AI detection draws on AI credits, how GitHub prices that usage may decide whether organizations turn it on across all repositories or only the most sensitive ones. False-positive rates outside the preview, and whether the model's coverage reaches Enterprise Server customers beyond the 3.23 preview, are the other open questions.