Models and supply chain, 1 of 3, about 4 h 59 min of reading
Adversarial Machine Learning
About 4 h 32 min left
Concept. Prompt Hacking MasterclassInjection and guardrails, 1 of 5, about 7.8 h and Advanced Semantic ExploitationInjection and guardrails, 2 of 5, about 7.9 h attack the model through language: the prompt. This week attacks it through mathematics: the input space, the training set, and the parameters themselves. Adversarial machine learning (AML) is the oldest sub-field of AI security. Its seminal result predates the large language model (LLM) era by a decade and still governs how every classifier, detector, and guardrail can be fooled. The unifying idea is that a trained model is a decision surface in high-dimensional space, and that surface has exploitable geometry. Small, targeted moves cross it, queries against it leak what it learned, and the same math that crafts an attack also measures a defense.
🎯 Objectives
By the end of this unit you can:
- Map the four attack surfaces of a deployed model (evasion, extraction, inference, inversion) and name the defense each one demands.
- Derive an adversarial example from a gradient and explain why FGSM's linearity argument means the attack transfers across models you never touched.
- Choose the right evasion attack for a threat model using the Lᵖ-norm, cost, and strength tradeoff, and explain why C&W is the benchmark every defense must survive.
- Run a membership-inference attack with shadow models and reason about the differential-privacy budget (ε) that bounds it.
- Assess synthetic-media risk end to end: generation, the offensive vishing toolchain, detection, and C2PA provenance.
- (Go deeper) Attack under an L0 budget with JSMA, the one-pixel attack, and Sparse-RS, and explain why robustness to L∞ noise says nothing about it. Walk through Scale-MIA, the inversion that reconstructs clients' training batches through federated learning's secure aggregation (Sparse-RS and Scale-MIA).
The big picture: four ways to attack one model
A deployed model is exposed at three moments: when it trains, when it serves predictions, and through the parameters it exposes to anyone who can query it. Four attack families map onto those moments. They are the spine of MITRE ATLAS and of the privacy toolkits below.
| Family | When | Attacker goal | Primary defense |
|---|---|---|---|
| Evasion | inference | craft an input that is misclassified | adversarial training (Madry/PGD) |
| Extraction | inference | clone the model through its own API | query-budget control (Knowledge Trap) |
| Membership inference | inference | prove a record was in the training set | differential privacy (DP-SGD) |
| Model inversion | inference | reconstruct training data from outputs | output minimization and differential privacy |
🔑 The root cause is shared. A model overfits to its training data and is locally linear around its inputs. Overfitting is what leaks membership, and local linearity is what lets a gradient step flip a label. Fix those two properties and most of the family collapses.
Evasion: the mathematics of a misclassification
Privacy attacks and defenses: what a model remembers
Synthetic media: deepfakes as offense and defense
🧪 This unit's build: reproduce the four families
Offensive depth: attacking embeddings
🛡️ OWASP 2026: sensitive information disclosure side channels
✅ Check yourself
Go deeper: sparsity attacks and inversion through secure aggregation
📇 Attack and tool reference
Finish Adversarial Machine Learning
About 4 h 32 min left in this unit.
From memory first
Write the main points of this unit, in your own words.
What you set out to be able to do
Check each one against what you can do now.
- Map the four attack surfaces of a deployed model (evasion, extraction, inference, inversion) and name the defense each one demands.
- Derive an adversarial example from a gradient and explain why FGSM's linearity argument means the attack transfers across models you never touched.
- Choose the right evasion attack for a threat model using the Lᵖ-norm, cost, and strength tradeoff, and explain why C&W is the benchmark every defense must survive.
- Run a membership-inference attack with shadow models and reason about the differential-privacy budget (ε) that bounds it.
- Assess synthetic-media risk end to end: generation, the offensive vishing toolchain, detection, and C2PA provenance.
- (Go deeper) Attack under an L0 budget with JSMA, the one-pixel attack, and Sparse-RS, and explain why robustness to L∞ noise says nothing about it. Walk through Scale-MIA, the inversion that reconstructs clients' training batches through federated learning's secure aggregation (Sparse-RS and Scale-MIA).
The unit is done when you have answered the check and marked the required sources.
1 Check yourself
Do the check2 Required sources
Go to the sources
Sources in this unit
- Goodfellow et al.: FGSM (2014)
- Madry et al.: PGD (2017)
- Carlini & Wagner: C&W Attack (2017)
- Shokri et al.: Membership Inference (2017)
- Abadi et al.: DP-SGD (2016)
- IBM ART documentation
- Moosavi-Dezfooli: DeepFool (2016)
- Nicholas Carlini: Some Lessons from Adversarial Machine Learning (FAR.AI)
- IBM ART GitHub and notebooks
- TensorFlow FGSM tutorial
- C&W attack implementation
- Foolbox documentation
- Morris et al.: Text Embeddings Reveal (Almost) As Much As Text, the Vec2Text paper (2023)
- jxmorris12/vec2text
- Song & Raghunathan: Information Leakage in Embedding Models (CCS 2020)
- Li et al.: GEIA, Sentence Embedding Leaks More Than You Expect (2023)
- Papernot et al.: The Limitations of Deep Learning in Adversarial Settings (JSMA)
- Croce et al.: Sparse-RS (AAAI 2022)
- Shi et al.: Scale-MIA (NDSS 2025)
- Su et al.: One Pixel Attack for Fooling Deep Neural Networks
- PATE: Papernot et al. (2018)
- Anthropic — Strengthening our defenses against distillation attacks
- Knowledge Trap: arXiv 2606.15810 (June 2026)
- Pretraining Data Can Be Poisoned through Computational Propaganda: arXiv 2607.15267 (July 2026)
- Distillation Defenses Easily Break After Reinforcement Learning (arXiv 2609.35699)
- Panfilov, Shumailov, Geiping, Andriushchenko et al.: Stealing Reasoning Traces from Proprietary LLM APIs (arXiv 2608.09867, August 2026)
- Adversa AI: Cryptographic Context Injection (August 2026)
- McDonald & Bar Or: Whisper Leak (2025)
- OpenAI: Moonshot-linked campaign replayed encrypted chain-of-thought to distill it (Decrypt)
- C2PA (Content Provenance)
- FaceForensics++
Checklist
It does not count toward done.
- Map the four attack families (evasion, extraction, membership inference, and inversion) to their defenses in a table you can check against this week's chapter.
- Derive FGSM from a loss gradient on paper, then explain the linearity hypothesis and why an example transfers to a model you never queried.
- Run the PGD (iterative) and DeepFool (minimal-δ) evasion attacks with ART or Foolbox, and record the perturbation size each needs to flip a label.
- Reproduce a C&W attack, and explain why it is the benchmark a defense must survive (it broke defensive distillation back to 100% success) and why surviving FGSM alone proves nothing.
- Choose an evasion attack for a stated threat model by its Lᵖ norm (L0, L2, or L∞), and name the sparse JSMA (saliency) and EAD (elastic-net) variants.
- Build the path in three steps: run FGSM on MobileNetV2 with an ε sweep (TensorFlow tutorial), run PGD, DeepFool, and the inference modules in ART, then benchmark a defense against the reference C&W. Never report robustness from FGSM alone.
- Perform a membership-inference attack with the shadow-model methodology and report how well the attack classifier separates members from non-members.
- Explain model extraction and inversion in your own words, then study the Knowledge Trap query-budget defense and note how it burns the attacker's budget.
- Treat echoed or encrypted reasoning traces as attacker-controllable, and study cross-model trace reuse (the anti-distillation bypass and the personal-data and credential extraction) until you can describe both.
- Trace the July 2026 campaign that OpenAI disclosed and attributed to Moonshot-linked individuals, which replayed encrypted chain-of-thought across sessions (a named in-the-wild case). Explain why reinforcement learning after distillation breaks post-distillation defense evaluations, so the defense belongs at the batch and query-budget layer, not in hiding one trace.
- Explain DP-SGD (clipping, noise, and the moments accountant) and state the ε tradeoff between privacy and utility.
- Study PATE (teacher-ensemble noisy aggregation) and write down how it differs from DP-SGD as a privacy defense.
- Cluster the LLM information-disclosure surface into three groups: LLM08:2026 hidden-context exposure (prompt leakage), LLM02 PII and data extraction, and pretraining poisoning (HalfLife).
- Trace Cryptographic Context Injection against Grok: the encrypted payload, the model-runtime decryption oracle, and the session-state exfiltration through URL parameters. Then state why the defense belongs in the harness, not the model.
- Compare GAN and diffusion generation, then run a FaceForensics++ detector and note which artifacts it relies on.
- List the offensive deepfake toolchain (PhishGPT, ElevenLabs voice cloning, vishing, and video impersonation) and the step each tool plays in an attack.
- Assess AI-disinformation risk (LLM07:2026) and explain how C2PA provenance defends against it.
- (Go deeper) Run SaliencyMapMethod and PixelAttack (ART) on a small CIFAR-10 classifier and report success against pixels changed (1, 5, and 20) and the L2 norm. Then list the checks a federated client could run on a server's model and say why each misses Scale-MIA.
- Measure a toy watermark detector at a fixed 1% false positive rate before and after paraphrase, and write the finding with title, impact, evidence and fix.
Fool a small classifier, then ask what it remembers
Attack: Flip a classifier's label inside a budget with a gradient, and infer who was in its training set Defend: Retrain on adversarial examples and measure what it buys, also against attacks that use no gradient
Nothing to do here yet; the unit is complete without it.
Go deeper
Clone a model through its API, then catch the cloner
Attack: Clone a model from its API answers, exactly for a logistic one and closely for a network, in a budget Defend: Watch each client's queries and flag a copier, not the analyst who re-checks or the client with a burst
Nothing to do here yet; the unit is complete without it.
Scrub the secret before the model learns it
Attack: Make a small language model hand back a secret it saw in its training logs Defend: Scrub a secret by its shape and context before the training run, and keep the other lines
Nothing to do here yet; the unit is complete without it.
Practise this in the lab, Three words to flip a spam filter.15 to 25 min estimate
Practise this in the lab, Capstone: one engagement, replayable findings and a scope log.1 h 40 min estimate
Study notes
None yet
Sign in to take notes.
Your additions
None yet
More for this unit
21 readings
Readings no section cites. They do not count toward the unit.
Core adversarial machine learning papers1 reading
- arxiv.orgpaper
A minimal-perturbation attack that steps along the boundary normal, which also makes it a robustness metric. Read it after PGD, when you want to measure how far a classifier is from its nearest boundary.
Sign in to mark it done, keep it for later and open its questions.
Talks and strategic perspectives1 reading
- youtube.comvideo
The author of the C&W attack gives his personal account of why defenses fail. It frames the strategic lesson of the whole week, so watch it once you have seen C&W break a defense.
Sign in to mark it done, keep it for later and open its questions.
Hands-on adversarial machine learning tools4 readings
- github.comtool
Jupyter notebooks with working examples across the attack categories. Start from the notebook closest to the attack you are reproducing.
Sign in to mark it done, keep it for later and open its questions.
- tensorflow.orglab
A step-by-step walk through generating an adversarial example with TensorFlow. Run it first in this week's build, to see a gradient flip a label.
Sign in to mark it done, keep it for later and open its questions.
- github.comtool
The official TensorFlow implementations of the L0, L2, and L∞ attacks. Use it to benchmark a defense against the reference attack.
Sign in to mark it done, keep it for later and open its questions.
- foolbox.readthedocs.iotool
White-box and black-box attacks written natively for PyTorch, TensorFlow, and JAX (through EagerPy), behind one clean API. Use it when you want a second toolkit to cross-check ART.
Sign in to mark it done, keep it for later and open its questions.
Attacking embeddings4 readings
- arxiv.orgpaper
Iterative embedding inversion that recovers 92% of 32-token inputs exactly, including names from clinical notes. It is the canonical black-box inversion attack, so read it before the embedding drill.
Sign in to mark it done, keep it for later and open its questions.
- github.comtool
The reference PyTorch implementation of the Vec2Text inversion attack, which turns OpenAI and GTR embeddings back into text. Run it in the embedding drill.
Sign in to mark it done, keep it for later and open its questions.
- arxiv.orgpaper
The seminal formalization of the three embedding attacks: inversion, attribute inference, and membership inference. It shows authorship inferred from a handful of labelled embeddings, so read it for the conceptual frame.
Sign in to mark it done, keep it for later and open its questions.
- arxiv.orgpaper
Generative embedding inversion that recovers whole fluent sentences, not just bags of words. It is the modern baseline alongside Vec2Text.
Sign in to mark it done, keep it for later and open its questions.
Go deeper: sparsity attacks and Scale-MIA2 readings
- arxiv.orgpaper
Introduces the saliency-map attack. On MNIST it reached 97% success while modifying 4.02% of input features on average. Read it first in the optional module.
Sign in to mark it done, keep it for later and open its questions.
- arxiv.orgpaper
Uses differential evolution in a semi-black-box setting. One pixel misclassifies 67.97% of the Kaggle CIFAR-10 test images and 16.04% of ImageNet test images. Read it before the one-pixel worked example.
Sign in to mark it done, keep it for later and open its questions.
Privacy attacks and defenses4 readings
- arxiv.orgpaper
Private Aggregation of Teacher Ensembles transfers knowledge to a student through noisy votes, reaching ε < 1.0 at scale. Read it as the alternative to DP-SGD.
Sign in to mark it done, keep it for later and open its questions.
- anthropic.compaper
the vendor-defense counterpoint to "defenses break after RL" (2609.35699 above): three layered controls — preserved-thinking (blocks new accounts editing prior context), a two-stage extraction classifier (<0.1% FPR), and usage-limit/account bans — cut reasoning tokens harvested by distillers 10–100× (early est. 90–99% less), with fraud-account proxy networks named as the delivery vector
Sign in to mark it done, keep it for later and open its questions.
- arxiv.orgpaper
Graf, Hajishirzi, Smith, Kohlbrenner, and Lo (AI2 and the University of Washington) show that public discussion interfaces are a web-scale content-injection vector that survives real crawling and curation. They introduce HalfLife to estimate how much adversarial content reaches the training corpus. Read it for the training-time supply-chain threat to pretraining itself.
Sign in to mark it done, keep it for later and open its questions.
- arxiv.orgpaper
Argues that existing anti-distillation defenses for closed-source LLMs are judged under an unrealistic threat model, with no further training after distillation. A simple distillation attack using data from current commercial APIs, followed by reinforcement learning (RL), matches the reasoning gains of sophisticated full-trace extraction and breaks defenses that looked effective right after distillation. Any defense that leaks enough to approximately reconstruct reasoning traces is ineffective, and batch-level defenses are the more promising direction. Read it to see why the attacker does not stop at the copy and RL-polishes it, and pair it with the reasoning-trace theft paper (2608.09867).
Sign in to mark it done, keep it for later and open its questions.
OWASP 2026: LLM02 sensitive information disclosure (side channels)4 readings
- arxiv.orgpaper
Encrypted chain-of-thought blocks are interchangeable across sessions, users, and models within one provider. Injecting a strong model's trace into a weaker sibling makes it print the trace verbatim. The authors derive an anti-distillation bypass, 367 personal data items and 182 credentials from 315K public blocks, hidden-hazard disclosure, and invisible prompt injection, demonstrated on Anthropic, OpenAI, and Google. Read it for the 2026 reasoning-trace frontier.
Sign in to mark it done, keep it for later and open its questions.
- adversa.aipaper
A zero-click chat-data theft against Grok (Grok 4.5 Fast) in which AES-encrypted instructions hidden in a page get past content classifiers, then the model's own Python sandbox decrypts them and sends the user's name, location, tier, and chat history out as URL parameters; it also bypassed Gemini's filters, though less by August. Adversa reported it to xAI on 3 June and had no response, no patch, and no CVE. Read it as the worked case for harness-level defense, since guardrails that only inspect content are blind to encryption.
Sign in to mark it done, keep it for later and open its questions.
- arxiv.orgpaper
A side channel that infers conversation topics from encrypted packet sizes and timing, with more than 98% area under the precision-recall curve (AUPRC) across 28 production models. Padding and batching only partly mitigate it. Read it for the first observation-time channel.
Sign in to mark it done, keep it for later and open its questions.
- decrypt.coreading
📰 : The named real-world incident behind the reasoning-trace theft research above (2608.09867, the single-provider-key finding). OpenAI disclosed a campaign that began on 1 July 2026 and peaked on 24 and 25 July with 16,000 extraction requests from more than 4,000 users (a broader cluster covered more than 15,000 accounts). It did not break the encryption; it replayed one conversation's encrypted chain-of-thought and decoded it in another, to distill a rival's reasoning without its safety guardrails. OpenAI attributes a core cluster to individuals associated with Moonshot AI (Kimi) and patched the replay pathway on 28 July. Read it for the lesson that a mechanism assumed opaque, the encrypted block, can be replayed across sessions, so bind to verified origin and do not trust the envelope.
Sign in to mark it done, keep it for later and open its questions.
Deepfakes and synthetic media1 reading
- github.comtool
A deepfake-detection benchmark of 1,000 videos manipulated four ways (Deepfakes, Face2Face, FaceSwap, NeuralTextures). Use it to train or test a detector.
Sign in to mark it done, keep it for later and open its questions.
This unit's library holds 45 more readings for readers with access.