LLM Data Leakage: What an AI Might Reveal by Accident
A model can expose things it was given: its instructions, the documents it retrieves, or data from other users.
2 min readIntermediate Aug 24, 2026
Explain Like I'm Not a Hacker
A receptionist who happily reads out anyone's appointment to whoever asks.
The 30-second explanation
The assistant knows things: its hidden instructions, the files it can read, sometimes what earlier users asked. If nobody controls what it says, it can repeat those things to the wrong person.
How it works
- 1
1. Context
Documents and instructions are given to the model.
- 2
2. Request
A user asks something clever or broad.
- 3
3. Reveal
The model repeats content it should not.
- 4
4. Control
Authorisation and output checks prevent it.
The model itself does not know who is allowed to see what. Access control has to happen before information reaches it: only retrieve documents the current user may read, keep sessions separate, and never place secrets in prompts. After the model answers, output handling matters too: content should be checked, and features like automatic link rendering can be abused to send data elsewhere.
Real-world example
A company assistant retrieves documents to answer questions. Because retrieval ignores who is asking, a junior employee's question returns a snippet from a confidential HR file. The fix is to filter retrieval by the user's permissions.
How to spot it
Retrieval without permission checks
Search that ignores who is asking.
Secrets in prompts or context
Keys or private details supplied to the model.
Shared sessions
Context that carries over between users.
Unsafe output rendering
Links or images built from model output that could carry data.
What to do
- 1Check user permissions before retrieving any document for the model.
- 2Keep secrets out of prompts and separate sessions and tenants strictly.
- 3Review and constrain how model output is rendered, especially links and images.
Stay curious. Stay safer.
This is one piece of a bigger picture. Explore more real-world examples, concepts and tips to build your cybersecurity awareness.