Safety, Security & Responsible AI·Question 8 of 70Basic

What is data leakage in an LLM system, and what are the main channels?

Type it the way you would explain it to an interviewer. A few sentences is enough; you can't break anything.

Model answer: the part to lead with

Data leakage is sensitive information (PII, secrets, IP, one user's data reaching another) escaping where it shouldn't. The mistake juniors make is thinking about only the model; the leaks are mostly around it, in the plumbing:

  • Prompts sent to a vendor - third-party API sees everything you send. Governed by their data-use and retention policy.
  • Observability / tracing tools - LangSmith, Langfuse, Helicone, and homegrown logs typically store full prompts and completions. This is the most common accidental PII sink in production.
  • Application logs - casual logger.info(prompt) scatters PII across your log stack.
  • Fine-tuning / eval datasets - sensitive records baked into training data or checked into a repo.
  • Prompt caches and vector stores - a shared cache or a shared index across tenants leaks one customer's data to another.
  • Model memorisation - the model regurgitates training data verbatim (see the extraction question).
  • The system prompt - assume it leaks; no secrets in it.
Full worked answer with diagram

Data leakage is sensitive information (PII, secrets, IP, one user's data reaching another) escaping where it shouldn't. The mistake juniors make is thinking about only the model; the leaks are mostly around it, in the plumbing:

  • Prompts sent to a vendor - third-party API sees everything you send. Governed by their data-use and retention policy.
  • Observability / tracing tools - LangSmith, Langfuse, Helicone, and homegrown logs typically store full prompts and completions. This is the most common accidental PII sink in production.
  • Application logs - casual logger.info(prompt) scatters PII across your log stack.
  • Fine-tuning / eval datasets - sensitive records baked into training data or checked into a repo.
  • Prompt caches and vector stores - a shared cache or a shared index across tenants leaks one customer's data to another.
  • Model memorisation - the model regurgitates training data verbatim (see the extraction question).
  • The system prompt - assume it leaks; no secrets in it.

Controls map to channels: use enterprise/API tiers that don't train on your data and offer zero-data-retention for the vendor channel; redact PII before it hits the model and before it hits logs/traces; per-tenant isolation for caches, indexes, and memory; scrub and dedup training/eval data; and keep secrets and authorisation server-side.

A crisp interview framing: draw the data-flow diagram - user → app → model → tools → logs → traces → storage - and put a control on every hop where data leaves your trust boundary. Interviewers reward the person who names the observability and log channels unprompted, because that's the one real teams actually get burned by.

Worth sketching. Draw every hop out of the app and the observability branch stops being the one nobody mentions.

flowchart LR
    U["User data"] --> A["Your app"]
    A -->|"crosses your trust boundary"| M["Vendor model API"]
    A -->|"full prompts and completions"| T["Logs and traces"]
    A -->|"shared across tenants?"| C["Cache and vector index"]
    A -->|"baked into weights"| F["Fine-tune and eval sets"]
    M --> R["Response"]
    R --> A

What a good answer covers

  • Data leakage is sensitive information (PII, secrets, IP, one user's data reaching another) escaping…
  • Prompts sent to a vendor - third-party API sees everything you send
  • Observability / tracing tools - LangSmith, Langfuse, Helicone, and homegrown logs typically store full…
  • Application logs - casual logger.info(prompt) scatters PII across your log stack
  • Fine-tuning / eval datasets - sensitive records baked into training data or checked into a repo

Key terms: Prompts sent to a vendor · Observability / tracing tools · Application logs · Fine-tuning / eval datasets · Prompt caches and vector stores · Model memorisation · The system prompt · don't train on your data · zero-data-retention · before it hits logs/traces

Interviewer follow-ups to expect

  1. Which of these channels do teams most often forget?

  2. How does a shared prompt cache leak data across tenants?

  3. What's the difference between "vendor doesn't train on my data" and "zero data retention"?

Worked answer from AI-Engineer-Interview-Questions by Om (MIT), reformatted for LLM Prep · answer text last updated 6 November 2026 · scoring and review schedule by LLM Prep