---
id: 18754
lang: en
title: "Nemo Tool Hides Names and Tax IDs From ChatGPT, Then Restores Them in the Right Grammatical Case"
published_at: "2026-11-30 22:31:36"
source_name: "Хабр: NLP"
source_url: "https://habr.com/ru/articles/1114276/?utm_campaign=1114276&utm_source=habrahabr&utm_medium=rss"
canonical_url: "https://news.hamidun.com/en/news/18754"
categories: ["research", "ethics"]
publisher: "AI News by Jemal Hamidun (news.hamidun.com)"
---

# Nemo Tool Hides Names and Tax IDs From ChatGPT, Then Restores Them in the Right Grammatical Case

> **Краткая суть (BLUF):** An accountant pastes a contract into ChatGPT, and the tax ID (INN), bank accounts and the director's passport go along with it. The Nemo program replaces them with tags such as [CHELOVEK_1|rd] (where "rd" stands for the genitive case), then puts the real data back after the chatbot answers: "powers of Belousova Arkadiya Gennadyevicha" (the genitive form of the name). Everything runs locally, with no GPU, in 140 MB. Across 8 runs on seven made-up documents, one address leaked, so you should still read the final text yourself.  - INN, SNILS, OGRN and card numbers are validated by checksum, not by length - The case is taken from the word before the tag: "s" ("with") means instrumental, "k" ("to") means dative - The installer needs no admin rights, 27 tests run on Windows, and the code is open on GitHub

When an accountant or a lawyer sends a contract to ChatGPT, the text carries the director's full name, the INN (the company's tax number), bank accounts, a passport and a phone number with it. Nobody is going to redact ten pages by hand, and replacing everything with "XXX" breaks the answer: the model can't tell who is agreeing with whom. The Nemo program solves this locally. It hides personal data behind tags, sends only the tagged text to the chatbot, and restores the real values in the reply, in the correct grammatical case. The goal is to get "powers of Belousova Arkadiya Gennadyevicha" (the genitive form), not "powers of Belousov Arkadiy Gennadyevich" (the nominative form).

## How Nemo hides and restores data

The phrase "acting through director Belousova Arkadiya Gennadyevicha, INN 5915881392" turns into "acting through director [CHELOVEK_1|rd], INN [INN_1]". The suffix "rd" stands for the genitive case. When the chatbot writes "check the powers of [CHELOVEK_1|rd]", the program substitutes "Belousova Arkadiya Gennadyevicha".

Detection, the tag-to-value table and declension all run on the user's computer. Before anything is sent, the user sees the full text that will go to the chatbot. Names, organizations and cities are found by Natasha, an open model for Russian. It runs without a GPU and loads in a couple of seconds. Together with its dictionaries, the program takes about 140 MB.

Identifiers are found by checksum. The rule "ten or twelve digits in a row" didn't work, because contracts are full of order numbers and sums written without spaces. So INN, SNILS, OGRN and OGRNIP are each checked with their own algorithms, and card numbers with the Luhn algorithm. KPP and BIK have no checksum, so they are caught only by context: the number must follow those words. The first bug was telling: a 13-digit OGRN happened to pass the Luhn check and went to the chatbot as a card number, because cards have higher priority.

Another problem is one person written in different ways: "Belousova Arkadiya Gennadyevicha", "Belousov A.G.", "A.G. Belousov", "Arkadiyu Gennadyevichu". If each variant gets its own tag, the model will conclude there are four people. So for every mention the program builds a signature from the surname and initials. When signatures match, the tag number is shared, and the grammatical form is set by the suffix. The prompt explains that identical numbers mean the same person. Qwen understood this best.

## Declension: where even libraries make mistakes

Grammatical cases took the most time. Natasha, via pymorphy, turned "Shpakova" into "Shpaka", "Ismailova" into "Ismaila" and "Kornilovu" into "Kornilova". Using pymorphy directly, with gender inferred from the patronymic, improved the surnames, but "Arkadiyu Gennadyevichu" came out as "Arkadiy Gennadiyevich". An error like that in a full name is almost impossible to spot by eye.

In the end, the author reduces surnames and patronymics to their base form himself and declines them by their endings (-ova, -eva, -ina, -ov, -ev, -in). Indeclinable ones such as Tkachenko and Chernykh are left as they are. Given names and cities are declined by dictionary.

The case is determined at the hiding stage: the program intersects the allowed cases of all words in the full name and writes the result into the tag. The model sees about ten examples and picks up the scheme. If it gets it wrong, as the lightweight Alice model did on a busy day, the program looks at the word immediately before the tag when restoring the data. "S" ("with") gives instrumental, "k" ("to") gives dative, "o" ("about") gives prepositional, and "ot" ("from"), "u" ("at") and "dlya" ("for") give genitive. Any other noun before a tag ("predlozheniem", "polnomochiya") requires the genitive.

## What the tests showed and what the program can't do

The author ran seven documents with made-up data: a supply contract, an employment contract, an invoice, a business letter, a claim letter, a résumé and a CSV export of clients. That made 8 runs: three in Alice, three in ChatGPT and two in Qwen. No model broke the tag format. One leak turned up: "pr. Lenina, d. 5, korp. 2" went out in plain text, because the patterns covered "prosp." and "pr-t" but not "pr.". The automated check looked only for digits, emails and surnames, so the address was caught only during manual reading. The takeaway: the right-hand panel with the result should be checked by eye.

Over-hiding also does harm. "RF" in "citizen of the RF" was recognized as a place, and Qwen wrote "Full name: [tag]" into a certificate. Countries, government bodies, courts and role words are no longer hidden. Another leak was the author's own fault: a name ended up in the prompt itself, "reply on behalf of Dmitry Olegovich". The task for the chatbot must also be written without names.

The author states the limitations plainly:
- "Olga Vladimirovna" and "Tkachenko O.V." without a full name remain different people;
- amounts and dates are not hidden by default, otherwise the model can't check a calculation; from version 1.1 this can be turned on in settings;
- depersonalization is not anonymity: a deal like "metal products, Perm, 4.8 million" can be identified even without names;
- the tag table sits on the same computer; from version 1.1 it is encrypted with the Windows account key;
- a company still needs an assessment of whether the method is sufficient, and an internal policy document.

The project is written in Python 3.12 with tkinter, Natasha, pymorphy2 and python-docx, and is built with PyInstaller and Inno Setup. On every commit, GitHub Actions runs 27 tests on Windows and checks the installed program. There is also a "hide and immediately restore without the chatbot" test: the result matches the source letter for letter, cases included.

The practical takeaway: before documents go to a cloud model, you need a local layer that shows the final text. The author now needs documents that break it: tables from 1C, scans and correspondence with quoted replies.

---
- **Первоисточник:** [Хабр: NLP](https://habr.com/ru/articles/1114276/?utm_campaign=1114276&utm_source=habrahabr&utm_medium=rss)
- **Каноническая ссылка:** https://news.hamidun.com/en/news/18754
- **Экосистема автора:** [Бесплатный интенсив по вайбкодингу — предзапись в Нике](https://t.me/vibecodeguidebot?start=agent_intensive_news_md) · [Nomad AI](https://nomadnet.ai) · [Telegram @jemal_hamidun](https://t.me/jemal_hamidun)
