GitHub Deploys ModernBERT Classifier to Cut Secret Detection Costs and False Positives
GitHub replaced its large language model secret detection system with a custom ModernBERT classifier. This change cuts median post-push scan time by 86 percent and lowers inference costs by over 98 percent. The update also adds context-aware generic secret detection to the push protection system. This lets the platform block credentials before they enter a repository instead of just warning users after a commit.
How GitHub’s Two-Stage Secret Scanning Pipeline Works
Finding generic secrets is hard because high-entropy strings often look like build identifiers, checksums, and asset hashes. CybersecurityNews noted that "a thousand regex hits hide the ten live credentials that matter".
GitHub designed a two-stage pipeline to solve this problem. The first stage uses regex filters to cast a wide net and generate candidates with high recall. The second stage then passes these candidates to a fine-tuned ModernBERT classifier for review.
The classifier checks the candidate alongside its file path, variable names, and surrounding code. This context helps it separate real secrets from placeholders or test fixtures. This context-aware approach yielded an 11.5% user acceptance improvement by filtering out false positives before they reach developers.
Why GitHub Replaced LLMs with a Fine-Tuned ModernBERT Model
GitHub switched from an LLM-based pipeline to a specialized, smaller model to meet strict latency and cost requirements for real-time push protection. LLMs are computationally expensive and too slow to evaluate every commit at GitHub’s scale without causing workflow friction.
Using ModernBERT helped GitHub achieve more than 98% cost savings compared to its previous LLM architecture. This efficiency makes it practical to run generic secret detection synchronously during a push. It removes the need to rely solely on asynchronous post-push scanning.
Welcome.AI says this shift aligns with GitHub’s strategy to integrate advanced security features into its subscription tiers. Specifically, it requires GitHub Secret Protection (GHSP) or GitHub Advanced Security (GHAS) for AI push protection.
How the Update Shifts the Secrets Detection Landscape
CybersecurityNews reports that GitHub’s native scanning ranks third in the broader secrets detection market, sitting behind GitGuardian and Truffle Security. Third-party tools excel in live-verification and cross-platform sprawl, but GitHub’s advantage is native integration at the point of commit.
SentinelOne notes that secret sprawl occurs when credentials spread uncontrolled across repositories, issues, pull requests, and wikis. Catching generic secrets at the push stage shifts the remediation burden from security teams reviewing backlogs to developers fixing code in real time.
"Secret scanning works best when developers are confident in the findings." — GitHub Engineering
What Developers Need to Know About GitHub’s New AI Credits
This update adds specific billing rules for the new features, but existing GHSP and GHAS customers get free upgrades. According to daily.dev, their AI secret alerts are automatically upgraded to the new model at no extra cost.
However, new opt-in checks for push protection and the Copilot /security-review command will use AI Credits once billing starts. This model is also expanding to GitHub Enterprise Server 3.23 in public preview. This update lets administrators set budgets and disable features by policy, while specifically targeting passwords without recognizable token formats.
