Technology1 min read

Laranon: Reversible PII Anonymization for Laravel and LLMs

By · Published by Everything Blog

In short

The tool strips sensitive records, such as identification numbers and banking information, and swaps them with tokens before external processing occurs. Once the artificial intelligence completes its output, the local mapping restores the original text seamlessly, even supporting streaming restoration for Server-Sent Events. The software requires no external dependencies outside the framework and provides built-in detection rules for English and Spanish text.

Key points

  • Single-request chat sessions hold mappings in memory and discard the sensitive data autom…: Single-request chat sessions hold mappings in memory and discard the sensitive data automatically once the turn concludes.
  • Multi-step interactions and background jobs rely on scopes encrypted with the application…: Multi-step interactions and background jobs rely on scopes encrypted with the application key and cached by default for six hours.
  • Teams can persist encrypted data maps within a database or destroy them permanently using…: Teams can persist encrypted data maps within a database or destroy them permanently using a dedicated forget method.

Sources checked by our analysis pipeline: 1

Laranon is a package by Eduardo Lázaro that removes personal data from text before you send the text to an LLM. It replaces names, ID numbers, and bank details with placeholder tokens. A map of each token to its real value stays on your server. When the model replies, you use the map to put the real values back.

The package includes detection packs for Spanish and English. It has no dependencies other than Laravel.

Laranon also includes these features:

- Checksum validation for IBANs, credit card numbers, and the Spanish DNI, NIE, CIF, NSS, and CCC formats. Laranon ignores a DNI that has a wrong control letter.

- Per-word name tokens. "Smith" gets the same token in "John Smith" and in "Mr. Smith".

- Scoped token maps that Laranon encrypts and saves in the cache or the database. Use them for chats and queued jobs that run across more than one request.

- Known entities. You give Laranon values to replace, or you load them from Eloquent models with the

Anonymizable

trait. - Streaming restore for SSE responses. A…

Technology