should probably proofread and complete it, then remove this comment. -->
1
7 commits
1 linked in READMEs
updated Jan 2, 2026
A fine-tuned ModernBERT model for detecting Personally Identifiable Information (PII) in text before it's accidentally leaked.
This model performs Named Entity Recognition (NER) to identify 27 types of sensitive information commonly found in code, configuration files, chat messages, and documents.
Base model: answerdotai/ModernBERT-base
Task: Token Classification (NER)
Training data: 150K synthetic examples with intentional variation to prevent overfitting
F1 Score: 0.97 on held-out test set
| Category | Entities |
|---|---|
| Financial (PCI-DSS) | CREDIT_CARD, PCI_PAN, PCI_TRACK, PCI_EXPIRY |
| Security Credentials | API_KEY, AWS_KEY, PRIVATE_KEY, PASSWORD |
| Healthcare (HIPAA) | HIPAA_MRN, HIPAA_ACCOUNT, HIPAA_DOB |
| European (GDPR) | GDPR_PASSPORT, GDPR_NIN, GDPR_IBAN |
| Identity | NAME, FIRST_NAME, LAST_NAME, SSN, DOB, DRIVER_LICENSE |
| Contact | EMAIL, PHONE, IP_ADDRESS |
| Address | STREET, CITY, STATE, ZIPCODE |
Stripe (sk_live_, pk_test_), OpenAI (sk-), Anthropic (sk-ant-), GitHub (ghp_, github_pat_), Slack (xoxb-), AWS (AKIA...), SendGrid (SG.), and generic patterns.
✅ Primary use case: Browser extension or IDE plugin that warns users before pasting sensitive data into web forms, chat apps, or public repositories.
✅ Other valid uses:
⚠️ Not a security guarantee. This model is a helpful tool, not a replacement for proper secrets management.
⚠️ False negatives are possible. The model may miss:
⚠️ False positives may occur on:
⚠️ Known limitations:
from transformers import pipeline
detector = pipeline(
"token-classification",
model="joneauxedgar/pasteproof-pii-detector-v3",
aggregation_strategy="simple"
)
text = '''const config = {
apiKey: "sk_live_abc123def456",
email: "[email protected]"
};'''
results = detector(text)
for entity in results:
print(f"{entity['entity_group']}: {entity['word']} ({entity['score']:.1%})")
Output:
API_KEY: sk_live_abc123def456 (99.9%)
EMAIL: [email protected] (99.9%)
To prevent overfitting, the training data includes:
data, x, field1 instead of apiKey)| Metric | Score |
|---|---|
| Precision | 0.968 |
| Recall | 0.976 |
| F1 | 0.972 |
The model correctly ignores:
[email protected] (placeholder email)4111111111111111 (test credit card)123-45-6789 (example SSN)process.env.API_KEY (reference, not a value)The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 |
|---|---|---|---|---|---|---|
| 0.0079 | 0.2667 | 1000 | 0.0062 | 0.9194 | 0.9521 | 0.9354 |
| 0.006 | 0.5333 | 2000 | 0.0051 | 0.9318 | 0.9605 | 0.9459 |
| 0.0044 | 0.8 | 3000 | 0.0052 | 0.9516 | 0.9645 | 0.9580 |
| 0.0048 | 1.0667 | 4000 | 0.0048 | 0.9542 | 0.9698 | 0.9619 |
| 0.0036 | 1.3333 | 5000 | 0.0039 | 0.9626 | 0.9707 | 0.9666 |
| 0.0043 | 1.6 | 6000 | 0.0038 | 0.9559 | 0.9688 | 0.9623 |
| 0.0043 | 1.8667 | 7000 | 0.0035 | 0.9610 | 0.9724 | 0.9667 |
| 0.0027 | 2.1333 | 8000 | 0.0031 | 0.9627 | 0.9735 | 0.9681 |
| 0.0027 | 2.4 | 9000 | 0.0031 | 0.9651 | 0.9750 | 0.9700 |
| 0.0029 | 2.6667 | 10000 | 0.0036 | 0.9575 | 0.9742 | 0.9658 |
| 0.0027 | 2.9333 | 11000 | 0.0029 | 0.9681 | 0.9761 | 0.9721 |
@model{pasteproof_pii_detector,
author = {Jonathan Edgar},
title = {PasteProof PII Detector},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/joneauxedgar/pasteproof-pii-detector-v3}
}
Part of the PasteProof project - preventing accidental data leaks before they happen.
BSL 1.0 Use for individual or research purposes. Reach out [email protected] for commercial license or usage questions.
should probably proofread and complete it, then remove this comment. -->
1
7 commits
1 linked in READMEs
updated Jan 2, 2026
A fine-tuned ModernBERT model for detecting Personally Identifiable Information (PII) in text before it's accidentally leaked.
This model performs Named Entity Recognition (NER) to identify 27 types of sensitive information commonly found in code, configuration files, chat messages, and documents.
Base model: answerdotai/ModernBERT-base
Task: Token Classification (NER)
Training data: 150K synthetic examples with intentional variation to prevent overfitting
F1 Score: 0.97 on held-out test set
| Category | Entities |
|---|---|
| Financial (PCI-DSS) | CREDIT_CARD, PCI_PAN, PCI_TRACK, PCI_EXPIRY |
| Security Credentials | API_KEY, AWS_KEY, PRIVATE_KEY, PASSWORD |
| Healthcare (HIPAA) | HIPAA_MRN, HIPAA_ACCOUNT, HIPAA_DOB |
| European (GDPR) | GDPR_PASSPORT, GDPR_NIN, GDPR_IBAN |
| Identity | NAME, FIRST_NAME, LAST_NAME, SSN, DOB, DRIVER_LICENSE |
| Contact | EMAIL, PHONE, IP_ADDRESS |
| Address | STREET, CITY, STATE, ZIPCODE |
Stripe (sk_live_, pk_test_), OpenAI (sk-), Anthropic (sk-ant-), GitHub (ghp_, github_pat_), Slack (xoxb-), AWS (AKIA...), SendGrid (SG.), and generic patterns.
✅ Primary use case: Browser extension or IDE plugin that warns users before pasting sensitive data into web forms, chat apps, or public repositories.
✅ Other valid uses:
⚠️ Not a security guarantee. This model is a helpful tool, not a replacement for proper secrets management.
⚠️ False negatives are possible. The model may miss:
⚠️ False positives may occur on:
⚠️ Known limitations:
from transformers import pipeline
detector = pipeline(
"token-classification",
model="joneauxedgar/pasteproof-pii-detector-v3",
aggregation_strategy="simple"
)
text = '''const config = {
apiKey: "sk_live_abc123def456",
email: "[email protected]"
};'''
results = detector(text)
for entity in results:
print(f"{entity['entity_group']}: {entity['word']} ({entity['score']:.1%})")
Output:
API_KEY: sk_live_abc123def456 (99.9%)
EMAIL: [email protected] (99.9%)
To prevent overfitting, the training data includes:
data, x, field1 instead of apiKey)| Metric | Score |
|---|---|
| Precision | 0.968 |
| Recall | 0.976 |
| F1 | 0.972 |
The model correctly ignores:
[email protected] (placeholder email)4111111111111111 (test credit card)123-45-6789 (example SSN)process.env.API_KEY (reference, not a value)The following hyperparameters were used during training:
| Training Loss | Epoch | Step | Validation Loss | Precision | Recall | F1 |
|---|---|---|---|---|---|---|
| 0.0079 | 0.2667 | 1000 | 0.0062 | 0.9194 | 0.9521 | 0.9354 |
| 0.006 | 0.5333 | 2000 | 0.0051 | 0.9318 | 0.9605 | 0.9459 |
| 0.0044 | 0.8 | 3000 | 0.0052 | 0.9516 | 0.9645 | 0.9580 |
| 0.0048 | 1.0667 | 4000 | 0.0048 | 0.9542 | 0.9698 | 0.9619 |
| 0.0036 | 1.3333 | 5000 | 0.0039 | 0.9626 | 0.9707 | 0.9666 |
| 0.0043 | 1.6 | 6000 | 0.0038 | 0.9559 | 0.9688 | 0.9623 |
| 0.0043 | 1.8667 | 7000 | 0.0035 | 0.9610 | 0.9724 | 0.9667 |
| 0.0027 | 2.1333 | 8000 | 0.0031 | 0.9627 | 0.9735 | 0.9681 |
| 0.0027 | 2.4 | 9000 | 0.0031 | 0.9651 | 0.9750 | 0.9700 |
| 0.0029 | 2.6667 | 10000 | 0.0036 | 0.9575 | 0.9742 | 0.9658 |
| 0.0027 | 2.9333 | 11000 | 0.0029 | 0.9681 | 0.9761 | 0.9721 |
@model{pasteproof_pii_detector,
author = {Jonathan Edgar},
title = {PasteProof PII Detector},
year = {2025},
publisher = {Hugging Face},
url = {https://huggingface.co/joneauxedgar/pasteproof-pii-detector-v3}
}
Part of the PasteProof project - preventing accidental data leaks before they happen.
BSL 1.0 Use for individual or research purposes. Reach out [email protected] for commercial license or usage questions.