DATE_01 or
ADDRESS_01 cannot reason about a patient's age or a claim's region.
Smart generalization replaces a detected DATE_TIME or ADDRESS span
with an abstracted value instead of a placeholder, so the prompt keeps
the shape of the fact while losing the identifying detail.POST /api/v1/redact, via the transforms body field.X-Kindi-Transforms header./api/v1/mask does not support it: generalized text has no
{token: original} mapping, so it would break the envelope round-trip.
That is v2 territory.| Input span | Context | Output |
01/15/1985 | near a DOB cue (DOB, date of birth, born, تاريخ الميلاد, مواليد) | age 41 |
١٤ أبريل ١٩٩٠ | near مواليد | العمر: 36 عاماً |
14 April 2024 | no DOB cue | April 2024 |
14/04/2024 | no DOB cue | 2024 (a numeric month would leak original digits) |
١٤/٠٤/٢٠٢٤ | no DOB cue | ٢٠٢٤ (Eastern-Arabic digits kept as written) |
King Fahd Road, Al-Olaya District, Riyadh 12345 | — | Riyadh |
شارع الملك فهد، حي العليا، الرياض 12211 | — | الرياض |
حي الشاطئ، الدمام، المنطقة الشرقية | — | المنطقة الشرقية (region outranks city) |
١٤ / ٠٣ / ١٤٤٦ هـ) or verbal; v1 has no Hijri
calendar support.10:30 صباحاً, 9:15 PM).17 March).generalized_count reports how many
spans actually generalized; everything else fell back to placeholders.
pii_count and entity_counts are unchanged either way, and detection
itself is untouched; generalization runs strictly after it.1234{ "text": "Patient DOB: 01/15/1985, seen at Al-Olaya District, Riyadh", "transforms": {"DATE_TIME": "generalize", "ADDRESS": "generalize"} }
123456{ "redacted_text": "Patient DOB: age 41, seen at Riyadh", "pii_count": 2, "entity_counts": {"DATE": 1, "ADDRESS": 1}, "generalized_count": 2 }
DATE_TIME and ADDRESS keys are accepted, only "generalize" as
the value; unknown keys or values are rejected with 422.1234POST /api/v1/proxy/openai/v1/chat/completions Authorization: Bearer mk_live_... X-Provider-Key: sk-... X-Kindi-Transforms: DATE_TIME,ADDRESS
April 2024, Riyadh)
instead of a <MASKED_…> token. A generalized span gets no mapping
entry, so the reply is not rewritten back; the abstraction is permanent
for that conversation. Spans that fail closed still get a mask token and
round-trip normally. An unknown type in the header is a
400 invalid_transforms.transforms off; the
default placeholder behavior discloses nothing./mask support (breaks the envelope round-trip).PERSON or ORGANIZATION has no
obviously safe abstraction).