LESSON 88 / 215·2 min readIntermediate

Data leakage, PII, sensitive data, and secrets

Must knowConcept lesson
01 Understand02 Recall03 Prepare

Words made simple

A few useful meanings before you read the explanation.

PII
Information that can identify a person, such as a name, address or identity number.
AI
Software techniques for tasks such as recognizing patterns, understanding language or generating content.
API
A way for one piece of software to ask another for data or an action. A claims API might return the current status of a claim.
More words from this lesson
Embedding
A list of numbers that represents the meaning of some content. Similar meanings can produce nearby lists of numbers.
Vector
An ordered list of numbers. An embedding is a vector used to represent content for tasks such as similarity search.
Authorization
Checking what that identity is allowed to read or do. Being logged in does not grant access to every record.
Trace
A linked record of the steps in one request, including model calls, retrieval and tools. It helps locate delays or failures.

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.
PAUSE & RECALL

Can you explain it without the notes?

Data leakage, PII, sensitive data, and secrets

Use your own words. Explain an example and one limitation before checking the explanation.

Check your explanation

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…

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: Authentication, authorization, least privilege, and tenant isolation

Adapted from 13_AI.MD · “Data leakage, PII, sensitive data, and secrets”. Examples are study fragments; framework behavior can depend on your version.