Join our Newsletter — 33% off our NHI Course
Home› Guides› AI Privacy Attacks for Beginners: How Models Can…
Guide AI Threats & Model Security

AI Privacy Attacks for Beginners: How Models Can Leak the Data They Were Trained On

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 30 November 2026 11 min read
On this page

An AI privacy attack tries to learn private facts about a model's training data from the model's answers.

This guide is for students, managers and anyone new to AI security who wants a plain answer. You do not need maths or code. If your organisation trains or fine-tunes a model on customer, patient or staff data, this topic is about you.

In short

  • A trained model can remember more about its training data than its builders intended.
  • By asking a model many questions and studying its answers, someone may guess whether a person's record was used, or rebuild sensitive details.
  • The main types are membership inference, model inversion, property inference and extraction of memorised data.
  • The best defences start before training: use less personal data, limit what the model reveals, and watch how it is queried.

What you will learn

  • Explain in plain words how a model can leak its training data.
  • Tell the main kinds of AI privacy attack apart.
  • Spot the warning signs that make a model more likely to leak.
  • Ask useful questions before a model trained on personal data goes live.
Training data
the examples a model learned from, which may include personal records.
Confidence score
a number a model gives to show how sure it is about an answer.
Memorising (overfitting)
when a model learns its examples too closely instead of the general pattern.

What are AI privacy attacks?

Think of a student who has crammed for an exam by learning past papers word for word. Ask a question they have seen before and they answer instantly and with total confidence. Ask a new one and they hesitate. Watching how sure they are tells you which papers they studied.

A machine learning model can act the same way. It may be more sure about examples it saw in training than about new ones. In 2016, researchers showed that this gap can reveal whether a record was in the training set. They only needed the model's normal answers [1].

A public list of attacks on AI systems groups these together. It names four kinds: guessing membership, guessing what the data is like overall, rebuilding hidden details, and pulling out memorised data [2].

Where the comparison stops working: a student knows what they memorised. A model does not. Its builders often cannot tell what it has kept without testing it.

These attacks are about the data behind a model. If you want the basics of what happens when people type personal data into AI tools, see AI and Privacy for Beginners.

Why does it matter?

Say a model was trained only on patients with one illness. If someone proves you were in its data, they have learned you have that illness. Leaks like this can break data protection law. They can happen even when nobody touched the database.

If you manage a team that builds models

What could happen: a model trained on customer records is shared or put online, and it gives away who was in the data.

Check this: ask whether personal data was really needed, and whether the model was tested for leakage before release.

Next: Membership Inference Attacks

If you work in privacy or compliance

What could happen: a model is treated as "not personal data" when it can still reveal facts about real people.

Check this: include trained models in data protection impact assessments, not only the datasets.

Next: Differential Privacy Guide

If you are new to security work

What could happen: a public model endpoint is queried thousands of times by an unknown script, and nobody notices.

Check this: confirm that model endpoints have rate limits, logging and an owner.

Next: AI Security for Beginners

What does it look like?

Here is a made-up answer from a model that predicts whether a loan application is risky. Look at what it gives away.

Example only. All values are made up.

POST /predict   (EXAMPLE endpoint)
input:  { "applicant": "EXAMPLE-0000", "age": 00, "postcode": "XX0 0XX" }
output: { "label": "low risk",                         (1)
          "confidence": 0.9999,                        (2)
          "all_scores": [0.9999, 0.0001],              (3)
          "model": "EXAMPLE-loan-model v0.0" }         (4)
  1. The answer most users need: one label.
  2. A very high, very precise confidence score. Unusually sure answers can hint that the model has seen this exact record before.
  3. In a real file, this line would contain the model's full set of scores. Returning every score to every caller gives an attacker more to work with.
  4. The model name and version, useful for the owner but also a clue for anyone mapping the system.

Why this is risky: one answer reveals little. Thousands of answers like this, collected and compared, can let someone infer who was in the training data [2].

The safer way: return only what the user needs (the label, or a rounded score), and log and rate-limit who is asking.

How does it work?

This is a defender's view of the pattern, so you know what to look for. It is not a recipe.

  1. The model learns from data. Some of that data is personal. A model trained too long on too little data can memorise single examples.
  2. Someone gets access to the model. Usually this is normal access through an app or an inference API, not a hack. These attacks work through the model's usual way of answering [3].
  3. They ask many questions. They watch how the answers and confidence scores change from one input to the next.
  4. They compare patterns. The model treats seen and unseen data a little differently. That gap can reveal who was in the data, or likely values of a private field [1][2].
  5. Private facts leak. The result can be personal data about people in the training set, or business secrets in the data [3].
Diagram titled How a model can leak its training data. On the left, a box labelled Training data holds personal records. An arrow labelled training leads to a box labelled Model, with a note that it may memorise some records. On the right, a box labelled Someone asking questions sends many queries to the model and gets answers with confidence scores back. Below, four outcome boxes list what can leak: membership (was this person in the data?), properties (what is the data like overall?), inversion (rebuilding a sensitive field), and memorised text or records. A bottom strip lists defences: use less personal data, train with privacy protections, return less detail, rate-limit and log queries.
Figure 1. Private facts can leak through a model's normal answers, not only through a stolen database.

Chatbots face the same risk. A leading security group lists sensitive data leaks as a top risk for them. It suggests cleaning data before training and strict access rules. It also suggests privacy methods such as federated learning and differential privacy [4].

Differential privacy is a maths method. It measures how much privacy a person loses when their data is used [5]. It is a strong defence, but it must be set up with care. US standards experts warn about common pitfalls they call privacy hazards [5].

A worked example

This story is made up to show the idea.

Tomas Abara leads a small data team at a regional clinic group. They want to build a model that predicts which patients may miss appointments. The plan is to train it on five years of patient records and then share it with partner clinics.

Elif Wojcik, the privacy lead, asks a simple question: "If someone has the model, can they learn anything about our patients?" Nobody knows.

Tomas asks Vik Bergmann, a security analyst, to test it. Vik runs an approved leakage test using records the team knows were in training and records it knows were not. The model is clearly more confident on the training records. That gap is exactly what a membership inference attack relies on.

The team makes three changes. They drop fields the model does not need, such as full postcode and diagnosis codes. They retrain the model with a privacy-preserving technique. They change the partner app so it returns only "likely" or "unlikely", not raw scores.

Vik runs the test again. The gap is much smaller. Elif records the test and the result in the clinic's impact assessment, and the team agrees to repeat the test whenever the model is retrained.

Tomas learned that a model can be a copy of some of its data in disguise. Testing it before sharing it was cheaper than explaining a leak afterwards.

Myths and mistakes

What people thinkWhat is true
Once a model is trained, the data is gone.Models can retain information about individual training examples, and attackers can sometimes recover it through the model's answers.[2]
An attacker needs to steal the model first.Many of these attacks only need ordinary access to the model's answers.[1]
Removing names makes training data safe.Other fields can still identify people or reveal sensitive facts. Drop fields the model does not need.
Showing full confidence scores is harmless detail.Precise scores are what many of these attacks use. Return only what users need.
Differential privacy is a switch you turn on.It involves choices and trade-offs, and NIST describes common pitfalls to avoid.[5]

What can I do this week?

  • List the models your team has trained or fine-tuned on personal data, and who can query each one.
  • Check what one model endpoint returns. If it returns full scores, ask whether users need them.
  • Ask whether model endpoints are rate-limited and logged.
  • Add "can the model leak its training data?" to your next data protection impact assessment.
  • Read Model Extraction vs Inversion vs Membership Inference to see how the attacks differ.

Checklist

  • I can explain how a model can leak facts about its training data.
  • I know the four main kinds: membership, properties, inversion and memorised data.
  • I check that training data holds only the personal fields the model needs.
  • I ask whether a model was tested for leakage before it was shared.
  • I make sure endpoints return only what users need.
  • I check that model endpoints are rate-limited, logged and owned.
  • I treat trained models as assets that may contain personal data.

Common questions

Is a trained model personal data?

It can be, if it can be made to reveal facts about people in its data. So privacy teams now check trained models, not only the datasets. Ask your data protection lead how your firm treats them.

What is the difference between membership inference and model inversion?

Membership inference asks a yes or no question: was this record in the data? Model inversion tries to rebuild private details, such as a hidden field, from the model's answers [2].

Does this affect chatbots too?

Yes. Chatbots can repeat personal or secret text from the data they learned from. A leading security group lists this as a top risk for chatbot apps. The fix starts with keeping such data out of training, and limiting what the bot can reach [4].

Is model extraction a privacy attack?

Model extraction copies how a model behaves. That is mainly theft. But a copied model can be studied in private, which can make privacy attacks easier. See Model Extraction for Beginners.

Who should test for these leaks?

The team that trains the model should test it, with help from privacy and security staff. They should only test models and data they own or have leave to test. AI red teams often do this work too.

Where next?

Ready for the detail? Read the practitioner guide: Membership Inference Attacks. It explains how these attacks are measured and which defences reduce them.

Also useful:

Related NHI Mgmt Group resources: AI Security for Beginners, AI Red Teaming for Beginners and AI Training Data Governance Policy Template.

Key terms

Training data
The examples a model learns from.
Inference
Using a trained model to produce an answer from new input.
Overfitting
When a model learns its training examples too closely and does worse on new data.
Membership inference attack
An attack that tries to tell whether a specific record was in a model's training data.
Model inversion attack
An attack that tries to rebuild sensitive features of training data from a model's outputs.
Differential privacy
A mathematical way to limit how much any one person's data affects a result.

Sources and further reading

  1. Reza Shokri, Marco Stronati, Congzheng Song and Vitaly Shmatikov, "Membership Inference Attacks against Machine Learning Models", arXiv:1610.05820, 2016. https://arxiv.org/abs/1610.05820 (accessed 30 Nov 2026).
  2. MITRE ATLAS, "AML.T0137 Training Data Information from AI Models". https://atlas.mitre.org/techniques/AML.T0137 (accessed 30 Nov 2026).
  3. MITRE ATLAS, "AML.T0024 Exfiltration via AI Inference API". https://atlas.mitre.org/techniques/AML.T0024 (accessed 30 Nov 2026).
  4. OWASP GenAI Security Project, "LLM02:2025 Sensitive Information Disclosure", OWASP Top 10 for LLM Applications 2025. https://genai.owasp.org/llmrisk/llm022025-sensitive-information-disclosure/ (accessed 30 Nov 2026).
  5. NIST, "SP 800-226: Guidelines for Evaluating Differential Privacy Guarantees", March 2025. https://csrc.nist.gov/pubs/sp/800/226/final (accessed 30 Nov 2026).

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.