Forward Deployed EngineeringEnterprise SecurityPrivacy-Preserving AI
A customer refuses to send PII to an LLM API. What are your options?
Question 54 of 73 · Updated
On this page
- Interview-ready answer
- 1. Establish the boundary before designing the solution
- 2. Choose an architecture that satisfies the restriction
- Redaction versus pseudonymization
- 3. Keep enforcement at the egress boundary
- Tested example: project approved fields instead of forwarding the record
- 4. Private endpoints, residency and contractual controls
- 5. Prove privacy and utility together
Interview-ready answer#
I would first clarify the customer's actual trust boundary. Do they prohibit sending personal data to any externally operated model, prohibit leaving a particular network or region, or simply require that the provider not retain or train on their data? Those are different constraints.
My default is to keep personal information inside the customer's approved environment and send only the minimum non-identifying information necessary for the task. Where the model needs relationships between entities, I can evaluate scoped pseudonyms and restore identifiers locally, but only if the customer permits the residual re-identification risk. If the task genuinely requires raw PII and external transmission is prohibited, I would run inference inside an approved customer-controlled environment or use a deterministic or human-assisted alternative.
A private endpoint, encryption in transit, contractual no-training commitment or zero-retention arrangement does not by itself mean that PII was never transmitted to the provider. I would not propose any of those as a substitute for a strict no-transmission requirement.
1. Establish the boundary before designing the solution#
Ask the customer's security, privacy and business owners four questions:
- What information is restricted? Include direct identifiers, quasi-identifiers, sensitive free text, attachments, metadata and derived information.
- Where is processing permitted? Distinguish approved third parties, regions, customer-managed cloud environments, private networks and physically isolated facilities.
- Which functions actually need the restricted information? Classification, drafting and generic reasoning may not require the original identity.
- What evidence is required for approval? Threat model, data-flow inventory, contractual commitments, retention controls, egress tests and measurable task quality.
Define the restriction as an enforceable data-flow policy, not a prompt instruction. PII is often broader than names, email addresses and phone numbers: combinations of location, dates, employment, rare attributes or transaction histories may identify a person. Applicable legal definitions vary by jurisdiction.
2. Choose an architecture that satisfies the restriction#
| Option | When appropriate | Principal trade-off |
|---|---|---|
| Data minimization and field allowlisting | Task can work with approved categories or aggregates | Reduces context available to the model |
| Local redaction or generalization | Identity is incidental to text understanding | Detection misses, loss of useful details, residual identification risk |
| Scoped tokenization or pseudonymization | Task requires entity consistency, and customer permits transformed personal data | Secure mapping, linkability and re-identification risks |
| Approved managed private deployment | Customer allows a specified processor or cloud boundary | Verify actual processing, administration, telemetry and retention arrangements |
| Self-hosted or on-device model | Raw PII must stay in customer-controlled infrastructure | Hardware, model quality, security patching and serving operations |
| Deterministic workflow or human review | Task does not need generative reasoning, or no acceptable inference environment exists | Less flexible automation |
Privacy requirements are hard constraints, not preferences to trade against model quality. Compare quality and economics only among architectures that meet the approved boundary.
Redaction versus pseudonymization#
Redaction removes or obscures identifying material, for example replacing a name with a generic person marker. Generalization replaces a precise value with a broader category when that still supports the task.
Pseudonymization replaces identifiers with scoped substitutes, such as CUSTOMER_1 and CUSTOMER_2, while maintaining necessary relationships. An opaque-token mapping can remain in a restricted local vault, with authorized rehydration after generation. Prefer narrowly scoped, unpredictable tokens where reversibility is required. Stable global tokens create unnecessary cross-request linkage, and unkeyed hashes of low-entropy identifiers can be guessed. Keyed hashes may help with controlled linkage but do not make information anonymous.
Removing direct identifiers does not establish anonymization. A person's unique circumstances, relationships or writing may still reveal their identity. Under privacy frameworks such as the GDPR, pseudonymized information can remain personal data. Obtain customer privacy approval for the actual transformed dataset and intended processing, rather than treating tokenization as automatic permission to export.
3. Keep enforcement at the egress boundary#
The gate must inspect the complete serialized request, not only the user's initial message. System context, retrieved chunks, tool results, filenames, conversation history, embeddings, error traces and request metadata can all carry sensitive information. An approved external endpoint must not have a tool that bypasses the same egress controls.
Use a default-deny outbound policy for unapproved paths, with separate controls for model requests, telemetry and any fallback provider. Keep identity resolution and rendering local. Never let model-generated placeholders select arbitrary identities from the mapping vault: resolve only tokens bound to the authorized request.
Tested example: project approved fields instead of forwarding the record#
When an external model needs only ticket category and workflow state, constructing a fresh payload from approved finite values is stronger than copying an arbitrary record and deleting a few known sensitive keys.
PYTHONdef export_case(record): kinds = {'billing': 'billing', 'login': 'login', 'delivery': 'delivery'} states = {'open': 'open', 'resolved': 'resolved'} kind, state = record.get('kind'), record.get('state') if type(kind) is not str or kind not in kinds: raise ValueError('unapproved category') if type(state) is not str or state not in states: raise ValueError('unapproved status') return {'category': kinds[kind], 'status': states[state]}
Executed verification: Python 3.13.5 passed 227 synthetic checks: 224 category/status/secret-field combinations and three missing-field cases. The checks confirm exact projection or rejection, including arbitrary nested metadata and identifying-looking values.
The function assumes a trusted normalized record and an approved finite taxonomy. It is not a general PII detector. Even approved categories can constitute personal information when linked with an identity, network metadata or other records. Use this pattern only where the full outbound payload and surrounding metadata satisfy the customer's policy.
Free-text redaction is harder: combine task-specific field selection, local entity detection and conservative handling of uncertain content. Regex alone misses contextual identifiers, multilingual names and indirect identification. Evaluate on synthetic and authorized representative cases; block or route uncertain text locally rather than claiming perfect detection.
4. Private endpoints, residency and contractual controls#
These are distinct assurances:
| Control | What it addresses | What it does not establish |
|---|---|---|
| TLS or private network connectivity | Network exposure during transport | That the receiving service never processes PII |
| No-training commitment | Specified secondary use of submitted data | That the request was never received or retained |
| Zero-retention arrangement | Specified storage and retention behavior | That inference occurs within the customer's boundary |
| Regional processing or residency | Specified geographic location of processing or storage | That no third party receives the data |
| Customer-controlled deployment | Greater control over the processing environment | That every component, log and outbound connection is automatically isolated |
If the customer permits managed processing, confirm the exact service, model, region, account configuration, subprocessors, diagnostic logs, abuse-monitoring exceptions, backups, support access, deletion terms and incident obligations with the relevant owners. Do not generalize a contractual commitment for one endpoint to every model or feature.
If the customer prohibits PII leaving its environment, deploy an appropriately licensed model inside that environment, with approved compute, local retrieval and embedding generation, restricted administrative access, and verified egress controls. Account for GPU capacity, quantization quality, concurrency, model updates and incident response. Self-hosting is not privacy by default: external observability, crash reporting, downloaded code, backups and remote support can undermine the boundary.
Confidential computing may reduce exposure to infrastructure operators under an appropriate attestation and threat model, but it does not necessarily satisfy a prohibition on external processing. Encryption at rest or with customer-managed keys also does not mean a normal inference service computes without access to plaintext.
5. Prove privacy and utility together#
For a hypothetical support assistant, the customer's external model may draft a generic response from an approved issue category. Order lookup, customer identity, payment details and personalized rendering stay local. If a disputed case requires detailed private correspondence, route it to the local model or authorized reviewer instead of exporting raw text.
I would agree on release gates with the customer:
- Boundary: inspect actual outbound payloads and metadata in a controlled environment, verify blocked egress and test every alternate path, including telemetry, tools, retries and fallbacks.
- Leakage: use synthetic canary identifiers, representative indirect identifiers and adversarial or malformed inputs. Measure detection misses and over-redaction; zero observed misses in a finite test is not proof of zero leakage.
- Utility: compare task accuracy, evidence completeness, escalation rate and harmful errors before and after permitted transformation.
- Economics: compare total costs of local inference, approved external inference, preprocessing, review and infrastructure operations.
Document the residual risk and approved processing scope. If no permitted design meets the business requirement, say so and negotiate the task scope rather than silently weakening the privacy policy.
References
- 1.
- 2.
- 3.Regulation (EU) 2016/679 — GDPR (not live-verified)eur-lex.europa.eu
- 4.
- 5.OpenAI — Your data (not live-verified)platform.openai.com
Related questions
- Design a customer-support agent with order-status and returns tools. How do you keep it safe and useful?
- A customer's app calling your API times out intermittently. You can't see their code. Debug it.
- Adapt a pretrained LLM for intelligence analysis inside an air-gapped facility, on classified data you are never allowed to see.
Explore other topics:AI AgentsAI System DesignLarge Language Models