Repository navigation
English
newmean-pii 1.7.2 is the first release with the vault: 1.7.0 and 1.7.1 were prepared but not published, so their
changes come with 1.7.2. Same v1.1 models; with default settings the spans are the same as in 1.6.1.
- Put the values back. A vault (
createVault,Vault,PIIVault,PiiVault) gives each value a numbered
placeholder ([PERSON_1], the same value always the same one) that it can undo, in all six packages. With a vault, the
npm and Python middlewares (Vercel AI SDK, LangChain, LangChain.js) put the values back in the model's answer and in the
arguments of the tools you name inrestoreTools/restore_tools; other tools get the placeholders. Asked for in
issue #2. - Agents. The AI SDK middleware also masks JSON and content tool results when
"tool"is a role; Python gains
mask_documents; examples for an agent with a CRM tool and for PDF text. The middlewares also hide known values in
tool descriptions and schemas, the response format, provider options and a message'sname, restore an agent's
structured response, and fail a call they cannot mask instead of sending it. - More spellings of a known value. In all six packages a known value is also found in capitals, in any ASCII case
for e-mail addresses, user names, URL hosts and values of two or more words, in NFD and full-width forms, and as two
Hangul syllables; a value the model marks with punctuation, brackets or quotation marks around it is learned without
them. Checked against a written guarantee and a corpus of 10,915 test cases. - Langfuse (Python).
pii_maskalso masks dict keys, set items, bytes and the fields of dataclasses and pydantic
models; any other value becomes[UNMASKED: <type>]; the ids of a trace and keys that are field names are kept; it
never raises ([MASK FAILED]). From pull request #1 by @Mramaran. - x86-64 (issue #3). The native core of the Python, Swift, Android, Flutter and Rust packages gains an 8-wide AVX2
matrix kernel, chosen once per process (avx2, elsesse). Its logits equal the SSE kernel's bit for bit, so every
span stays the same;NEWMEAN_PII_KERNEL=avx2+fmaopts in to fused multiply-add. Windows wheels (MSVC) keepscalar.
On an Intel Core i7-8700B (AVX2, no AVX-512), one thread, a 3,000-character text takes 0.54 s with nano and 0.83 s
with medium (was 1.14 s and 1.65 s);NEWMEAN_PII_KERNEL=avx2+fmabrings it to 0.34 s and 0.54 s. - Model downloads (Python).
fetch_model()andpython -m newmean_pii downloadfail when a model file cannot be
written to the cache (ModelFileError; the command ends with status 1), so a build step that ended with status 0 on
such a cache now fails. Loading for immediate use still works. From pull request #4 by @kyleoliver-gnomai. - Changed promises. The LangChain integrations need langchain 1.4.0 or later in Python, and langchain 1.5.1 or later
with@langchain/core1.2.1 or later in LangChain.js (1.6 took 1.0 or later). These floors and the trace ids and keys
the Langfuse mask keeps change what 1.6.1 promised; the maintainer approved them. With a vault the npm middlewares
accept only the tag mode. Large data with thousands of known values takes seconds per call (about 2 s for 181 KB of
JSON rows with 2,000 known values); a faster search is planned for 1.7.3. - In public. The vault's leak corpus, fuzz and boundary tests and the x86-64 kernel tests are in the repository and
run in CI. Misses per label, format and language for each size (docs/results), and a form to report a miss.
Results by language and label
Miss % (share of PII characters left unmasked) of the shipped v1.1 models, model only (no pattern layer), measured
2026-11-01. Gold spans in brackets. Every language, every label, over-masking and the four external datasets:
https://pii.newmean.ai/results/ (tables also in
docs/results/models-v1.1-by-language-label.md).
| miss % | nano 2.6 MB | small 7.1 MB | medium 11.3 MB | large 15.5 MB |
|---|---|---|---|---|
| Public test, lowest of 54 languages | Chinese 0.7 (342) | Irish, Polish 0.6 (309, 317) | Irish, Ukrainian, Chinese 0.5 (309, 299, 342) | Irish, Ukrainian, Chinese 0.3 (309, 299, 342) |
| Public test, highest of 54 languages | Kazakh 6.0 (315) | Hindi, Kazakh 5.8 (309, 315) | Persian 4.5 (310) | Kazakh 4.2 (315) |
| OpenPII (external), lowest / highest of 30 languages | Danish 3.5 (711) / German 7.0 (699) | Spanish 3.2 (770) / Slovenian 9.0 (746) | Spanish 4.4 (770) / Slovenian 8.5 (746) | Danish 2.9 (711) / Slovenian 8.0 (746) |
| German: public test (299) / OpenPII (699) / Gretel finance (1,471) | 3.6 / 7.0 / 21.3 | 2.8 / 6.7 / 21.8 | 3.0 / 6.5 / 20.8 | 2.9 / 4.2 / 20.2 |
| Polish: public test (317) / OpenPII (709) | 1.3 / 4.8 | 0.6 / 4.7 | 0.7 / 7.5 | 0.7 / 5.4 |
- All rows: public test 2.9 (nano) to 1.6 (large) over 54 languages; OpenPII 5.0, 5.6, 6.3, 4.9 (nano to large); Gretel
finance 21.4 to 22.3 for every size (it is hard for every detector in the README table; German is close to that). - Over-masking (share of PII-free characters masked) on the same rows: public test 1.5 (nano) to 0.5 (large), German 1.9
to 0.5, Polish 1.3 to 0.4; OpenPII 6.2 to 4.1, German 5.2 to 3.4, Polish 5.3 to 3.6; Gretel finance German 7.5 (nano), 5.5 to 5.8 (small to large). - Each language has 287 to 343 gold spans on the public test and 672 to 832 on OpenPII, so differences under about one
point between languages are within what a few rows change. The public test is written like our training data; the
external sets are the fairer comparison.
Install: npm i @newmean-ai/pii@1.7.2 · pip install newmean-pii==1.7.2 · newmean-pii = "1.7" ·
.package(url: "https://github.com/newmean-ai/pii", from: "1.7.2") · implementation("ai.newmean:pii:1.7.2") ·
newmean_pii: ^1.7.2. Details: README, "What 1.7 changes" and "What 1.7.2 changes".
한국어
newmean-pii 1.7.2는 vault가 들어간 첫 배포입니다. 1.7.0과 1.7.1은 준비만 하고 배포하지 않았으므로 그 변경이 1.7.2로
나옵니다. 모델은 v1.1 그대로이고, 기본 설정의 결과 구간은 1.6.1과 같습니다.
- 값 되돌리기. vault(
createVault,Vault,PIIVault,PiiVault)가 값마다 번호 붙은 자리표시([PERSON_1], 같은
값에는 늘 같은 자리표시)를 붙이고 되돌릴 수 있게 합니다. 여섯 패키지 모두에 있습니다. vault를 주면 npm·Python
미들웨어(Vercel AI SDK, LangChain, LangChain.js)가 모델 답변과restoreTools·restore_tools에 지정한 도구의 인자에 원래
값을 되돌립니다. 다른 도구는 자리표시를 받습니다. 이슈 #2에서 요청받았습니다. - 에이전트. AI SDK 미들웨어는
"tool"역할일 때 JSON과 content 형식의 도구 결과도 가립니다. Python에
mask_documents가 생겼고, CRM 도구가 있는 에이전트 예시와 PDF 글 예시를 넣었습니다. 미들웨어는 도구 설명과 스키마,
응답 형식, 공급자 설정, 메시지의name에서도 아는 값을 숨기고, 에이전트의 구조화 응답에 값을 되돌리며, 가릴 수 없는
호출은 보내지 않고 실패시킵니다. - 아는 값의 다른 표기. 여섯 패키지 모두 아는 값을 대문자로 쓴 것, 이메일 주소·사용자 이름·URL 호스트·두 단어 이상인
값을 ASCII 대소문자를 달리 쓴 것, NFD와 전각으로 쓴 것, 두 음절 한글도 찾습니다. 모델이 구두점, 괄호, 따옴표까지 표시한
값은 그것을 빼고 배웁니다. 글로 적은 약속과 시험 사례 10,915개의 코퍼스로 확인했습니다. - Langfuse(Python).
pii_mask가 dict 키, set 항목, bytes, dataclass와 pydantic 모델의 필드도 가립니다. 그 밖의 값은
[UNMASKED: <type>]이 되고, 트레이스의 id와 필드 이름인 키는 그대로 두며, 예외를 내지 않습니다([MASK FAILED]).
@Mramaran 님의 pull request #1에서 왔습니다. - x86-64(이슈 #3). Python, Swift, Android, Flutter, Rust 패키지의 네이티브 코어에 8폭 AVX2 행렬 커널을 더했습니다.
프로세스마다 한 번 고르며(avx2, 없으면sse), 로짓이 SSE 커널과 비트 단위로 같으므로 구간은 모두 그대로입니다.
NEWMEAN_PII_KERNEL=avx2+fma로 융합 곱셈-덧셈을 고를 수 있습니다. Windows 휠(MSVC)은scalar그대로입니다. AVX-512가
없는 Intel Core i7-8700B(AVX2) 한 스레드에서 3,000자 글 하나에 nano 0.54초, medium 0.83초입니다(전에는 1.14초, 1.65초).
NEWMEAN_PII_KERNEL=avx2+fma면 0.34초, 0.54초입니다. - 모델 내려받기(Python).
fetch_model()과python -m newmean_pii download는 모델 파일을 캐시에 쓰지 못하면
실패합니다(ModelFileError, 명령은 상태 1). 그래서 그런 캐시에서 상태 0으로 끝나던 빌드 단계는 이제 실패합니다. 바로
쓰려고 불러오는 것은 전처럼 됩니다. @kyleoliver-gnomai 님의 pull request #4에서 왔습니다. - 바뀐 약속. LangChain 통합은 Python에서 langchain 1.4.0 이상, LangChain.js에서 langchain 1.5.1 이상과
@langchain/core1.2.1 이상이 필요합니다(1.6은 1.0 이상). 이 하한과 Langfuse 마스크가 그대로 두는 트레이스의 id·키는
1.6.1의 약속을 바꾸며, 메인테이너가 승인했습니다. vault와 함께면 npm 미들웨어는 tag 방식만 받습니다. 아는 값이 수천 개인
큰 데이터는 호출마다 몇 초가 걸리며(아는 값 2,000개와 JSON 행 181 KB에 약 2초), 더 빠른 찾기는 1.7.3에서 합니다. - 공개. vault의 유출 코퍼스·퍼징·경계 시험과 x86-64 커널 시험을 저장소에 공개하고 CI에서 돌립니다. 크기별
라벨·형식·언어별 놓침(docs/results)과 놓친 사례 제보 양식.
설치: npm i @newmean-ai/pii@1.7.2 · pip install newmean-pii==1.7.2 · newmean-pii = "1.7" ·
.package(url: "https://github.com/newmean-ai/pii", from: "1.7.2") · implementation("ai.newmean:pii:1.7.2") ·
newmean_pii: ^1.7.2. 자세한 것: README의 "1.7에서 바뀐 것", "1.7.2에서 바뀐 것".