HabrSeptember 9, 2026🇷🇺Translated from Russian

PII-Guard: Open-Source Detector for Personal Data in Russian Text

PII-Guard, an open-source detector for personal data in Russian text, has been released by NLP researcher Andrey Ivanov from the R&D laboratory of red_mad_robot. The system addresses the growing need to protect sensitive information when users and companies send working texts to language models.

Personal data such as names, phone numbers, document numbers and addresses frequently accompany prompts. Companies therefore build masking pipelines that anonymize text before model inference. However, simple masking destroys semantic links, forcing models to answer questions about “**** called ****” without knowing how many people are involved or who called whom.

The new requirement is reversible pseudonymization: real values must be replaced by structured placeholders that models can process naturally, after which the original data is restored in the final answer.

From regex to hybrid detection

The first prototype relied on regular expressions. While telephone numbers, INN, SNILS and card numbers have predictable length and structure, real-world text contains spaces, dashes, typos and extra characters that break rigid patterns. Moreover, a 16-digit sequence could be either a bank card or an order ID, and a 10-digit string could match both INN and passport formats.

Control-sum verification was added next. Bank cards use the Luhn algorithm, INN and SNILS employ weighted sums, and OMS policies again apply Luhn. Additional structural checks cover BIK prefixes and postal-index ranges. These filters reduced false positives, yet arithmetic validation alone cannot distinguish a genuine document from a coincidental numeric string that happens to satisfy the checksum.

Context windows were introduced to look for nearby cue words such as “паспорт”, “ИНН” or “полис”. Positive keywords must lie within type-specific distance limits; negative keywords such as “биржевой” can veto an index match regardless of distance. When multiple candidates compete, the system selects the highest-confidence match after ordering document types from most distinctive (birth certificates, military IDs) to most ambiguous (simple six- or ten-digit sequences).

Adding semantic understanding

Names, addresses and telephone numbers lack rigid formats, so rules cannot locate them reliably. The team therefore annotated their own datasets and fine-tuned a ruBert-base NER model. The model handles semantic entities such as person names and addresses while also capturing documents missed by rules because of typos or irregular spacing.

The final architecture runs two independent streams. The rule-based stream normalizes text, extracts candidates, validates checksums and applies keyword context. The model stream processes the entire text and returns its own spans. An arbitration module merges results: when spans overlap but labels differ, rules win; when only the model finds an entity, its prediction is accepted; non-overlapping spans from both streams are retained.

Pseudonymization and grammatical restoration

Detected entities are replaced by XML-style tags containing type, numeric ID and, for persons, grammatical gender inferred by a Russian morphology library. The tag format was chosen to avoid accidental collisions with ordinary text or other system markup. After the model returns its answer, real values are substituted back, with morphological analysis ensuring correct case for names and addresses.

Evaluation was performed on four public datasets, one of which is the team’s own. On the intersection of entity types supported by all compared systems, PII-Guard achieved the highest micro-F1 scores under both strict span matching and type-overlap criteria. The project, datasets and code are publicly available.

Related articles

HabrPrivacy & Surveillance

Amnezia VPN Survives Coordinated Russian Censorship Campaign Targeting AmneziaWG Protocol Fingerprints

Amnezia VPN has published a detailed post-mortem on the multi-wave blocking campaign conducted by Russian authorities against its Amnezia Free and Amnezia Premium services during June and July. The company describes a shift from simple protocol blocking to sophisticated fingerprinting of AmneziaWG traffic combined with infrastructure DDoS attacks and automated IP-subnet blacklisting. Engineers closed multiple detection vectors including zero-length UDP packets, fixed-size keepalive messages, handshake timing patterns, and nonce zero bytes. The incident forced accelerated migration to AmneziaWG 2.0, discontinuation of legacy client support, and development of AmneziaWG 3.0 while expanding VLESS infrastructure as a backup. Self-hosted users largely avoided direct protocol blocks but still faced subnet-level restrictions. The report highlights how Roskomnadzor now applies cumulative scoring across multiple traffic features rather than single definitive markers.

HabrPrivacy & Surveillance

Data Masking: 8 Critical Questions Businesses and Developers Ask About Protecting Sensitive Data

Garda expert Dmitry Larin addresses common challenges in data masking during a recent webinar titled 'Data Masking: Battle of Opinions'. The discussion covers why masking remains essential even when encryption is deployed, how to preserve application functionality after anonymization, and the performance trade-offs of processing large databases such as 5 TB PostgreSQL instances. Different masking types including static, dynamic, selective, and streaming are explained with specific use cases for DevOps pipelines, external contractors, and BI systems. The article also examines why machine learning alone is insufficient for discovering personal data and why custom scripts fail at scale across heterogeneous environments like PostgreSQL and Oracle. Practical recommendations include combining masking with encryption, using deterministic transformations for deduplication, and separating replication from masking tasks to avoid production impact.

AntiMalwarePrivacy & Surveillance

MAX Desktop Client Tested for VPN Detection on Windows, No Tracking Signs Found

A Habra user named Slava_B conducted an experiment on September 8, 2026, to determine whether the MAX desktop client on Windows could detect or route traffic through a VPN configured at the router level. The setup used a Keenetic router that directed Russian resources directly while sending other connections via an OpenConnect tunnel to a European VPS, with no VPN client or virtual adapter present in Windows itself. Monitoring tools including Process Monitor, Wireshark, TCPView, and tcpdump revealed that MAX.exe and MAX-service.exe processes communicate locally and connect to MAX/ONEME infrastructure along with AppTracer services. The application repeatedly accessed MachineGuid, computer name, proxy settings, device IDs, and microphone/camera information, though these reads may support diagnostics and anti-fraud functions. No connections appeared on the VPN interface, and the client did not attempt to reach IP-checking services, Telegram, or WhatsApp. The researcher noted that TLS traffic was not decrypted, so actual transmission of identifiers could not be confirmed, and results apply only to this router-based configuration.

AntiMalwarePrivacy & Surveillance

Google to Add Explicit Content Warnings in Android System Photo Picker

Google is preparing a new safety feature for the system photo picker in Android that will scan images and videos for explicit or nude content. The tool is designed to warn users before they share intimate photographs, whether accidentally or due to a momentary lapse in judgment. This functionality will operate at the system level, meaning it applies across multiple apps that use the built-in photo selector. The feature aims to reduce the risk of unintended distribution of private images that could lead to embarrassment or privacy violations. By integrating the check directly into Android, Google seeks to provide a consistent layer of protection without requiring third-party applications to implement similar logic themselves.