Artificial intelligence news.
Straight from the original announcements.

GitHub Trains ModernBERT Classifier to Cut Noise in Secret Scanning

October 13, 2026, 19:56By the AI News Bites Editorial TeamSource: GitHub
GitHub Trains ModernBERT Classifier to Cut Noise in Secret Scanning
Image: GitHub

GitHub has built a context-aware classifier for secret scanning that, according to the company, finds real credentials with fewer false alarms. The model, a fine-tuned ModernBERT, cut median post-push scan time by 86% compared with the previous LLM-based pipeline and made generic secret detection practical for push protection.

Key points
  • GitHub trained a fine-tuned ModernBERT classifier to separate real secrets from lookalikes in secret scanning.
  • According to GitHub, median post-push scan time fell 86% versus the previous LLM-based pipeline.
  • GitHub reports an 11.5% improvement in user acceptance and more than 98% cost savings.
  • Regex patterns still generate candidates; the classifier decides which become alerts.
  • The speed gain allowed generic secret detection to be extended to push protection.

The problem with generic secrets

GitHub says secret scanning works best when developers trust the findings. If a scanner catches too little, real credentials can stay in a repository. If it alerts too often, developers waste time on strings that are not secrets.

Generic secrets make this balance hard. Structured credentials often carry a distinctive prefix, length, alphabet or checksum, but generic ones may not. Their syntax overlaps with build identifiers, checksums, asset hashes and sample values. According to GitHub, context is the deciding signal. A password beside a production database URL is likely real, while the same value in a test fixture is likely harmless. A localhost connection string in a setup guide is another lookalike.

GitHub calls such strings hard negatives: they match a credential pattern but are not usable credentials. Adding more rules can suppress some of them, but the company says each exception risks hiding a real secret.

A two-stage pipeline

The new scanner works in two stages. First, regex filters scan content for potential secrets with high recall, catching broad families of credential-like patterns quickly and deterministically. Second, a fine-tuned ModernBERT classifier evaluates each candidate together with its file path, variable names and surrounding code or text.

The classifier estimates how likely a candidate is to be a real secret. High-confidence findings become alerts, while placeholders, test fixtures and checksums are filtered out before they reach developers. GitHub stresses that the model does not replace deterministic scanning but complements it. Regexes stay responsible for finding candidates, and machine learning handles the step of separating "looks like a secret" from "is likely a real secret."

GitHub chose ModernBERT because it is compact, efficient and well suited to classification over code-adjacent text. The company says it gives contextual understanding comparable to an LLM without the latency and computational overhead of generating natural-language output. It also notes that the classifier is a best-effort judgment, not a guarantee.

How the model was trained

GitHub says the hardest part was finding representative data for cases where syntax alone misleads. Training and evaluation combine three sources:

  • Product-derived examples from GitHub repositories, using feedback from the secret detection experience and additional human validation.
  • High-recall regex candidates from repository data, including human-annotated examples and weak labels used to expand coverage.
  • Synthetic examples aimed at sparse and difficult cases, such as documentation secrets, test fixtures, public keys, checksums, structured lookalikes and near-miss pairs.

Synthetic rows pass deterministic validation and model-based quality review before inclusion. Each model input includes the candidate value, file path, secret type and a bounded amount of surrounding context. Before splitting the data, GitHub grouped rows that share a repository, candidate value or example, so near-duplicates could not appear in both training and evaluation. Thresholds are chosen through offline evaluation and then validated on production-like traffic before broader rollout.

Results and what changes for developers

GitHub reports several gains over the previous LLM-based pipeline:

  • An 11.5% improvement in user acceptance, tied to fewer false positives.
  • An 86% lower median execution time for post-push scanning.
  • More than 98% cost savings, which the company attributes to the compact model compared with remote LLM calls.

Secret scanning operates at two moments. Push protection scans changes before a push is accepted, and post-push scanning continuously checks committed content and creates alerts. According to GitHub, the speed gain made it practical to extend generic secret detection to push protection, so developers get results before pushing changes and not only after code is committed.

For developers and security teams, the stated aim is fewer alerts about placeholders and test values, so attention goes to credentials that matter.

Related news

Vercel Security Review can scan GitHub repositories without projects
Safety and ethicsNovember 13, 2026

Vercel Security Review can scan GitHub repositories without projects

Vercel Security Review can now scan code changes in GitHub repositories that are not linked to a Vercel project. The change allows teams to review covered repositories…

Claude Code Settings Exposed 1,379 Secrets in Public GitHub Files
Safety and ethicsNovember 10, 2026, 16:59

Claude Code Settings Exposed 1,379 Secrets in Public GitHub Files

Claude Code’s approval settings exposed 1,379 distinct secrets across 1,122 public GitHub files, according to security company Apiiro’s research reported by The Hacker…

Datadog's AI Guard blocks unsafe agent actions at runtime, inside the agent loop
Safety and ethicsNovember 2, 2026

Datadog's AI Guard blocks unsafe agent actions at runtime, inside the agent loop

Datadog says security controls for AI agents must evaluate each action at runtime and judge intent, not just check static permissions. Its answer is AI Guard, which runs…