AI EngineeringInterview preparation
Intermediate·Concept·2 min read

Data leakage, PII, sensitive data, and secrets

Practice this question

Overview

  • Data leakage is unauthorized disclosure.
  • PII means personally identifiable information, such as identity-linked names, contact details, and account identifiers.
  • Sensitive business or health information and credentials need protection even when they do not fit a narrow PII category.

Why this matters

Prompts, embeddings, traces, tool outputs, caches, and transcripts can all copy private information into new locations.

An everyday example

Photocopying a private case file creates another copy that must be secured and eventually disposed of.

A technical example

Return {claimId, status, missingDocumentTypes} to the model rather than the full customer record and bank details.

How it works

  1. Classify data
  2. Minimize fields
  3. Redact/tokenize where needed
  4. Use approved provider/region
  5. Encrypt storage/transit
  6. Restrict logs
  7. Apply retention/deletion.

Architecture and flow

Private record → minimal authorized projection → approved model/tool path → redacted trace.

The insurance assistant example

A claim summary should not send unrelated medical history or payment credentials to a model.

When to use it

Every production AI system processing private or client data.

When to avoid it

Never put provider API keys in browser bundles, prompts, source-control examples, or model-readable logs.

Interview answer

“I minimize model-visible data and protect every derived copy, including vectors, caches, traces, and conversation history.”

Benefits, trade-offs, and production considerations

  • Masking can harm task quality; use reversible tokenization only with controlled re-identification where necessary.
  • Confirm provider data-handling terms for the actual account/service rather than assuming that one request flag establishes compliance.
Adapted from 13_AI.MD · “Data leakage, PII, sensitive data, and secrets”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.