hfiguera

hfiguera

Obscura - PII detection and anonymization for Elixir

Hi everyone,

I’ve released Obscura 0.1.1, an Elixir library for detecting and anonymizing personally identifiable information before it reaches logs, external APIs, analytics systems, or LLM providers.

The dependency-light core recognizes structured identifiers such as email addresses, phone numbers, credit cards, SSNs, IBANs, IP addresses, URLs, and domains. Optional local Nx/Bumblebee profiles add person, location, and organization recognition without requiring a hosted recognition service.

A basic redaction looks like this:

{:ok, result} =
  Obscura.redact(
    "Contact jane@example.com or call 202-555-0188",
    profile: :fast,
    entities: [:email, :phone]
  )

result.text
#=> "Contact [EMAIL] or call [PHONE]"

Obscura also supports nested Elixir data:

input = %{
  customer: %{email: "jane@example.com"},
  password: "secret"
}

{:ok, result} =
  Obscura.redact(input,
    entities: [:email],
    field_policies: %{password: :drop}
  )

result.data
#=> %{customer: %{email: "[EMAIL]"}}

The available operators are replacement, redaction, masking, hashing, pseudonymization, and application-defined callbacks. Pseudonymization can use an ETS-backed vault when an application needs to restore selected values after an LLM or external-service round trip.

The three stable profiles serve different use cases:

  • :fast uses dependency-light deterministic and parser-backed recognition.
  • :balanced adds one local model for general person, location, and organization recognition.
  • :accurate uses a two-model cascade for the highest measured general accuracy.

Model-backed profiles require explicit preparation and reusable runtime resources. Normal analysis never downloads a model implicitly.

One important asset note: :balanced and :accurate currently use an OntoNotes-trained TNER checkpoint. Obscura does not bundle or license that checkpoint, and LDC confirmed that commercial use requires LDC for-profit membership. The dependency-light :fast profile is unaffected. The complete review is documented in the model-asset licensing guide.

Links:

This is the first public release, and I’d particularly appreciate feedback about the API, entity coverage, structured-data behavior, model preparation, deployment, performance, and use cases that the current profiles do not handle well.

Most Liked

hfiguera

hfiguera

I wrote a follow-up engineering case study about validating Obscura’s model-backed profiles on Linux with an NVIDIA Tesla T4 and EXLA.

The article covers the complete path from a CPU environment to real CUDA inference, including an NVSHMEM ABI failure that initially prevented EXLA from loading.

Rather than treating CUDA discovery as sufficient proof, I verified four independent signals:

  • EXLA discovered the CUDA client.
  • A compiled Nx operation returned an EXLA-backed tensor.
  • XLA identified the Tesla T4 and cuDNN runtime.
  • The BEAM process appeared in nvidia-smi using GPU memory.

I then prepared the :balanced and :accurate profiles and ran real Obscura inference. This is a compatibility report on one Tesla T4, not a production throughput benchmark.

thiagomajesk

thiagomajesk

Thanks for sharing @hfiguera, this is extremely useful! :rocket:

alvinkatojr

alvinkatojr

Woah, this is neat! Thanks for sharing!

Where Next?

Popular in Announcing Top

Hal9000
Here is my first stab at this. README pasted below. https://github.com/Hal9000/elixir_random Comments and critiques are welcome. Thank...
New
alisinabh
Hey everyone i’ve developed a library for Jalaali calendar for elixir which supports converting Gregorian dates to Jalaali and vice vers...
New
josevalim
Yes, yet another parser combinator library! Most of the parser combinators in the ecosystem are either compile-time, often using AST tra...
159 19951 141
New
tmbb
PhoenixWS - Websockets over Phoenix Channels Source code on Github here: GitHub - tmbb/phoenix_ws: Websockets implemented over Phoenix Ch...
New
kip
Image is an image processing library for Elixir. It is based upon the fabulous vix library that provides a libvips wrapper for Elixir. I...
622 19610 194
New
type1fool
WebAuthnLiveComponent WebAuthnComponents See this post about renaming the package. Passwordless authentication for Phoenix LiveView app...
New
zoltanszogyenyi
Hey everyone :waving_hand: Excited to join this forum - I am one of the founders and current project maintainers of a popular and open-s...
New

Other popular topics Top

rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New
AngeloChecked
What learn first? Rust or Elixir Hi Elixir community! I’m here because i want learn a new language. I’m a junior developer and mainly i ...
New

We're in Beta

About us Mission Statement