If your app sends user text to an LLM API, that text may contain names, phone numbers, bank details or national ID numbers. Most redaction tools for this problem are built around English. If your users write in Arabic, Darija or French, a lot of personal data goes straight through.

We built Aman (أمان) to close that gap. It is a small open-source gateway that sits between your application and any OpenAI-compatible API.

What it does

You point your app at Aman instead of your LLM provider. For every request, Aman:

  1. Scans the messages for personal data.
  2. Replaces each detection with a stable placeholder such as __AMAN_PII_EMAIL_1__.
  3. Forwards the cleaned request to the upstream you chose (OpenAI, Ollama, vLLM, llama.cpp and others).
  4. Restores the original values in the response before your app sees it, including streamed responses.

The mapping between placeholders and real values stays in memory on your machine. It is never sent upstream.

What it detects

  • Emails, Luhn-validated card numbers and API keys (sk-..., ghp_..., AKIA... and similar)
  • Moroccan CIN numbers, 15-digit ICE company IDs (matched near an ICE hint), +212 and 06/07 mobile numbers, and MA IBANs
  • Person names in Arabic and French, such as السيد يوسف العلوي or Mme Karima Bennani

Detection is rule-based and gazetteer-based. There is no model to download and no third-party call. It is intentionally conservative and we document its limits in the README. It is a strong layer, not a guarantee, so pair it with your own review for regulated workloads.

Try it

Aman has zero dependencies and needs Python 3.9 or later.

python aman.py serve --upstream http://localhost:11434/v1 --port 8787 

Then change one line in your app:

from openai import OpenAI client = OpenAI(base_url="http://127.0.0.1:8787/v1", api_key="...") 

You can also preview what gets redacted without running the server:

python aman.py scan "My email is foo@example.com and my number is 0670472999" 

The audit log records only counts by type, never the values.

Using it as a library

import aman redactor = aman.Redactor() r = redactor.redact("Call me on 0670472999") r.clean_text # placeholder instead of the number redactor.restore(r.clean_text, r.mapping) # original text back 

For token streams there is a StreamingRestorer, which handles placeholders that get split across chunks.

What is next

On the roadmap: config-driven detector toggles and custom regex rules, a bigger Darija name list, a LiteLLM guardrail adapter and a Prometheus metrics endpoint.

The code is MIT licensed: https://github.com/ManadgerTech/aman

Issues and pull requests are welcome, especially from people who write Arabic, Darija or French and can tell us what we miss.

Made in Morocco by Manadger Tech.