Skip to content
worth noting Security

GitHub described credential detection combining regex and the ModernBERT model

only one source so far

GitHub deployed a scanner that uses regex to find possible credentials and the ModernBERT model to assess them in context. According to the company, the median scanning time after changes were pushed fell by 86 %, making it possible to extend detection to push protection.

GitHub described a deployed credential detection scanner that combines regex rules with a fine-tuned ModernBERT model. According to the company, the median scanning time after changes were pushed fell by 86 % compared with the previous LLM-based approach. The company says this speedup made it possible to extend generic credential detection to push protection, which checks changes before they are pushed.

Regex rules first find strings that resemble credentials. The ModernBERT model then assesses their value, file path, credential type, variable names, and surrounding code or text. Based on the resulting score, the scanner generates alerts or filters out likely harmless values, such as example credentials, checksums, and values in tests.

During training, the company emphasized examples of both real credentials and similar harmless strings. Before splitting the data, it grouped related examples to prevent nearly identical records from appearing in both training and evaluation. It selected decision thresholds during offline evaluation and then verified the behavior on traffic resembling a production environment.

What changed

Why it matters

The approach described provides concrete guidance for designing sensitive data detection: rules quickly find candidates, while a classifier handles cases where the surrounding context is decisive. Internal measurements by GitHub also show how shortening a scan can make it possible to run it before changes are pushed.

Two audiences, two different impacts

What this means

01

For individuals

Extending detection to push protection allows developers to address a suspected credential before pushing changes to the repository.

What to do When an alert appears, check the value and the surrounding code to verify whether it is a real credential or an example value.
More practical updates →
02

For a business

For businesses, the approach targets both the risk of credential leaks and the work involved in handling false alerts. According to GitHub, the classifier is intended to filter out harmless strings before they reach developers.

Risks and compliance
What to decide When evaluating a similar scanner, include both real credentials and harmless strings with a similar format in the test data, and track both detected credentials and false alerts.
More business impacts →
GitHub ModernBERT push protection secret scanning

Check the original

Event sources

only one source so far · 1 publisher, 0 independent. We count feeds from the same owner only once.

1
GitHub Blog primary source · first detected GitHub’s model for secret detection: Finding more secrets with less noise