Free · Daily brief + weekly playbookDaily 60-sec AI Voice Brief + Weekly Production AI Agent PlaybookGet the brief →
ReleaseInsight · On RadarHabr AI→ original

The pgw gateway hides names and tax IDs from ChatGPT right on an office PC, using 1.5–2 GB of RAM

Companies ban ChatGPT, yet employees still paste client contracts and tax IDs into it. The developer built pgw (privacy gateway LLM): it runs on an ordinary office PC with 8 GB of RAM, uses 1.5–2 GB, and swaps full names, tax IDs and SNILS numbers for tags such as [PERSON_1] before sending. The model sees the tags, and the reply comes back with the real data in the correct grammatical case. This lets a security officer allow AI use without an expensive leak-prevention system.

AI-processed from Habr AI; edited by Hamidun News
The pgw gateway hides names and tax IDs from ChatGPT right on an office PC, using 1.5–2 GB of RAM
Source: Habr AI. Collage: Hamidun News.
Listen to article
Article Fact Sheet & Key Figures
ParameterDetails
Primary sourceHabr AI ↗
Editor-in-Chief
Key metric #1Fine for a personal data leak from May 30, 2025: 3 to 20 million rubles
Key metric #2Across 57 pages of scans, peak memory use was about 1.55 GB
Key metric #3pgw blocks encrypted archives even with a one-time permission

Picture an accountant who needs to quickly write a reply to a client. The security department has banned ChatGPT, so he opens the chatbot on his personal phone and pastes in the client's surname, tax ID and contract amount. The ban is in place, yet the data has left the company, and the company's logs contain no record of it.

The author of a Habr review is building a tool to close this gap: pgw (privacy gateway LLM, that is, a "privacy gateway for language models") installs on an ordinary office PC and replaces sensitive data with tags before the request leaves the computer. It uses 1.5–2 GB of the 8 GB of RAM, so no separate server or graphics card is needed.

Why the ban doesn't work

Figures from a Kiberdom survey from November 2026: over the half year, a quarter of employees at Russian companies uploaded commercial offers to neural networks, 22% uploaded financial calculations, 21% uploaded work correspondence, 16% uploaded contracts, and 12% uploaded client databases. Only 5% had seen written rules for working with AI.

The security officer's position is understandable. From May 30, 2025, the fine for a personal data leak is 3 to 20 million rubles, and for a repeat offense it is 1–3% of revenue (no less than 20 million and no more than 500 million). In 2025, 51% of companies did not increase their information security budgets, and 16% cut them. Commercial leak-prevention systems such as Solar Dozor can intercept prompts, but they come with licenses and an implementation project. An order is the only protection that costs zero rubles.

The problem is that the ban shifts the risk from visible to invisible. Data leaves through a personal phone and a personal account. Open solutions such as guardrails-llm-filter from Cloud.ru, PasteGuard, or LiteLLM with Presidio exist, but the author calls them toolkits for developers: they require Docker or a separate server, and Russian names in oblique cases are often not covered.

How pgw works

The idea is to use hardware that has already been bought. An employee has an ordinary PC with 4 cores and 8 GB of RAM and no graphics card. pgw installs as an MSI package, lives as a tray icon, and listens on 127.0.0.1, meaning the computer itself. To a chat client, it looks like the standard OpenAI API. In Chatbox, an IDE, or an agent, it is enough to change the address to http://127.0.0.1:8765/v1. It supports OpenAI Chat Completions with streaming and tool calls, as well as Anthropic Messages.

For example: an employee writes "Morozova Anna Sergeevna, tax ID …, SNILS …, asks to return 1,250,000 rubles." The model receives "[PERSON_1], tax ID [INN_1], SNILS [SNILS_1], ≈1 million rubles." "Morozova Anna Sergeevna" and "Morozovoy" map to the same tag; otherwise the model would conclude there are two people. The sum is rounded to its order of magnitude: "about a million" is enough for the reply. In the response, the tags are swapped back, in the correct case.

Before sending, a preview shows what was found and how it was replaced. A value can be skipped once, and the skip is recorded in the log, but there is no such button for keys, passwords, or card numbers. Screenshots pass through two text recognition engines, and personal data, faces, and QR codes are blacked out. The image is then recognized again: if text can still be read, sending is blocked. Across 57 pages of scans and images, peak memory use was about 1.55 GB. Voice is transcribed locally with the GigaAM v3 model, and Office documents, PDFs, and EML/MSG emails are parsed on the PC.

Blocking on failure, logging, and limitations

The main principle is fail-closed: anything that cannot be parsed does not get sent. An unknown format, an unrecognized image, or an extra field in a request results in a block and a log entry. Encrypted files (password-protected Office files, PDFs, ZIPs, OpenPGP, and S/MIME) are never sent: the password is often in the same correspondence, and if the model received both, the masking would be pointless.

Policy is set by a file: BLOCK, REDACT, PSEUDO, GENERALIZE, or ALLOW for each data type. The log records the time, the type of finding, the action, and an HMAC fingerprint of the value, keyed with a key that never leaves the PC. Entries are chained by hashes and signed with ed25519; the command pgw audit verify will reveal tampering. The optional pgw-server distributes signed rules and collects logs without the values themselves.

Technically, it is written in Go without cgo. The catalog has 72 rules, and tax IDs, SNILS, OGRN, cards, and accounts are checked with checksums so bare digits do not trigger false positives. Text is normalized first: invisible characters and line breaks are removed, and Latin lookalike letters are replaced with Cyrillic. Names are caught by the OpenCorpora dictionary and the Slovnet NER neural network from the Natasha project.

The author names the limitations himself. pgw only sees applications where the model address is pointed at it. Web versions such as chatgpt.com, giga.chat, and alice.yandex.ru bypass it, and they have to be blocked with a DNS filter or browser policy. For indirect signals such as "chief accountant of the Kazan branch," pgw only flags them with a warning, and the decision stays with a human. The author is still finishing the tool.

Practical takeaway: if you are responsible for information security or are introducing AI in a company, a ban without an approved channel almost guarantees that data will move into the shadows. A local gateway with fail-closed blocking and a verifiable log is a working alternative, but only together with closing off the web versions of chat services.

Story

Key Questions Answered

Why the ban doesn't work?

Figures from a Kiberdom survey from November 2026: over the half year, a quarter of employees at Russian companies uploaded commercial offers to neural networks, 22% uploaded financial calculations, 21% uploaded work correspondence, 16% uploaded contracts, and 12% uploaded client databases. Only 5% had seen written rules for working with AI. The security officer's position is understandable.

How pgw works?

The idea is to use hardware that has already been bought. An employee has an ordinary PC with 4 cores and 8 GB of RAM and no graphics card. pgw installs as an MSI package, lives as a tray icon, and listens on 127.0.0.1, meaning the computer itself. To a chat client, it looks like the standard OpenAI API. In Chatbox, an IDE, or an agent, it is enough to change the address to http://127.0.0.1:8765/v1. It supports OpenAI Chat Completions with streaming and tool calls, as well as Anthropic Messages.

What are the key details on Blocking on failure, logging, and limitations?

The main principle is fail-closed: anything that cannot be parsed does not get sent. An unknown format, an unrecognized image, or an extra field in a request results in a block and a log entry. Encrypted files (password-protected Office files, PDFs, ZIPs, OpenPGP, and S/MIME) are never sent: the password is often in the same correspondence, and if the model received both, the masking would be pointless. Policy is set by a file: BLOCK, REDACT, PSEUDO, GENERALIZE, or ALLOW for each data type.

ZK
Zhemal Khamidun — Head of AI at Alpina Digital · MIPT (academic supervisor of the Tech Entrepreneurship department). Building AI products since 2019. Hamidun News is a pet project that grew into a production aggregator with 6,000+ readers.
✦ Unified AI Workspace · Nomad

Test Frontier LLMs & Autonomous Agents in One Workspace

Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.

Try Nomad AI →Launch Nomad Agent
Jemal Hamidun

Editor-in-chief · Cite this analysis

Jemal Hamidun

Head of AI at Alpina Digital · Academic Supervisor of the Tech Entrepreneurship Department at MIPT

Head of AI & CPO of AlpinaGPT at Alpina Digital, Academic Lead of Tech Entrepreneurship at MIPT. Founder of Hamidun News and Vibe Academy.

Ready-to-paste citation for journalists, blogs and Telegram channels

Source: Hamidun News — The pgw gateway hides names and tax IDs from ChatGPT right on an office PC, using 1.5–2 GB of RAM https://news.hamidun.com/en/news/18265/the-pgw-gateway-hides-names-and-tax-ids-from-chatgpt-right-o

What do you think?
Loading comments…