docs-masked

docs-masked is a skill for Claude Code from kpshinnik/docs_masked. It costs 296 tokens per session (1,714 once invoked), scanned A, original, MIT.

A local document-scrubbing tool that replaces personal details with tags before text is sent to a language model, then restores the real details in the returned answer.

In plain words
What is it for?
It helps prepare contracts and customer exports for model processing, check for personal data, create masked copies, and restore the original values locally.
Why use it?
It keeps names, phone numbers, addresses, and other personal data from leaving your computer while still letting the model process the document.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the docs-masked plugin — 1 skill shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/kpshinnik/docs_masked/docs-masked
Any agent
npx skills add kpshinnik/docs_masked --skill docs-masked
Clone the repo
git clone --depth 1 https://github.com/kpshinnik/docs_masked

Made for: Claude Code.

Or install docs-masked, the plugin that ships this one along with the rest of its 1 skill.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for docs-masked

README.md
[![agentmods](https://agentmods.dev/badge/skills/kpshinnik/docs_masked/docs-masked.svg)](https://agentmods.dev/skills/kpshinnik/docs_masked/docs-masked)
Your own site
<a href="https://agentmods.dev/skills/kpshinnik/docs_masked/docs-masked"><img src="https://agentmods.dev/badge/skills/kpshinnik/docs_masked/docs-masked.svg" alt="Measured on agentmods" height="20"></a>
Per session 296 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,714 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00296 $0.01714
Opus 5 $0.00148 $0.00857
Sonnet 5 $0.00059 $0.00343
Haiku 4.5 $0.00030 $0.00171

Measured 6d ago against content hash 527999ef097c, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

docs-masked scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/docs-masked/SKILL.md · 159 lines

How it starts

The opening of the file, as written. The whole thing — 159 lines — stays where its author put it; the contents beside it link to each section on GitHub.

docs-masked — обезличивание документов до отправки в модель

Зачем

Когда в модель уходит договор или выгрузка клиентов, туда уходят и чужие персональные данные. Скилл превращает это в контролируемую операцию: данные заменяются тегами на локальной машине, наружу уходит текст без людей, а ответ модели восстанавливается обратно по сейфу, который тоже никуда не уезжает.

документ ──▶ маска ──▶ контроль утечки ──▶ модель ──▶ обратная подстановка
           локально      локально          сеть           локально

Порядок работы

Он всегда один и тот же — не пропускай шаги, даже если документ выглядит безобидно. Пропуск второго шага и есть та ситуация, ради которой скилл нужен.

1. Посмотреть, что внутри. Локально, без сети:

python3 -m pii_shield.cli scan договор.docx

Вывод показывает типы и количество находок. Если ожидал персональные данные, а находок нет — это повод разобраться, а не идти дальше.

2. Обезличить и убедиться, что чисто.

python3 -m pii_shield.cli mask договор.docx

Рядом появятся договор.masked.docx и договор.docx.vault.json (права 0600). Команда сама прогоняет контроль утечки и завершается с ненулевым кодом, если что-то осталось.

3. Отправить в модель только замаскированный текст. Либо полным кругом:

python3 -m pii_shield.cli ask договор.docx -p "Найди риски по срокам оплаты"

Эта команда сама маскирует, проверяет, отправляет и восстанавливает ответ. Провайдер задаётся флагом --provider anthropic|openai|deepseek|ollama.

4. Восстановить. Для ответа модели подстановка уже сделана. Замаскированный файл возвращается к исходному виду так:

python3 -m pii_shield.cli unmask договор.masked.docx --vault договор.docx.vault.json

Если работаешь из кода, а не из терминала

Когда нужно вплести обезличивание в свой пайплайн, важно одно: между текстом и сетью обязан стоять assert_clean.

from pii_shield import mask_text, assert_clean, unmask_text

r = mask_text(raw_text)          # r.text — с тегами, r.vault — сейф
assert_clean(r.text)             # LeakGuardError, если что-то осталось
answer = call_model(r.text)      # наружу уходит только маска
final, unknown = unmask_text(answer, r.vault, mode="canonical")

Read the full file on GitHub · 159 lines

Files

What ships with it

3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 159 lines · 296 tokens per session scan A 527999ef097c

Subscribe to this mod's changes

docs-masked is a skill published in the GitHub repository kpshinnik/docs_masked (15 stars, last pushed 18d ago), licensed MIT. It adds 296 tokens to every session and 1,714 once invoked, about $0.0015 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.