sentence-transformers
Safetensors
setfit
English
bert
code-security
vulnerability-detection
sast
spidercob
Eval Results (legacy)
Instructions to use Sumeetgpt/code-risk-classifier with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use Sumeetgpt/code-risk-classifier with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("Sumeetgpt/code-risk-classifier") sentences = [ "The weather is lovely today.", "It's so sunny outside!", "He drove to the stadium." ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [3, 3] - setfit
How to use Sumeetgpt/code-risk-classifier with setfit:
from setfit import SetFitModel model = SetFitModel.from_pretrained("Sumeetgpt/code-risk-classifier") - Notebooks
- Google Colab
- Kaggle
Code Risk Classifier
Fine-tuned SetFit model for code security risk classification. Part of the Spidercob DLP platform โ reduces false positives in supply-chain and secret scanning.
Model Description
Classifies code snippets into one of four risk categories:
| Label | Description |
|---|---|
REAL_SECRET |
Actual hardcoded credentials, API keys, or tokens |
VULNERABLE_LOGIC |
Code patterns associated with known CVEs or insecure practices |
TEST_MOCK |
Test fixtures, mock data, example credentials in test files |
SAFE_CODE |
Benign code with no security concerns |
Base model: sentence-transformers/all-MiniLM-L6-v2
Framework: SetFit (few-shot fine-tuning)
Test accuracy: 98.09%
Usage
from setfit import SetFitModel
model = SetFitModel.from_pretrained("Sumeetgpt/code-risk-classifier")
predictions = model.predict([
'API_KEY = "sk-prod-abc123real"',
'API_KEY = "test_placeholder_key"',
])
print(predictions) # ['REAL_SECRET', 'TEST_MOCK']
Intended Use
Used inside the Spidercob supply-chain scanner to filter CVE findings and secret detections. Prevents alert fatigue from test fixtures and example configs while surfacing genuine security risks.
Training Data
Trained on examples from:
- WebGoat (vulnerable Java web application)
- DVWA (Damn Vulnerable Web Application)
- truffleHog secret detection corpus
- factory_boy, faker, pytest fixtures
- Django, FastAPI secure coding examples
Limitations
- Optimized for short code snippets (single lines to a few lines of context)
- Works best with Python, JavaScript, Java โ limited training on other languages
- Not a standalone SAST tool โ designed as a downstream classifier for pattern-matched findings
- Downloads last month
- 12
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐ Ask for provider support
Model tree for Sumeetgpt/code-risk-classifier
Base model
nreimers/MiniLM-L6-H384-uncased Quantized
sentence-transformers/all-MiniLM-L6-v2Evaluation results
- accuracyself-reported0.981