Privacy masking
What the Privacy Gateway hides before any text reaches an AI model, and what it does not hide.
BuyerSupplierAdminJudgeLast updated 2026-10-20
What it is
The Privacy Gateway sits in front of every model call. It replaces personal and sensitive financial identifiers with placeholder tokens. The AI sees the tokens. Setu's own code keeps working on the real values and puts them back in the final answer.
Masking is a form of privacy masking: a bank account number becomes a token such as ⟦ACCT_1⟧.
What gets masked
| Type | Examples |
|---|---|
| National ID | Bangladesh NID numbers |
| Passport | Passport numbers |
| Phone | Bangladesh and China mobile numbers |
| Bank account | Account numbers, IBAN (with a checksum test), SWIFT/BIC codes |
| Email addresses | |
| Person names | Names already known to Setu, and lines labelled "Account holder" or "Beneficiary" |
| Amounts | Amounts in documents and money values in tool results (on by default) |
Detection copes with tricks: Bangla and Chinese digits, zero-width characters, and digits split by spaces.
How it works
Mask
Before a model call, the gateway swaps each sensitive value for a token. The same value always gets the same token inside one request.Re-scan
The outgoing text is scanned again. A value that slipped through is counted as a leak and masked.Call the model
The model reads and answers using tokens only.Restore
Setu's code replaces tokens with the real values in the answer you see.
The map between tokens and real values (the "vault") lives in memory for one request. It is never stored, logged or sent to the model.
What the results mean
- With amounts masked, the model cannot add or compare amounts. The numbers in an answer are tokens restored by code.
- Setu's tools work on real values. Only the model sees masked text.
- Stored privacy records keep the masked text and counters, never the vault.