Model Details of SecureBERT2.0-code-vuln-detection
Model Card for CiscoAI/SecureBERT2.0-code-vuln-detection
The
ModernBERT Code Vulnerability Detection Model
is a fine-tuned variant of
SecureBERT 2.0
, designed to detect potential vulnerabilities in source code.
It leverages cybersecurity-aware representations learned by SecureBERT 2.0 and applies supervised fine-tuning for binary classification (vulnerable vs. non-vulnerable).
Model Details
Model Description
This model classifies source code snippets as either
vulnerable
or
non-vulnerable
using the ModernBERT architecture.
It is fine-tuned for
code-level security analysis
, extending the capabilities of SecureBERT 2.0.
Automatic vulnerability classification for source code snippets
Static analysis pipeline integration for pre-screening code risks
Feature extraction for downstream vulnerability detection tasks
Downstream Use
Can be integrated into:
Secure code review systems
CI/CD vulnerability scanners
Security IDE extensions
Out-of-Scope Use
Non-code or natural language text classification
Runtime or dynamic vulnerability detection
Automated patch generation or remediation suggestion
Bias, Risks, and Limitations
The model may
overfit
to syntactic patterns from training datasets and miss logical vulnerabilities.
False negatives
(missed vulnerabilities) or
false positives
(benign code flagged as vulnerable) may occur.
Training data may not include all programming languages or frameworks.
Recommendations
Users should use this model
as an assistive tool
, not as a replacement for expert manual code review.
Cross-validation with multiple tools is recommended before security-critical decisions.
How to Get Started with the Model
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Path to the model
model_dir = "cisco-ai/SecureBERT2.0-code-vuln-detection"# Load tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_dir)
model = AutoModelForSequenceClassification.from_pretrained(model_dir)
# Example input code snippet
example_code = """static void FUNC_0(WmallDecodeCtx *VAR_0, int VAR_1, int VAR_2, int16_t VAR_3, int16_t VAR_4){ int16_t icoef; int VAR_5 = VAR_0->cdlms[VAR_1][VAR_2].VAR_5; int16_t range = 1 << (VAR_0->bits_per_sample - 1); int VAR_6 = VAR_0->bits_per_sample > 16 ? 4 : 2; if (VAR_3 > VAR_4) { for (icoef = 0; icoef < VAR_0->cdlms[VAR_1][VAR_2].order; icoef++) VAR_0->cdlms[VAR_1][VAR_2].coefs[icoef] += VAR_0->cdlms[VAR_1][VAR_2].lms_updates[icoef + VAR_5]; } else { for (icoef = 0; icoef < VAR_0->cdlms[VAR_1][VAR_2].order; icoef++) VAR_0->cdlms[VAR_1][VAR_2].coefs[icoef] -= VAR_0->cdlms[VAR_1][VAR_2].lms_updates[icoef]; } VAR_0->cdlms[VAR_1][VAR_2].VAR_5--;}"""# Tokenize and run model
inputs = tokenizer(example_code, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
predicted_class = torch.argmax(logits, dim=-1).item()
print(f"Predicted class ID: {predicted_class}")
Evaluation
Testing Data, Factors & Metrics
Testing Data
Internal validation split from annotated open-source vulnerability datasets.
SecureBERT 2.0 demonstrates the best
overall balance of accuracy, F1, and precision
among the compared models.
While CyBERT achieves the highest recall (detecting all vulnerabilities), it suffers from low precision, indicating many false positives.
Conversely, CodeBERT exhibits strong precision but poor recall, missing a large portion of true vulnerabilities.
SecureBERT 2.0 achieves
more consistent and stable performance across all metrics
, reflecting its stronger domain adaptation from cybersecurity-focused pretraining.
@article{aghaei2025securebert,
title={SecureBERT 2.0: Advanced Language Model for Cybersecurity Intelligence},
author={Aghaei, Ehsan and Jain, Sarthak and Arun, Prashanth and Sambamoorthy, Arjun},
journal={arXiv preprint arXiv:2510.00240},
year={2025}
}
SecureBERT2.0-code-vuln-detection huggingface.co is an AI model on huggingface.co that provides SecureBERT2.0-code-vuln-detection's model effect (), which can be used instantly with this cisco-ai SecureBERT2.0-code-vuln-detection model. huggingface.co supports a free trial of the SecureBERT2.0-code-vuln-detection model, and also provides paid use of the SecureBERT2.0-code-vuln-detection. Support call SecureBERT2.0-code-vuln-detection model through api, including Node.js, Python, http.
SecureBERT2.0-code-vuln-detection huggingface.co is an online trial and call api platform, which integrates SecureBERT2.0-code-vuln-detection's modeling effects, including api services, and provides a free online trial of SecureBERT2.0-code-vuln-detection, you can try SecureBERT2.0-code-vuln-detection online for free by clicking the link below.
cisco-ai SecureBERT2.0-code-vuln-detection online free url in huggingface.co:
SecureBERT2.0-code-vuln-detection is an open source model from GitHub that offers a free installation service, and any user can find SecureBERT2.0-code-vuln-detection on GitHub to install. At the same time, huggingface.co provides the effect of SecureBERT2.0-code-vuln-detection install, users can directly use SecureBERT2.0-code-vuln-detection installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
SecureBERT2.0-code-vuln-detection install url in huggingface.co: