Skip to content
Back to search

katip

MarketplaceWorks with Claude CodeGitHub

Katip: on-device KVKK masking for Turkish law firms using AI. Personal data is masked on your computer before Claude reads a document.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 19 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/fikrifirat/katip with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/fikrifirat/katip'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/fikrifirat--katip/badge.svg)](/listings/fikrifirat--katip)

HTML

<a href="/listings/fikrifirat--katip"><img src="/api/listings/fikrifirat--katip/badge.svg" alt="findsafeskills safety rating" /></a>

Install

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

.claude-plugin/marketplace.json · Manifest · 41 lines
  1. {
  2. "name": "katip",
  3. "owner": {
  4. "name": "fikrifirat",
  5. "url": "https://github.com/fikrifirat"
  6. },
  7. "plugins": [
  8. {
  9. "name": "katip-kalkan",
  10. "source": "./connector",
  11. "description": "KVKK masking for Turkish lawyers: Katip finds and masks names, T.C. kimlik, YKN and passport numbers, addresses, IBANs and health data in client documents (UYAP .udf, Word, PDF, scans) on your computer, so Claude works with placeholders such as [AD SOYAD-1] (PII redaction, pseudonymisation), then puts the real names back into your final draft. Avukatlar için KVKK kişisel veri maskeleme ve anonimleştirme: dilekçe, sözleşme, bilirkişi raporu.",
  12. "category": "productivity",
  13. "keywords": [
  14. "kvkk",
  15. "kisisel-veri",
  16. "kişisel veri",
  17. "maskeleme",
  18. "anonimlestirme",
  19. "anonimleştirme",
  20. "avukat",
  21. "hukuk",
  22. "dilekce",
  23. "uyap",
  24. "lawyer",
  25. "legal",
  26. "law-firm",
  27. "turkish",
  28. "turkey",
  29. "pii",
  30. "pii-redaction",
  31. "redaction",
  32. "anonymization",
  33. "pseudonymization",
  34. "data-protection",
  35. "privacy",
  36. "gdpr"
  37. ]
  38. }
  39. ],
  40. "description": "Katip: on-device KVKK masking for Turkish law firms using AI. Personal data is masked on your computer before Claude reads a document."
  41. }
README.md · README · 289 lines
  1. # Katip Mask: Turkish KVKK redaction that runs in your browser
  2. **English** · [Türkçe](README.tr.md)
  3. [![Live demo](https://img.shields.io/badge/demo-GitHub%20Pages-2f7d4f)](https://fikrifirat.github.io/katip/)
  4. [![Hugging Face Space](https://img.shields.io/badge/%F0%9F%A4%97%20Space-katip--kvkk--anonymization-yellow)](https://huggingface.co/spaces/f1k/katip-kvkk-anonymization)
  5. [![Model](https://img.shields.io/badge/%F0%9F%A4%97%20model-katip--mask--nano-yellow)](https://huggingface.co/f1k/katip-mask-nano)
  6. [![Base model](https://img.shields.io/badge/%F0%9F%A4%97%20model-katip--mask--base-yellow)](https://huggingface.co/f1k/katip-mask-base)
  7. [![KVKK-Bench](https://img.shields.io/badge/KVKK--Bench-Base%2096.1%20%C2%B7%20Mini%2093.0%20%C2%B7%20Nano%2085.9-4c1)](https://huggingface.co/spaces/f1k/kvkk-bench)
  8. [![Licence: AGPL-3.0 + commercial](https://img.shields.io/badge/licence-AGPL--3.0%20%2B%20commercial-blue)](COMMERCIAL.md)
  9. Katip finds and masks personal data in Turkish legal documents (T.C. kimlik no, VKN, IBAN, phone,
  10. e-mail, plate, address, names, KVKK art. 6 health data) **without the document ever leaving your
  11. computer**. The file is opened, analysed, masked and leak-checked inside the browser tab. Nothing is
  12. uploaded or stored, and the page's Content-Security-Policy blocks sending data to any other address.
  13. Only the redacted copy you download leaves the machine.
  14. Built for law firms, in-house legal and compliance teams who need to share case files, contracts or
  15. court documents with clients, experts or AI tools under KVKK.
  16. ![Katip Mask](screenshot.png)
  17. ## Why mask before you use AI
  18. Lawyers are data controllers for their clients' data (KVKK m.3). Sending a case file to a foreign AI provider
  19. is a transfer abroad that needs a legal basis under KVKK m.9 (as amended by Law No. 7499), on top of the duty
  20. of professional secrecy (Avukatlık Kanunu m.36). The KVKK Board's [guide for lawyers](https://www.kvkk.gov.tr/Icerik/8990/avukatlarin-mesleki-faaliyetlerinde-kisisel-verilerin-korunmasina-iliskin-uygulama-rehberi-yayimlandi) (22 September 2026)
  21. recommends masking or anonymising data before sharing it with AI tools (p. 146), and Katip follows that advice. Katip masks on your computer, so less client data leaves your office. It
  22. can miss values and it does not replace a legal basis, so you still check the result.
  23. How Katip handles data: [PRIVACY.md](PRIVACY.md). Questions and answers: [FAQ.md](FAQ.md).
  24. ## Use it with Claude: Katip Kalkan
  25. [Katip Kalkan](connector/) is a Claude plugin and Claude Desktop extension that masks personal data in
  26. client documents **on your computer, before Claude reads them**. Claude sees placeholders such as
  27. `[AD SOYAD-1]` instead of the values Katip finds, and Katip can put the real names back into the final document on your computer.
  28. ```
  29. claude plugin marketplace add fikrifirat/katip
  30. claude plugin install katip-kalkan@katip
  31. ```
  32. Then name the document the way you'd tell a colleague: `/katip-incele son indirdiğim bilirkişi raporu` for a review, `/katip-taslak 2026/123 ihtarname, cevap` for a draft reply, or `/katip` for anything else. Files stay in your case folder and Downloads ([what each command does](FAQ.md#how-do-i-use-it)). See [connector/README.md](connector/README.md)
  33. for Claude Desktop, limits and the privacy policy.
  34. ### The MCP server
  35. Katip Kalkan is a local **Model Context Protocol (MCP) server** in Python, in [`connector/`](connector/). It talks
  36. MCP over stdio (JSON-RPC 2.0, protocol versions `2024-11-05` to `2025-11-25`), with no MCP SDK: the protocol layer is
  37. [`connector/katip_kalkan/mcp_proto.py`](connector/katip_kalkan/mcp_proto.py) and the tools are in
  38. [`connector/katip_kalkan/core.py`](connector/katip_kalkan/core.py). Start it with any MCP client:
  39. ```json
  40. {"mcpServers": {"katip-kalkan": {"command": "python3", "args": ["connector/server.py"]}}}
  41. ```
  42. Tools: `list_files`, `mask_file`, `write_masked_copy`, `restore_to_file`, `forget_matter`, `open_folder` and
  43. `katip_status` ([what each returns](connector/README.md#tools)), plus the prompts behind `/katip`,
  44. `/katip-incele` and `/katip-taslak`. It is listed in the official MCP Registry as
  45. `io.github.fikrifirat/katip-kalkan`.
  46. ## Key numbers
  47. Measured on Katip's synthetic Turkish legal documents. The **blind set** uses 80 documents with
  48. names never seen during development or training, in 16 document styles (4 of them new).
  49. | | Result |
  50. | --- | --- |
  51. | Values found (blind set, default settings) | **756 of 757 (99.9%)**, 10 extra highlights, all health terms |
  52. | Names found | 364 of 365 (99.7%) |
  53. | Values still readable after masking (full pipeline, rules only) | 0.8% for text, PDF, Word and UDF; 0.7–1.1% for photos and scans |
  54. | False alarms on name-free legal prose | 3 across 3 documents |
  55. | Time per document | 0.1–0.3 s for text, PDF, Word, UDF; 2–4.5 s with OCR (4-core cloud VM) |
  56. | Network requests after a document is opened | **0** (verified in Chromium) |
  57. | First load | about 30 MB of engine files (Python, PDF, OCR), plus about 30 MB for the name tagger; cached by the browser afterwards |
  58. ### Models in the demo
  59. | Model | What it is | Values found (blind) | Names found |
  60. | --- | --- | --- | --- |
  61. | **Katip Mask Mini · tr v2** (recommended, default) | Katip Rules + [`katip-mask-mini`](https://huggingface.co/f1k/katip-mask-mini), 31 MB, distilled from Katip Mask Base; finds far more names in everyday prose than Nano (KVKK-Bench: 72.5% vs 52.9%) | 754 / 757 (99.6%) | 364 / 365 |
  62. | **Katip Mask Nano · tr v1.1** (fast mode) | Katip Rules + [`katip-mask-nano`](https://huggingface.co/f1k/katip-mask-nano), 2.5 MB, Turkish and foreign client names | **756 / 757 (99.9%)** | 364 / 365 |
  63. | **Katip Rules** | Katip's Turkish rules v0.2, 0.3 MB | 756 / 757 (99.9%) | 364 / 365 |
  64. | Vanilla: kvkk-pii | open-source [kvkk-pii](https://pypi.org/project/kvkk-pii/) 0.2 regex layer, default settings (baseline) | 183 / 757 (24.2%) | 0 / 365 |
  65. | **Katip Mask Base** | Katip Rules + [`katip-mask-base`](https://huggingface.co/f1k/katip-mask-base), 110.8 MB, names + addresses + health terms; on the [Space](https://huggingface.co/spaces/f1k/katip-kvkk-anonymization) only | **757 / 757 (100%)** | **365 / 365** |
  66. **Katip Mask Nano v1.1** (14 Nov 2026) is trained with foreign client names as they appear in Turkish documents.
  67. The rules now catch almost every value on the blind set, so its gain shows on harder text: in real Yargıtay prose
  68. with held-out foreign names filled in it finds 94.6% [92.5–96.2] of them (v1 80.3%, rules 77.1%) and 98.7% of
  69. Turkish names in the same slots. The price is more false names on trap text full of name-like words (9 per 1,000
  70. words, v1 0.6). Details: [model card](https://huggingface.co/f1k/katip-mask-nano), [`lab/foreign`](lab/foreign/README.md).
  71. **Katip Mask Base v2** is fine-tuned from BERTurk on 8,000 synthetic documents plus 17,967 real
  72. Turkish sentences (Turkish Wiki NER, names only), 3 epochs in 28 minutes on a Mac.
  73. **Full pipeline** (rules + Katip Mask Base, as the demo runs it, [`metrics/accuracy-berturk.json`](metrics/accuracy-berturk.json)):
  74. every value on the blind set (757 / 757, names 365 / 365) and on the held-out set (618 / 618; Nano v1.1: 614),
  75. 3 false alarms on name-free prose (same as Nano). Model names scored 0.5 or higher keep their edges; that
  76. value was chosen on dev data (Wiki NER dev + held-out), not on the test sets below.
  77. **On real text** (measured in [`lab/`](lab/), names only, rules + model):
  78. | | Real court prose: Yargıtay sentences, anonymised names filled back in | Real Wikipedia sentences (Wiki NER test) |
  79. | --- | --- | --- |
  80. | Katip Rules | 90.6% found, 96.0% precision | 15.0% |
  81. | Katip Mask Nano v1 | 93.9%, 95.9% | 14.8% |
  82. | Katip Mask Base v1 (synthetic only) | 98.6%, 95.9% | 40.7% |
  83. | **Katip Mask Base v2** | **99.3%, 96.2%** | **89.8%** [87.1–92.1], 89.9% precision |
  84. The court set fills the "..." that courts put in place of names (TurkishLegalNER, Çetindağ et al. 2022,
  85. Apache-2.0) with common Turkish names, in court casing, with the case suffix re-inflected; a second version
  86. with rare unseen names scores within 0.5 points. Scripts: `lab/score_legal.py`, `lab/score_model.py`.
  87. It is 40 times bigger than Katip Mask Nano, so the demo offers Katip Mask Base on the Hugging Face Space (its
  88. 110.8 MB file is over GitHub's 100 MB limit for Pages). Since 14 Nov 2026 the demo's default is **Katip Mask Mini**
  89. (31 MB, about 1 s per page in the browser), with Nano as a fast mode for long digital files (about 0.03 s per page).
  90. On real everyday prose Mini finds 72.5% of names against Nano's 52.9% ([KVKK-Bench](https://huggingface.co/spaces/f1k/kvkk-bench)).
  91. ### Size, speed and accuracy side by side
  92. | | Download | Detection time per document (text, no OCR) | Blind set | Held-out set |
  93. | --- | --- | --- | --- | --- |
  94. | Vanilla kvkk-pii | 0.1 MB | 1 ms | 183 / 757 (24.2%) | 154 / 618 |
  95. | Katip Rules | 0.3 MB | 3 ms | 756 / 757 (99.9%) | 606 / 618 |
  96. | Katip Mask Nano v1.1 | + 2.5 MB | 7 ms | 756 / 757 (99.9%) | 614 / 618 |
  97. | Katip Mask Base v2 | + 110.8 MB | 27 ms | **757 / 757 (100%)** | **618 / 618** |
  98. **Shrinking.** Both models ship as int8 ONNX: Katip Mask Nano 10.0 → 2.6 MB, Katip Mask Base 440.3 → 110.8 MB (4×
  99. smaller each). All scores above were measured on the int8 files, so quantising cost no accuracy. For OCR,
  100. the compact Turkish model is 2 MB instead of 7.7 MB with about the same recall (49 vs 48 misses on 96 scans).
  101. **Timings** are onnxruntime in Python, Nano and the rules on a 4-core cloud VM, Katip Mask Base on an Apple-silicon
  102. Mac; browser timings (WebAssembly, one thread) are slower and not measured yet. Distilling BERTurk to a
  103. size that fits GitHub Pages is on the roadmap.
  104. <picture>
  105. <source media="(prefers-color-scheme: dark)" srcset="metrics/accuracy-dark.svg">
  106. <img alt="Share of values found by data type on the blind set" src="metrics/accuracy-light.svg" width="720">
  107. </picture>
  108. <picture>
  109. <source media="(prefers-color-scheme: dark)" srcset="metrics/speed-dark.svg">
  110. <img alt="Time per document and share of values still readable after masking, by format" src="metrics/speed-light.svg" width="720">
  111. </picture>
  112. **What these numbers do not show yet.** The blind and held-out documents are synthetic, and 12 of the 16 blind
  113. styles share templates with the training data, so real case files will score lower. Timings come
  114. from a cloud VM, not a typical laptop. Raw numbers: [`metrics/`](metrics/). Scripts:
  115. `ml/benchmark.py`, `ml/make_charts.py`. Help us measure on real documents: see [Contact](#questions-pilots-and-contact).
  116. ## What Katip adds on top of the base models
  117. | Base | On its own | With Katip (measured, blind set) |
  118. | --- | --- | --- |
  119. | [kvkk-pii](https://pypi.org/project/kvkk-pii/) 0.2, open-source Turkish PII regex | 183 / 757 values (24.2%), 0 of 365 names | 756 / 757 (99.9%), 364 / 365 names |
  120. | Katip's own rules | 359 / 365 names (98.4%) | 364 / 365 with the 2.6 MB tagger, no new false names |
  121. | [BERTurk](https://huggingface.co/dbmdz/bert-base-turkish-cased) | a language model with no PII labels | 757 / 757 values with Katip's rules; alone: names 364 / 365, addresses 80 / 80, health terms 26 / 26 |
  122. | Tesseract `tur` | text only, no check that a value is really gone | every masked value is searched for again in a second OCR pass of the output; the compact OCR model is 4× smaller with about the same recall (49 vs 48 misses on 96 scans) |
  123. **Next:** add a stock Turkish NER model as a second baseline in the demo, distil BERTurk into a model
  124. small enough for GitHub Pages, and repeat every measurement on consented real documents from pilot firms.
  125. ## What it supports
  126. | Documents | How |
  127. | --- | --- |
  128. | PDF with a text layer | true removal of the glyphs under each box (MuPDF `applyRedactions`), metadata scrubbed |
  129. | Scanned PDF, photos (PNG, JPG) | OCR (Tesseract for printed scans, PaddleOCR for handwriting and phone photos), boxes burned into the image |
  130. | Word `.docx` | text, tracked deletions, comment authors and document properties masked |
  131. | UYAP `.udf` | masked in place, stays a valid UDF |
  132. | Plain text | |
  133. | Data type | Detection |
  134. | --- | --- |
  135. | T.C. kimlik no, VKN, IBAN, card number | checksum-validated patterns |
  136. | Phone, e-mail, plate, birth date | Turkish formats with context words |
  137. | Address | Turkish address structure (Mh., Cd., Sk., No, district/province) |
  138. | Person names | gazetteers, cue words (Av., Sayın, davacı …), casing and suffix rules, plus an on-device name tagger |
  139. | KVKK art. 6 special categories (health, union, …) | lexicon, flagged for review |
  140. Context it has been tested on: petitions, judgments, leases, employment contracts, invoices,
  141. privacy notices, powers of attorney, notices, letters, e-mails, hearing minutes, chat logs,
  142. discharge summaries (epikriz) and expert reports.
  143. ## Try it
  144. - **Demo:** https://fikrifirat.github.io/katip/ (or the [Hugging Face Space](https://huggingface.co/spaces/f1k/katip-kvkk-anonymization)).
  145. Pick one of 16 sample documents to see live recall, precision, misses and false alarms against its
  146. answer key, or open your own file.
  147. - The document shows up as soon as you pick it; detected values are highlighted on the page itself.
  148. - One review screen: tick or untick each value (on the page or in the list), add missed terms, then
  149. **Apply masks** and download. Choose the mask colour, an optional one-line credit and an optional Katip logo across the middle of each page (PDF and images).
  150. - Switch the detection model, OCR model, confidence threshold and data types; Turkish and English interface.
  151. - **Report a mistake** (*Hata bildir*) builds a small report (settings, scores, the masked output,
  152. and the original only if you tick it) and opens an e-mail draft.
  153. ## How it works
  154. | Step | Component |
  155. | --- | --- |
  156. | Detection rules | Katip's Python recognizers and word lists, unchanged, in Pyodide (Python compiled to WebAssembly) |
  157. | Name tagger | [`katip-mask-nano`](https://huggingface.co/f1k/katip-mask-nano), 2.5 MB int8 ONNX, transformers.js; or [`katip-mask-base`](https://huggingface.co/f1k/katip-mask-base) (names, addresses, health), 110.8 MB |
  158. | Text, UDF, Word | standard-library Python in Pyodide (`src/py/local_formats.py`) |
  159. | PDF | MuPDF.js |
  160. | Scans and photos | tesseract.js with the Turkish model; PaddleOCR PP-OCRv5 (small detector + Latin recogniser, 13 MB ONNX) on pages with ballpoint ink or a photographed sheet ([lab/ocr_bench](lab/ocr_bench/README.md)) |
  161. | Leak check | the output is read again (text layer or a second OCR pass) for every masked value |
  162. The browser rules give exactly the same results as Katip's server engine (0 differences on 1,803
  163. spans), and the browser tagger matches Python onnxruntime (0 differences on 152 spans, for both the
  164. name-only and the multi-type model code).
  165. ## Roadmap
  166. - [x] Fully in-browser redaction for PDF, scans, photos, Word, UDF, text
  167. - [x] On-device name tagger, public demo, Hugging Face Space and model
  168. - [x] BERTurk model for names, addresses and health terms ([`ml/berturk/`](ml/berturk/))
  169. - [x] Full pipeline with BERTurk: 757 / 757 on the blind set
  170. - [ ] A smaller distilled BERTurk that fits on GitHub Pages
  171. - [ ] A stock Turkish NER model as a second baseline in the demo
  172. - [ ] Evaluation on real, consented documents from pilot firms
  173. - [ ] Laptop and phone timings; smaller first download
  174. - [ ] Organisation and court names, case numbers, more KVKK art. 6 categories
  175. - [ ] Excel, e-mail (`.eml`, `.msg`) and batch folders
  176. - [ ] Packaged as a browser extension and a desktop app for offline use
  177. ## Questions, pilots and contact
  178. - Questions, missed redactions, feature requests: [open an issue](https://github.com/fikrifirat/katip/issues/new/choose).
  179. Please never paste real personal data; use the demo's *Hata bildir* button or fake values.
  180. - Support for Katip Kalkan, pilots in your firm, integration or a commercial licence: **fikrifirat@gmail.com**.
  181. ## Develop
  182. ```bash
  183. npm install
  184. python3 src/build_site.py <path-to-katip-redact> node_modules docs --source https://github.com/fikrifirat/katip
  185. python3 docs/serve.py
  186. ```
  187. `npm install` fetches Pyodide, MuPDF, tesseract.js, transformers.js and JSZip; `serve.py` serves the site at http://127.0.0.1:8765.
  188. `build_site.py` copies the detection code from the Katip server repository (one source of truth)
  189. and the sample documents from its `eval/blind` set.
  190. - **GitHub Pages:** Settings → Pages → Deploy from a branch → `main` / `/docs`.
  191. - **Hugging Face:** `./publish_hf.sh` (after `hf auth login`) uploads the models and the Space.
  192. | Test | Checks |
  193. | --- | --- |
  194. | `src/tests/parity.mjs` + `parity_server.py` | browser rules = server engine, span by span |
  195. | `src/tests/tests_parity_tagger.cjs` + `ml/parity_py.py` | browser tagger = Python onnxruntime |
  196. | `src/tests/tests_e2e_demo.cjs` | Chromium: every format, report flow, 0 requests to other origins |
  197. | `ml/eval_system.py`, `ml/benchmark.py` | name recall with and without the tagger; all data types |
  198. Training: `ml/gen_train.py` + `ml/train.py` (tiny tagger, about 6 minutes on CPU) and
  199. [`ml/berturk/`](ml/berturk/) (BERTurk fine-tune for a Mac or GPU).
  200. ## Citation
  201. If Katip, its models or KVKK-Bench help your work, please cite them. GitHub's "Cite this repository" button
  202. uses [`CITATION.cff`](CITATION.cff).
  203. ```bibtex
  204. @software{firat2026katip,
  205. title = {Katip: offline personal-data masking for Turkish legal documents},
  206. author = {F{\i}rat, Fikri},
  207. year = {2026},
  208. url = {https://github.com/fikrifirat/katip}
  209. }
  210. @misc{firat2026kvkkbench,
  211. title = {KVKK-Bench: a benchmark for personal-data masking in Turkish documents},
  212. author = {F{\i}rat, Fikri},
  213. year = {2026},
  214. url = {https://huggingface.co/spaces/f1k/kvkk-bench}
  215. }
  216. ```
  217. ## Licence
  218. Code and demo: **[AGPL-3.0](LICENSE)**, with a **commercial licence** for use in products, internal
  219. systems or hosted services without the AGPL's source-sharing obligation; see [COMMERCIAL.md](COMMERCIAL.md).
  220. Models: **CC BY-SA 4.0** (Katip Mask Nano and Base), because they are trained partly on Turkish Wiki NER
  221. (Altinok, 2023; CC BY-SA 4.0). Katip Mask Base builds on BERTurk by Stefan Schweter / dbmdz (MIT). A v3
  222. trained without Wikipedia data, under Apache-2.0, is the goal if it keeps its scores.
  223. Third-party parts: MuPDF (AGPL-3.0, Artifex), kvkk-pii (MIT, Aleonis; baseline only), Inter and Space Grotesk fonts (SIL OFL 1.1), Pyodide (MPL-2.0), tesseract.js and the `tur` model
  224. (Apache-2.0), PaddleOCR PP-OCRv5 models (Apache-2.0, PaddlePaddle), transformers.js (Apache-2.0), ONNX Runtime (MIT), `common_words.txt` from the
  225. OpenSubtitles frequency list (CC BY-SA 4.0). Sample documents are synthetic; any resemblance to
  226. real people is accidental.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.