Aman
Aman (أمان, "safety") is Mizan's PII redaction safety net — it detects and strips personally identifiable information out of a request beforeit's routed to any LLM provider. It's opt-in, configured per Mizan API key, and built for companies — especially in markets like KSA and UAE — that can't send sensitive customer data to a third-party model.
What it is
When Aman is enabled for a key, Mizan scans every outbound request made with that key — every message, including multimodal text parts — for a set of PII patterns (email addresses, phone numbers, national IDs, and more). Anything it finds is replaced with a typed placeholder like [EMAIL] or [PHONE] before the request goes anywhere else. The provider that ultimately serves the call never sees the original data — only the redacted version.
How it works
Redaction runs as the very first step of the gateway pipeline, immediately after your request is parsed and before anything else touches it — the response-cache lookup, Auto Router classification, Switchboard model resolution, and the actual call to the provider all only ever see the redacted body. Detection is regex/pattern-based, not an extra model call: it adds no latency and no cost to the request.
Aman only redacts the outbound request — it doesn't touch or rewrite the provider's response, and it's a one-way replacement (placeholders are never reversed back to the original value), so nothing sensitive needs to be stored to make it work.
Detected PII types
v1 covers a fixed, pattern-based set of entity types, chosen for KSA/UAE customers in particular — each can be turned on or off independently per key:
- Email addresses
- Phone numbers — including Saudi (+966) and UAE (+971) mobile formats
- Credit card numbers — Luhn-validated, so an arbitrary long number isn't flagged
- IBAN
- Saudi National ID / Iqama
- UAE Emirates ID
- IP addresses
Every numeric pattern above matches regardless of digit script — a phone number or national ID written in Eastern Arabic-Indic digits (٠١٢٣٤٥٦٧٨٩) is detected exactly the same as one written in Western digits, and any other Arabic-Indic digits in the message that aren't part of a match are left completely untouched.
Enabling it per key
Aman is off by default and configured per Mizan API key, not per request — there is no request-level header or field to turn it on. Enable it and pick which entity types to catch from the Aman settings page, under Configuration → Configuration tab. Once enabled, redaction applies automatically to every request made with that key — nothing to change in your application code.
Playground
The Aman page's Playground tab lets you paste sample text and see exactly what Aman would redact, without making a real API call — it runs the same detection code the gateway uses in production, so what you see there is what a live request would produce.
v1 scope & limits
Aman v1 is deliberately pattern-based, not a general PII classifier — it will not catch freeform names, physical addresses, or other unstructured PII that doesn't match one of the patterns above. That needs an NER or LLM-based pass, which is planned but not yet built (it would add latency and cost to every request, so it's being kept separate from this zero-overhead pattern-based layer). Only text content is scanned — images and other non-text parts of a multimodal message pass through untouched.
The Saudi National ID / Iqama pattern in particular is a bare shape match (10 digits starting with 1 or 2) with no external checksum to validate against, unlike credit cards' Luhn check — so an unrelated 10-digit number that happens to start with 1 or 2 (an order ID, for example) can be flagged too. If that's a problem for your traffic, turn that entity type off for the key and rely on the others.