Define what an attacker can query and which disclosure would harm someone, then measure with known members and nonmembers drawn from the same distribution. Report the true-positive rate at a low false-positive rate such as 0.1%, not balanced accuracy, and convert it to precision at the real membership rate. Trace any leaked canary to its path before blaming training. Fix the path the evidence shows, and claim differential privacy only with a stated epsilon and delta.
- Sensitive Information Disclosure is LLM02:2026, unchanged from 2025. It covers leaks through training, retrieval, logs and model outputs.
- Judge membership attacks by true-positive rate at a low false-positive rate, as Carlini et al. (2022) showed: average accuracy hides how many people a rule wrongly accuses.
- A rule that is 75% accurate on a balanced test set flags about 33 nonmembers for every member when only 1 in 100 people is a member.
- Members and nonmembers must come from one distribution. Duan et al. (2024) found that apparent attack success on LLM pre-training data often came from a shift in time between the two sets.
- Language models can repeat training text. Nasr et al. (2023) showed gigabytes can be extracted from open models, and a divergence attack made ChatGPT emit training data 150 times more often than in normal use.
- A canary in an answer proves an exposure path, not memorization: check retrieval, prompt history and logs first.
| Setting | Value | Note | Source |
|---|---|---|---|
| Attack success metric | True-positive rate at 0.1% and 1% false-positive rate, with the full ROC curve | Balanced accuracy and AUC alone hide the low-error regime that matters. | Carlini et al. (2022), Membership Inference Attacks From First Principles |
| Nonmember sample size | Well above 1/FPR: thousands of nonmembers for a 0.1% target | With n nonmembers the smallest nonzero false-positive rate you can observe is 1/n. | — |
| Prediction API output | The label or top answer only; no full probability vectors unless the product needs them | — | NIST AI 100-2 E2025 |
| Differential privacy claim | State epsilon and delta per training run, with delta below 1 divided by the number of training records | — | Opacus documentation; Abadi et al. (2016) |
- Check that member and nonmember samples share collection period, source and quality.
- Report the attack’s true-positive rate at 0.1% and 1% false-positive rate, with sample sizes.
- Convert the result to expected precision at the real membership rate before describing risk to people.
- Plant a canary in retrieval, logs and fine-tuning data separately, and trace which path exposes it.
- Confirm the prediction API returns only the fields the product needs and is rate limited per user.
- Applies to
Privacy threat assessment for trained models and the applications around them. An attack score needs a base rate, a threat model and documented measurement conditions.
- Part of
- Workflow: Review a design
Learning goals and prerequisites
What you will learn
- Compute true- and false-positive rates for a membership rule, and its true-positive rate at a low false-positive rate
- Explain why balanced-set accuracy misleads when few people are members
- Trace a synthetic canary to retrieval rather than assuming memorization
Before you start
ML engineers, privacy engineers and security reviewers assessing models trained on personal data
- Calculate true/false positive rates and distinguish membership from attribute inference and extraction.
Refresh first: Data minimization and retention: collect less and prove that deletion works
Go to the guided practiceMembership inference asks whether an example was used in training. Model inversion seeks sensitive attributes or representative inputs from model behavior. Extraction attempts to reproduce a model or recover protected information through access to outputs or parameters. These overlap in practice but require different attacker capabilities and evidence. The OWASP Top 10 for LLM Applications 2026 groups their effects as Sensitive Information Disclosure (LLM02:2026, /owasp-llm-top-10/2026/llm02/), and MITRE ATLAS lists Infer Training Data Membership (AML.T0024.000) and Invert AI Model (AML.T0024.001).
A model mentioning a person is not proof that the person’s record was in training; the information may be public, retrieved or inferred. Conversely, a model never printing an exact training row does not establish absence of membership or attribute leakage. State which disclosure would harm the people or organization involved.
The attack rule predicts “member” when a supplied score is at least 0.80. On four known members (scores 0.95, 0.85, 0.81 and 0.40) it flags three, so the true-positive rate is 3/4=75%. On four known nonmembers (0.90, 0.60, 0.30 and 0.10) it flags one, so the false-positive rate is 1/4=25%. The balanced test-set accuracy is 6/8=75%, but that single number hides how often the rule labels a nonmember as a member.
Now apply those rates hypothetically to 1,000 people when only 10 are members. Expected true positives are 10×0.75=7.5; expected false positives are 990×0.25=247.5. The expected precision is 7.5/(7.5+247.5), about 2.94%. Fractional counts are expectations across repeated comparable populations, not literal half-people. This is the base-rate problem; eight synthetic examples are far too few to establish stable real-world rates.
Carlini et al. (2022) argue that attacks should be compared by their true-positive rate when false positives are rare, because an attack that confidently identifies a few members is a real privacy failure even if its average accuracy is poor. The tpr_at_fpr function below picks the strictest threshold allowed for a target false-positive rate. Here, flagging no nonmember at all leaves only M1 above N1’s 0.90, a true-positive rate of 25%; and with four nonmembers no rate between 0% and 25% can even be observed. A 0.1% target needs thousands of nonmembers.
A membership experiment also needs comparable member and nonmember distributions. If members are recent high-quality records and nonmembers are old malformed records, the score may detect those features rather than training membership. Duan et al. (2024) found that published attacks on LLM pre-training data barely beat random guessing once members and nonmembers came from the same period. Match sampling conditions, report uncertainty, and never label a person’s record as a training member from one favorable guess.
Canary disclosure asks a different question. If a unique synthetic marker appears in an answer, inspect its path. The trace in the exercise includes the marker in retrieved document D7 immediately before generation; that supports a retrieval exposure path and does not establish that the model memorized the marker during training. Repair the boundary shown by the evidence (for retrieval, /domains/ai-emerging/llm-security/rag-tenant-isolation/), then isolate other paths in a separately designed experiment.
def confusion(scores, is_member, threshold):
flagged = [s >= threshold for s in scores]
tp = sum(f and m for f, m in zip(flagged, is_member))
fp = sum(f and not m for f, m in zip(flagged, is_member))
fn = sum(not f and m for f, m in zip(flagged, is_member))
tn = sum(not f and not m for f, m in zip(flagged, is_member))
return tp, fp, fn, tn
def rates(tp, fp, fn, tn):
return {
"tpr": tp / (tp + fn),
"fpr": fp / (fp + tn),
"accuracy": (tp + tn) / (tp + fp + fn + tn),
}
def expected_precision(tpr, fpr, members, nonmembers):
"""Share of flagged people who really are members, at a given prevalence."""
true_positives, false_positives = tpr * members, fpr * nonmembers
return true_positives / (true_positives + false_positives)
def tpr_at_fpr(member_scores, nonmember_scores, max_fpr):
"""True-positive rate at the lowest threshold that flags at most max_fpr of
the nonmembers.
Pick the threshold on development data, then report the rate on separate
held-out data. With n nonmembers, the smallest nonzero false-positive rate
you can observe is 1/n.
"""
ranked = sorted(nonmember_scores, reverse=True)
allowed = int(
max_fpr * len(ranked)
) # nonmembers that may score above the threshold
threshold = ranked[allowed] if allowed < len(ranked) else float("-inf")
flagged = sum(s > threshold for s in member_scores)
return threshold, flagged / len(member_scores)List training and fine-tuning data, retrieval sources, logs, embeddings, output detail and query access. Ask whether sensitive information needs to be present in the first place. Minimize unnecessary collection (/domains/identity-crypto/privacy/data-minimization-retention/) and restrict raw data and model artifact access. Treat a hosted model’s retention and reuse terms as dependencies to verify for the chosen service and account settings, including whether prompts and outputs are logged or used for training.
Limit outputs and queries to the intended product task. Full confidence scores, unlimited repeated queries or downloadable parameters enable attacks that a label-only interface does not, and model extraction (Tramèr et al. 2016) needs nothing more than many paid queries. Rate limits and monitoring raise the cost of some attacks but do not create a formal privacy guarantee.
Build an authorized experiment with synthetic or appropriately approved records. Separate known members from nonmembers drawn from the same distribution and control obvious confounders such as collection date and data quality. Specify attacker knowledge, query budget, target metric and false-positive rate before interpreting success. High accuracy on an artificially easy split can exaggerate practical leakage.
For generative systems, include synthetic canaries and trace where a disclosed marker originated: training, retrieval, prompt history or logs. A canary is evidence about one exposure path under the test conditions, not a universal privacy score. Evaluate rare and duplicated examples separately: Kandpal et al. (2022) showed that most of the extraction risk in language models comes from text duplicated in the training data.
If leakage originates in retrieval permissions, repair that boundary; changing training privacy parameters will not fix it. If the concern is training memorization or inference, start with data minimization and deduplication, then consider differential privacy. DP-SGD, available for PyTorch in the Opacus library, bounds what any single training record can change, but only for the epsilon and delta it reports, and usually at some cost in accuracy. Arbitrary noise without an accounting of that budget is not differential privacy.
Re-evaluate task utility and the intended privacy claim after every change, using the same attack and the same false-positive rate as before. Report the residual true-positive rate rather than a pass or fail label.
Selecting a threshold after inspecting the test labels can overfit the evaluation. Choose the operating threshold on a separate development set, then measure it on a held-out set with the relevant population and query access. Report both the number of examples and the actual false positives; a rounded rate of zero can conceal an undersized experiment.
Avoid testing with unapproved sensitive records simply to measure whether they leak. Use synthetic or properly authorized data with controlled destinations and retention. The test logs, prompts and exported score files are themselves data flows that need an appropriate access policy.
Each row is a case from the eight synthetic scores or the canary trace and what it does and does not show. The first four follow from confusion and rates above.
| Case | Expected result | What it establishes |
|---|---|---|
| M1/M2/M3 | True positives | Rule recognizes these known members |
| M4 | False negative | One known member missed |
| N1 | False positive | A nonmember is incorrectly accused |
| Balanced test accuracy | 6/8 = 75% | Does not supply population precision |
| Canary already in retrieved context | Retrieval path demonstrated | Training membership remains unproven |
Guided practice
Calculate the confusion matrix, examine the prevalence effect and interpret the canary trace. All records are synthetic.
Supplied scenario material
Synthetic membership scores; predict member if score >= 0.80 (inclusive).
Known members: M1=0.95 M2=0.85 M3=0.81 M4=0.40.
Known nonmembers: N1=0.90 N2=0.60 N3=0.30 N4=0.10.
Population thought experiment: 10 members, 990 nonmembers.
Canary trace: D7 contains CANARY_ZEBRA_714; the retriever sends D7 to the model; the answer includes CANARY_ZEBRA_714.
D7 should have been inaccessible to the test user. No evidence about whether the canary was in training is available.
Claim A: “75% accuracy means a flagged real person has a 75% chance of being in training.”
Claim B: “The canary in the answer proves training memorization.”1. Build the confusion matrix
Count TP, FN, FP and TN, then calculate TPR/FPR.
Expected result and reasoning
TP=3, FN=1, FP=1, TN=3. TPR=3/4=75%; FPR=1/4=25%. Accuracy=(3+3)/8=75% on this balanced toy set.
2. Evaluate Claim A
Use the 1,000-person thought experiment to calculate expected precision.
Expected result and reasoning
Expected TP=7.5 and FP=247.5, giving 7.5/255≈2.94% precision if those rates applied. Claim A confuses balanced-set accuracy with probability of membership given a positive result and ignores prevalence and sampling uncertainty.
3. Evaluate Claim B
Identify the established exposure path and the unsupported inference.
Expected result and reasoning
D7 was sent to the model without permission and its marker appeared in the answer. That establishes a retrieval-boundary failure for this trace. It does not show that the marker was in training or memorized.
4. Choose the next controlled test
State the immediate repair and a distinct experiment for training privacy.
Expected result and reasoning
Repair authorization before D7 enters retrieval context and verify revoked/cross-user paths. Assess training privacy separately using approved known-member/nonmember data, comparable distributions, documented attacker access and sufficient evidence at relevant false-positive rates.
5. Measure at a low false-positive rate
Find the true-positive rate when no known nonmember may be flagged, and say what the data cannot show.
Expected result and reasoning
The threshold must exceed N1’s 0.90, so only M1 is flagged: 1/4 = 25% at an observed false-positive rate of 0/4. Four nonmembers cannot show any rate between 0% and 25%, so a 0.1% operating point needs thousands of comparable nonmembers.
Eight synthetic scores and one canary trace. They illustrate the calculations and cannot estimate a real model’s leakage.
Save a draft on this device to resume later. Automatic saving begins after you choose Save. Drafts are never sent by this application; use synthetic data.
No draft saved on this device yet.
Sources & further reading
The standards, specifications and documentation behind the guidance above. Each is the evidence for a claim on this page; consult it for detail beyond the defaults and versions listed here.
- NIST AI 100-2 E2025: Adversarial Machine Learning. March 2025.
- OWASP Top 10 for LLM Applications 2026 (LLM02 Sensitive Information Disclosure). 3 August 2026.
- OWASP LLM02:2025 Sensitive Information Disclosure (2025 list; same ID in 2026)
- Carlini et al. (2022): Membership Inference Attacks From First Principles
- Duan et al. (2024): Do Membership Inference Attacks Work on Large Language Models?
- Nasr et al. (2023): Scalable Extraction of Training Data from (Production) Language Models
- Kandpal et al. (2022): Deduplicating Training Data Mitigates Privacy Risks in Language Models
- Tramèr et al. (2016): Stealing Machine Learning Models via Prediction APIs
- Abadi et al. (2016): Deep Learning with Differential Privacy
- Opacus FAQ: what epsilon and delta mean and how to choose delta
- MITRE ATLAS data (AML.T0024.000 Infer Training Data Membership, AML.T0024.001 Invert AI Model). Release 2026.09 (15 September 2026).
Reference information
- SDLC phase
- DesignDevelopmentRelease
- Role
- AppSec engineers