Skip to main content

Command Palette

Search for a command to run...

GLiNER-PII: PII Detection Beyond Regex for DLP

title: "Why regex-based DLP breaks on real documents (and what works instead)" tags: - security - dlp - pii - ai - nlp canonical_url: "https://yassinech-99.github.io/yassinecherair.github.io/blog/gliner-pii-data-loss-prevention/" portfolio_url: "https://yassinech-99.github.io/yassinecherair.github.io"

Most DLP still runs on patterns: SSN regex, Luhn checks, keyword lists. That works when data sits in labeled fields. It fails the moment someone pastes a clinical note, a support ticket, or a contract paragraph into chat:

"Patient Jordan Wells, DOB 04/14/1979… Contact (202) 555-0193…"

No column names. Mixed entity types. Names that look like companies. International IDs your rule pack never saw.

Regex is fast but blind to context. LLMs understand context but are slow, non-deterministic, and often send the very data you're trying to protect to a third-party API.

There's a middle path: small, specialized NER models that score (span, label) pairs instead of generating text—fast enough for pipelines, structured enough for audit logs.

I wrote a longer piece covering:

  • Where traditional and network DLP stop
  • Why GLiNER-style span scoring fits unstructured PII
  • NVIDIA GLiNER-PII (570M params, 55+ entity types)
  • A Python NIM API example
  • A terminal demo of live detection

Read the full article (code + demo):

https://yassinech-99.github.io/yassinecherair.github.io/blog/gliner-pii-data-loss-prevention/