/ Модель

Характеристики

Контекст
7 999 токенов
Параметры
16,8 млн
Лицензия
Apache 2.0
Архитектура
modernbert · dense
Базовая модель
ettin-encoder-17m
Опубликована
30 окт 2026

cbx-secrets-detector-17M

Заполнение пропусковТекст → текст7 профессий

Компактная англоязычная модель ModernBERT для поиска и классификации секретов и учётных данных в коде, конфигурациях, журналах и переписке.

1 895скачиваний за 30 дней4лайкавеса обновлены30 окт 2026

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

cbx-secrets-detector-17M — англоязычная модель CobuildX для обнаружения секретов и учётных данных в исходном коде, конфигурациях, журналах, заявках и переписке. Это дообученный на базе jhu-clsp/ettin-encoder-17m энкодер ModernBERT с 16,8 млн параметров и контекстом до 7 999 токенов; модель относит фрагменты текста к 12 типам секретов и возвращает их точные позиции.

Модель предназначена для поиска паролей, API-ключей, токенов, приватных ключей и учётных данных облачных и баз данных. Она использует контекст, чтобы находить значения без фиксированного префикса и не помечать типичные заглушки, ссылки на переменные, хеши и заведомо фиктивные значения. По данным README, обработка текста из 1 000 токенов занимает около 6 мс на GPU и 37 мс на CPU.

Ограничения: модель обучена только для английского языка; длинные последовательности случайно выглядящих символов могут вызывать ложные срабатывания, а секреты без характерного префикса или контекстного названия она может пропускать. Она не проверяет, действителен ли секрет, и не гарантирует обнаружение всех утечек, поэтому результаты требуют проверки. Лицензия — Apache-2.0.

Сценарии применения

  • поиск паролей и токенов в исходном коде
  • обнаружение API-ключей в конфигурационных файлах
  • поиск учётных данных баз данных в журналах
  • сканирование заявок и переписки на утечки секретов
  • выделение точных фрагментов с приватными ключами и облачными учётными данными

Ограничения

Модель предназначена для английского текста; длинные случайно выглядящие последовательности могут вызывать ложные срабатывания, а секреты без характерного префикса или контекстной подсказки — пропускаться. Она не проверяет действительность секрета и не гарантирует обнаружение всех утечек; тип метки также может быть неоднозначным.

Для каких профессий подходит7

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Также подходит для

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

cbx-secrets-detector-17M

Finds secrets and credentials (passwords, API keys, tokens, private keys, cloud and database credentials) in code, config files, logs, tickets and chat, and returns the exact position of each value with one of 12 labels. 17M parameters; about 6 ms per 1,000 tokens on a GPU and 37 ms on a CPU.

This is the fastest size, and the one to use on a CPU. Fine-tuned from jhu-clsp/ettin-encoder-17m. Version v0.1, the first release (use --revision v0.1 to pin it). Also available in 32M.

Unlike rule-based scanners, it reads the context: it finds passwords and keys that have no fixed prefix, and it leaves alone placeholders, variable references, hashes and obviously fake values.

Labels

LabelCovers
PASSWORDPasswords and passphrases: logins, service accounts, keystores, key derivation
DATABASE_CREDENTIALA database connection URI that holds a password (the whole URI), or a database password
API_KEYKeys for calling an API or service (sk_live_…, hex service keys)
ACCESS_TOKENBearer and access tokens that are not JWTs: OAuth tokens, personal access tokens (ghp_…)
JWT_TOKENWell-formed JWTs (eyJ….….…)
SESSION_SECRETSecrets that sign or encrypt sessions or cookies
WEBHOOK_SECRETSecrets that sign or verify webhook deliveries (whsec_…)
CLOUD_CREDENTIALCloud provider secrets: AWS secret access keys, cloud client secrets
PRIVATE_KEYPrivate keys (PEM, OpenSSH, service-account private_key), the whole block
CERTIFICATE_SECRETCertificate bundles that contain a private key (PKCS#12 / PFX)
ENCRYPTION_KEYSymmetric encryption keys (AES keys, data keys, master keys)
GENERIC_SECRETA secret whose type the text does not say

Not secrets (not labelled): references such as ${API_KEY} or os.environ["X"]; placeholders such as <your-api-key> or CHANGEME; masked values; identifiers (AWS access key IDs AKIA…, UUIDs, account and request ids, usernames); public keys and certificates; hashes and digests, including git commit SHAs; documented example values such as AKIAIOSFODNN7EXAMPLE. A realistic value is labelled even when its name says "test" or "example": the model cannot know whether it is live.

How to use

1. Download and install

pip install -U huggingface_hub
hf download CobuildX-AI/cbx-secrets-detector-17M --revision v0.1 --local-dir cbx-secrets-detector-17M
cd cbx-secrets-detector-17M
pip install -r requirements.txt

2. Use it in your code

SecretDetector (in cbx_secrets.py, part of this repo) loads the model once:

from cbx_secrets import SecretDetector

det = SecretDetector()                 # uses a GPU if one is available
text = 'STRIPE_SECRET_KEY=sk_live_4eC39HqLyjWDarjtT1zdp7dcQw8vXk2Z'
det.extract(text)
# [{'label': 'API_KEY', 'text': 'sk_live_4eC39HqLyjWDarjtT1zdp7dcQw8vXk2Z', 'start': 18, 'end': 58}]

det.redact(text)
# 'STRIPE_SECRET_KEY=[API_KEY]'

det.extract(text, labels=["PASSWORD", "PRIVATE_KEY"])   # keep only some labels
  • Context length is 7,999 tokens, read in a single pass. Longer texts are split into overlapping pieces automatically.
  • redact() replaces each value found with its label, or with your own template.
  • The values in these examples are invented.

3. Optional: check your setup

python example.py runs four sample texts (all values invented) and prints what it finds.

Results

Span F1, label-agnostic: a found value counts if it overlaps a true secret, whatever its label (the benchmarks and the scanners use different type names). Precision and recall in brackets. "False alarms" is the share of labelled non-secret lines or candidates on which something is flagged.

ModelCredData testfalse alarmsIssue reports testfalse alarmsCBX secrets test
cbx-secrets-detector-17M0.805 (0.80 / 0.81)0.9%0.836 (0.90 / 0.78)0.9%0.983 (0.99 / 0.98)
cbx-secrets-detector-32M0.820 (0.77 / 0.87)1.3%0.861 (0.86 / 0.86)1.4%0.998 (1.00 / 1.00)
Gitleaks 8.30.10.442 (0.90 / 0.29)0.6%0.678 (0.93 / 0.54)0.5%0.757 (0.99 / 0.61)
detect-secrets 1.5.00.460 (0.47 / 0.45)9.8%0.290 (0.40 / 0.23)4.0%0.626 (0.90 / 0.48)
TruffleHog 3.99.20.042 (0.38 / 0.02)0.8%0.228 (0.66 / 0.14)0.9%0.215 (1.00 / 0.12)
  • CredData test: Samsung CredData (secrets obfuscated by Samsung): the test half of the repositories, 168 repositories with 3,493 secrets and 17,961 labelled non-secret lines. No test repository was used for training or for choosing the model.
  • Issue reports test: the test split of the issue-report dataset of Ahmed et al. (see Training data): 949 secrets and 8,132 non-secret candidates, scored per candidate. Texts that also appear in its training split were removed.
  • CBX secrets test: our own held-out test data, generated by CobuildX and checked against our annotation guide: 3,000 texts with 3,136 secrets across all 12 labels. With the label required to match exactly as well, this model scores 0.961 (per label: CERTIFICATE_SECRET 1.00, ENCRYPTION_KEY 1.00, JWT_TOKEN 1.00, PRIVATE_KEY 1.00, API_KEY 1.00, WEBHOOK_SECRET 0.99, CLOUD_CREDENTIAL 0.99, ACCESS_TOKEN 0.99, SESSION_SECRET 0.97, GENERIC_SECRET 0.94, DATABASE_CREDENTIAL 0.90, PASSWORD 0.89). It comes from the same generators as part of the training data, so it overstates accuracy on real text; the two benchmarks above are the better guide.
  • Scanners were run offline with their default rules and no live verification; TruffleHog normally relies on verification, so its numbers here understate it.

Speed. Median 6 ms (p95 6 ms) per text of 1,000 tokens on an NVIDIA TITAN RTX (fp16), 37 ms (p95 38 ms) on an Intel i7-10700 CPU with 8 threads; texts processed one at a time, end to end (text in, spans out).

Limitations

  • English only. Trained for code, config files, logs, tickets and chat.
  • Long encoded data: on long runs of random-looking characters (an inline base64 source map, a minified bundle, a log full of hex session ids) the model can flag many short pieces as secrets. Skip minified and generated files where you can.
  • Recall is lower for tokens with no known prefix and no telling name nearby (key, token, password).
  • Labels are less certain than detection: a password in a database context can be labelled PASSWORD or DATABASE_CREDENTIAL (exact F1 on our test set 0.89 for the weaker of the two), and a database URI is sometimes returned as two spans split at the password.
  • It does not check whether a secret is live, and it can miss secrets: use it as a detection aid alongside rotation and review, not as a guarantee.

Training data

  • CBX secrets train data: generated by CobuildX and checked against our annotation guide: code, configs, logs, chat and documents with invented secrets and hard negatives (placeholders, references, hashes, fake values).
  • Samsung CredData (lines and labels from 116 repositories with MIT, Apache-2.0 or BSD licences; values already obfuscated by Samsung). The repositories and their licences are listed in training_data_sources.csv.
  • Issue reports: the training split of Secret Leak Detection in Software Issue Reports using LLMs, Ahmed et al., arXiv:2410.23657, dataset 10.5281/zenodo.19622962, licensed CC BY 4.0. Changed: every real secret was replaced by an invented value of the same shape before training, and texts were cut into windows. No real secret from this dataset is in the model's training data or in this repository.

Licence

Apache-2.0. Base model: Ettin (MIT, arXiv:2507.11412).

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · fill-mask

Можно запустить

Подбираем GPU…

Класс архитектуры
ModernBertForMaskedLM
Ревизия весов
89362a0

0 моделей