/ Модель

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

Лицензия
MIT
Опубликована
18 окт 2026

aparte-secrets

Разметка токеновТекст → label7 профессий

Компактная модель apartejs для поиска и классификации паролей, API-ключей, токенов и приватных ключей в сообщениях, исходном коде и конфигурациях.

79скачиваний за 30 дней0лайковвеса обновлены18 окт 2026

Бенчмарки

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

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

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

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

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

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

aparte-secrets — компактная модель apartejs для обнаружения паролей, API-ключей, токенов и приватных ключей в тексте. Это классификатор токенов на 168 597 параметров, обученный с нуля для одной задачи; версия 1.1 выпускается в нескольких вариантах точности, а пакет по умолчанию использует int8-файл размером около 196 КБ.

Модель выделяет фрагменты текста, присваивает им тип секрета и оценку уверенности. Она предназначена для локальной проверки сообщений перед отправкой в чат с ИИ, а также для сканирования исходного кода, конфигураций и истории изменений в pre-commit hook. По README, модель работает в браузере без API-вызова и интегрируется через npm-пакеты.

В карточке приведены результаты тестирования на англо- и франкоязычных сообщениях и репозиториях. В частности, для версии int8 указаны F1 0,76 на тесте чатов и 0,64 на длинных исходных файлах; в чистых репозиториях зафиксированы ложные срабатывания. Модель может пропускать секреты или выделять обычные значения, поэтому порог уверенности и правила игнорирования следует настраивать для конкретного проекта. Лицензия — MIT.

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

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

Ограничения

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

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

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

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

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

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

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

Открыть на Hugging Face

aparte-secrets

Finds passwords, API keys, tokens and private keys in text — in a 196 KB file, in the browser, with no API call.

aparte-secrets reads a chat message, a config file or source code and returns every secret it contains, with its exact position, its kind (password, api_key, token, private_key, other) and a confidence score. It is a token classifier of 168,597 parameters trained from scratch for this one task: no regex list, no entropy rule — the model reads the value and its context. It is meant to sit in front of an AI chat (mask a secret before the message leaves the device) and in a pre-commit hook.

What changed in 1.1

  • About 4 times fewer false alerts on ordinary source code and docs: 0.69 → 0.17 per 1,000 lines on two public repositories with no secret. Version 1 flagged identifiers (maxTurns, createAgUiRunner), CSS values and words after an escaped \n in JSON files.
  • Better on chat: strict F1 0.69 → 0.76, passwords 0.74 → 0.82, false alerts in messages without a secret 17 → 11.
  • Same architecture and runtime. The packages now bundle int8 (about 196 KB): the int4 file of this version is noisier on code than its fp32 (see Files). The v1 files stay in v1/.

What it returns

Real outputs of secrets-v1.1-int8.bin on a fixed list of examples (span → subtype (score)), mistakes included:

inputfound
my db password is Hunter2024! can you check why the login fails?Hunter2024! → password (0.89)
Le mot de passe du wifi de l'atelier c'est Biscotte19&, tu peux le noter ?Biscotte19& → password (1.00)
the wifi password is Sunflower77# for the guestsSunflower77# → password (0.92)
DB_HOST=localhost ⏎ DB_USER=app ⏎ DB_PASSWORD="t1?HQBFr=hHt_i+z9" ⏎ LOG_LEVEL=debugt1?HQBFr=hHt_i+z9 → password (0.85)
export OPENWEATHER_API_KEY=9b1c4e7f2a8d3b6c5e0f1a2b3c4d5e6f9b1c4e7f2a8d3b6c5e0f1a2b3c4d5e6f → api_key (0.99)
J'ai oublié le mot de passe de l'imprimante, comment le réinitialiser ?imprimante → password (0.92)
commit 3f2a9c1e8b7d6f5a4c3b2a1908f7e6d5c4b3a291, request id 123e4567-e89b-12d3-a456-426614174000nothing
password: changeme # put your own herenothing

How it compares

Every system on the same test sets.

Chat — chat-fresh: 440 English and French chat messages written after training and never used to tune anything (396 secrets; 110 messages talk about a password without giving one). Strict span precision, recall and F1, recall on passwords and on API keys of providers never seen in training, false alerts in the messages without a secret:

systemprecisionrecallF1passwordsunknown providersfalse alerts
aparte-secrets v1.1 (int8)0.760.760.760.820.9311 / 110
aparte-secrets v1 (int4)0.700.690.690.740.7917 / 110
OpenAI privacy-filter0.520.540.530.640.9555 / 110
detect-secrets 1.5.00.780.160.270.040.217 / 110
gitleaks 8.30.10.970.170.290.000.330 / 110

The same messages as JSON (escaped newlines and quotes, as in a log or an export, config chat-fresh-json):

systemprecisionrecallF1false alerts
aparte-secrets v1.1 (int8)0.610.570.598 / 110
aparte-secrets v1 (int4)0.550.530.5422 / 110

Clean repositories — every tracked file of two public repositories that hold no secret (1,387 files, 218,493 lines; clean_repos.py rebuilds the set). Everything flagged is a false alert; the models at the CLI's default threshold (0.5):

systemfalse alertsper 1,000 lines
aparte-secrets v1.1 (int8)370.17
aparte-secrets v1 (int4)1500.69
detect-secrets 1.5.0130.06
gitleaks 8.30.150.02

Long source files — 65 whole files (31,808 lines, 131 secrets) from the test repositories of CredData:

systemrecallfalse alerts per 1,000 linesF1
aparte-secrets v1.1 (int8)0.651.50.64
aparte-secrets v1 (int4)0.561.70.57
detect-secrets 1.5.00.531.50.56
gitleaks 8.30.10.140.10.24

CredData — the lines of its test repositories (split by repository: no repository is seen in training), relabeled to our contract (public identifiers such as UUIDs are not secrets). Span F1, then line-level precision, recall and F1 (the metric of the CredData README):

systemspan F1line precisionline recallline F1
aparte-secrets v1.1 (int8)0.720.850.850.85
aparte-secrets v1 (int4)0.740.880.840.86
OpenAI privacy-filter0.420.630.880.73
detect-secrets 1.5.00.410.540.590.57
gitleaks 8.30.10.340.930.240.39

Development set — gold: 775 chat messages, snippets and framework configs. The training data was tuned while watching it, so it flatters us; reported for completeness:

systemstrict F1partial F1
aparte-secrets v1.1 (int8)0.750.88
aparte-secrets v1 (int4)0.680.81
OpenAI privacy-filter0.470.75
detect-secrets 1.5.00.370.51
gitleaks 8.30.10.470.47

Files

filesizechat F1clean repos: false alerts / 1,000 linesCredData span F1dev F1
secrets-v1.1-fp32.bin677 KB0.760.170.720.75
secrets-v1.1-int8.bin196 KB0.760.170.720.75
secrets-v1.1-int4.bin114 KB0.740.440.710.72
secrets-v1.1-int3.bin94 KB0.730.220.700.67

int8 is the recommended precision and the one bundled in the packages: it matches fp32. int4 is smaller but noisier on ordinary code (0.44 false alerts per 1,000 lines against 0.17); a mixed file (int4 embeddings, int8 elsewhere) that keeps fp32 quality at about 160 KB is planned. Every file carries its identity in its JSON header (name, version, precision, architecture, labels); manifest.json lists every file of every version with its size and SHA-256; references/ holds the outputs every runtime must reproduce exactly. Older versions live in v1/, unchanged.

Use it

import { loadSecrets } from "@aparte/secrets";
const secrets = await loadSecrets();
secrets.detect("the wifi password is Sunflower77# for the guests");
const { text, secrets: map } = secrets.mask(message);   // send `text` to the AI, keep `map` on the device
secrets.unmask(answer, map);                              // put the values back in the answer
npx @aparte/secrets-cli              # scan the files git tracks
npx @aparte/secrets-cli --staged     # pre-commit: only the lines the next commit adds

The model reports raw spans; what to ignore in your project is your policy, applied after it (minScore, ignore, inline aparte-secrets:ignore, a baseline). In Python, the numpy reference reader runs any file: python reader.py secrets-v1.1-int8.bin "text".

Speed

The 450 chat messages of the benchmark (250 characters on average) one by one, then its code texts as one 3,550-line file; one CPU core, median of three rounds (bench.json):

runtimedevicems per chat messageµs per character of code
JavaScript (node v24.14.0)desktop, one core12.986
Kotlin (OpenJDK 21)desktop, one core12.782
Swift 6.4 (release build)desktop, one core8.568
Kotlin (Android 15, ART)mid-range Android phone (MediaTek Dimensity 7050)55.5436

The CLI spreads files over every core. Much slower than a regex scanner on a whole repository.

Limits

  • English and French only.
  • Still noisier than regex scanners on clean code (0.17 false alerts per 1,000 lines, see above), and less precise on escaped JSON than on plain text.
  • Boundaries can be imperfect (a trailing symbol, a punctuation-heavy value); the partial scores count a secret found with imperfect boundaries.
  • Unknown providers rely on context: a random-looking key is found when the text says what it is.
  • The chat sets and the gold are synthetic (secrets written into real WildChat messages by an LLM, configs generated by code); CredData and the clean repositories are the independent references.

License

Code and weights: MIT, Copyright (c) 2026 Paul Richez. Datasets: ODC-BY 1.0.

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

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

GPU в ailist

Универсальный рантайм

Нельзя запустить

Архитектура ? неизвестна transformers в образе рантайма.

Ревизия весов
bcad9ae

0 моделей