PII handling — redaction, PDPA-2023, and citizen dignity
PII کا انتظام — مٹانا، PDPA-2023، اور شہری وقار
36 min read
Three ways to see it
PII, personally identifiable information, is anything that lets someone work out who an individual is. The obvious: full name, CNIC, passport number, mobile, email, bank account, address. The less obvious: date of birth combined with city, biometric template, IP address, browsing pattern, photograph. The much less obvious: voice recording, gait pattern, handwriting sample. Under PDPA-2023, anything that identifies a Pakistani citizen, alone or in combination with other data, is regulated. Sending it to a third party without lawful basis or consent is a violation. The chat with an AI vendor is sending it to a third party. There is no informal exemption for 'I was just asking'.
Three redaction strategies, in order of strength. Strategy one: tokenisation. Before the prompt leaves your machine, every CNIC is replaced with a stable token like CNIC_A1B2, every name with PERSON_001, every phone with PHONE_X. The AI sees only tokens. Whatever the AI returns is then de-tokenised inside your environment before showing the user. The AI never saw real PII. Strategy two: aggregation. Instead of asking 'is this customer creditworthy', ask 'is a customer with income X, age Y, employment type Z creditworthy', dropping name and CNIC entirely. The decision logic stays useful, the identity disappears. Strategy three: on-premise or in-country processing. Run the model inside your own data centre (or a Pakistani cloud region with data-residency guarantees) so the data physically never leaves jurisdiction.
Two practical tools that do most of the work. First, Microsoft Presidio (an open-source library) auto-detects PII patterns across English and many other languages and replaces them with placeholders. Plug it in before every prompt; it adds about 50 milliseconds. For Urdu and Pakistani-specific patterns like CNIC format (5-digit, 7-digit, 1-digit), you write a small extension. Second, the major vendors now offer enterprise tiers (Anthropic Enterprise, OpenAI Enterprise) with contractual no-training-on-your-data, encryption-at-rest, and data-residency options. For most regulated workloads in Pakistan, paying for the enterprise tier is a fraction of the cost of one breach.
Quick check
Quick check: what makes modern AI different from a rule-based program?
The why-tree
Why-tree level one: why is consent not enough on its own? Because consent buried in 30 pages of terms is not real consent. PDPA-2023, like GDPR before it, demands consent that is informed, specific, and revocable. Most AI deployments default to broad consent that would not survive a court challenge. Redaction is the engineering belt to back up the legal belt.
Try this with Claude
AI-edge prompt: 'Here is a sample customer loan application [paste with synthetic data]. Identify every field that would be PII or sensitive personal data under Pakistan's PDPA-2023. For each, recommend either redact-and-tokenise, aggregate-and-drop, or keep-with-consent. Output as a markdown table. Then write the SQL or Python snippet that performs the redaction before the data hits any external API.'
Sources
Sources and further reading. Pakistan Personal Data Protection Act 2023 (moitt.gov.pk for current draft and implementation rules). OWASP LLM Top 10, LLM06 Sensitive Information Disclosure. Microsoft Presidio documentation (microsoft.github.io/presidio). Anthropic, Data privacy and Enterprise documentation (anthropic.com/legal/privacy). OpenAI Enterprise privacy commitments. NADRA Ordinance 2000 on identifier handling. EU GDPR Article 22 (automated decision-making) for context on how similar frameworks have evolved.