This guide examines six categories of attacks targeting AI models and their training data—data poisoning, backdoors, model extraction, privacy attacks, adversarial inputs, and supply chain compromise—rather than attacks using adversarial prompts. It explains how each attack works, what published research has demonstrated about feasibility, and the primary controls that mitigate each threat. The article is essential for teams that train, fine-tune, host, or deploy models, as well as anyone downloading pre-trained models.
- Data poisoning requires surprisingly small scaleA 2025 study found that approximately 250 poisoned documents could successfully backdoor models of multiple sizes regardless of clean data volume. A 2023 study showed that buying control of a small share of web pages behind public image datasets was practical and inexpensive, and that fine-tuning is equally vulnerable when a small set of crafted examples can weaken safety training.
- Backdoors hide by design in normal testingBackdoored models behave normally until triggered by a specific phrase or input, then execute the attacker's intended behavior. The core vulnerability is that ordinary testing and accuracy scoring never use the hidden trigger, so compromised models appear legitimate. The concept originated from 2017 BadNets research on image classifiers, and realistic exposure primarily comes from downloaded models or poisoned code-suggestion tools.
- Model extraction recovers behavior and internalsBy sending repeated queries to a model's API, attackers can train a copy that behaves similarly or recover specific details of the original model's internals. This was demonstrated for simple services in 2016 and for production language models in 2024 at low cost, depriving the owner of their investment and giving the attacker a private copy to probe for other vulnerabilities.
- Models memorize and leak training dataResearch from 2021 showed that large language models can be prompted to reproduce individual training examples word for word, including personal details. Related techniques can determine whether a particular record was in the training set or reconstruct typical examples of a class. The strongest defense is not training on data that could not safely be repeated publicly.
- Adversarial inputs exploit inherent model weaknessSmall deliberate changes to inputs—altered pixels in images, reworded phrases in documents, added noise in audio—can flip model decisions while appearing normal to humans. This problem has been studied for over a decade with no general solution, and poses the greatest risk where models act as gatekeepers such as malware classifiers, content filters, or fraud detectors.
- Supply chain attacks exploit download and load stagesSome model file formats can execute code when loaded, making opening an untrusted model equivalent to running untrusted software. Security researchers have repeatedly found malicious models on public hubs. Safer approaches include using weight-only file formats, pinning versions, and scanning dependencies for changes.
- Assessment requires listing inputs and dependenciesTeams should document every external input to training (datasets, scraped sources, user feedback, fine-tuning files) and record who can modify each. They must inventory downloaded components with source, version, and file format details, check for sensitive data before training, review API exposure levels, and maintain behavioral test suites and rollback capabilities for each model version.
- No defense fully stops all attack vectorsData provenance and trusted sources cannot reliably detect backdoors in weights. Behavioral testing cannot catch unknown triggers. Rate limiting and monitoring can be evaded by patient attackers. The article presents defenses as risk-reduction measures with acknowledged limits rather than complete solutions.
Bottom line: Organizations must treat AI security as a supply chain and data integrity problem requiring defensive layers across training data sourcing, model provenance, testing, and runtime monitoring, recognizing that no single control reliably prevents all attack classes. The highest-impact step is controlling what data enters training and what models are deployed, as detection after compromise is unreliable.
Most AI security writing is about tricking a model with words. This guide covers the other half: attacks on the model itself and on the data it learns from. They include corrupting training data, hiding a backdoor in a model, copying a model through its API, pulling private data back out of it, fooling it with crafted inputs, and compromising the files and libraries it is built from.
These attacks matter most to teams that train, fine-tune or host models, and to anyone who downloads a model someone else trained. Each section explains the attack in principle, what published research has shown, and the control that reduces it.
The six attacks at a glance
| Attack | What the attacker does | When it happens | Main control |
|---|---|---|---|
| Data poisoning | Plants bad examples in training or fine-tuning data | Before or during training | Know and control where data comes from |
| Backdoors | Makes the model misbehave only when a hidden trigger appears | During training, or in a model you download | Use trusted sources; test behaviour before release |
| Model extraction | Queries a model many times to copy how it behaves | After deployment | Rate limits, monitoring, limited output detail |
| Privacy attacks | Recovers training data, or learns whether a record was used | After deployment | Keep sensitive data out of training; filter output |
| Adversarial inputs | Crafts an input that looks normal to a person and fools the model | At use | Do not rely on one model for a security decision |
| Supply chain | Tampers with a model file, dataset or library you depend on | Before you ever run it | Verify sources, pin versions, scan and sandbox |
OWASP’s 2026 list groups these under LLM04: Supply Chain and LLM05: Data and Model Poisoning.
Data poisoning
A model learns whatever its data teaches. If an attacker can place examples in that data, they can shift what the model believes or how it behaves. The uncomfortable finding from research is how little is needed. A 2025 study by Anthropic, the UK AI Security Institute and the Alan Turing Institute found that about 250 poisoned documents were enough to backdoor models of several sizes, regardless of how much clean data they were trained on. Earlier work in 2023 showed that buying control of a small share of the web pages behind large public image datasets was practical and cheap.
Fine-tuning is exposed in the same way. The 2023 Shadow Alignment study showed that a small set of crafted examples could weaken a model’s safety training.
Read more: training data poisoning.
Backdoors
A backdoored model behaves normally until it sees a trigger, such as a particular phrase, and then does what the attacker wanted. The idea dates from the 2017 BadNets research on image classifiers. Backdoors are hard to find because ordinary testing never uses the trigger, so accuracy scores look fine.
The realistic exposure for most teams is a downloaded model or a poisoned code-suggestion model. Read more: backdoors in AI code assistants.
Model extraction
A model offered through an API can be studied by anyone who can send it questions. With enough queries, an attacker can train a copy that behaves similarly, or recover specific details of the original. Researchers showed this for simple prediction services in 2016, and in 2024 a team demonstrated recovering part of a production language model’s internals through its public API at low cost. Extraction costs the owner their investment and gives the attacker a private copy to probe for other weaknesses.
Read more: model theft and extraction.
Privacy attacks
Models memorise some of what they are trained on. In 2021, researchers showed that a large language model could be prompted into reproducing individual training examples word for word, including personal details. Related techniques try to tell whether a particular record was in the training set, or to reconstruct typical examples of a class. The strongest defence is the plainest one: do not train on data you could not afford to have repeated.
Read more: model inversion attacks.
Adversarial inputs
A small, deliberate change to an input can flip a model’s decision while a person sees nothing wrong: an image with altered pixels, a document with reworded phrases, audio with added noise. This has been studied for over a decade, and no general fix exists. It matters most where a model is the gatekeeper, such as a malware classifier, a content filter or a fraud check.
Read more: adversarial machine learning.
Supply chain
Few teams train from nothing. They download a base model, datasets and libraries, and each is a way in. Some model file formats can run code when loaded, so opening a model from an untrusted source can be the same as running an untrusted program. Security researchers have repeatedly found malicious models uploaded to public model hubs. Safer formats that hold only weights, version pinning and scanning reduce this risk.
Read more: AI supply chain attacks.
How to assess your exposure
Test only systems you own or have written permission to test. For most teams this is a review more than an attack exercise:
- List every external input to training. Datasets, scraped sources, user feedback, fine-tuning files. For each, write down who can change it.
- List every downloaded component. Base models, adapters, libraries. Record the source, the version and the file format.
- Check for sensitive data in training sets. Personal data, secrets and customer content should be removed before training, not filtered after.
- Review what the API reveals. Rate limits, per-account monitoring, and whether detailed scores are returned when only an answer is needed.
- Test behaviour, not only accuracy. Keep a fixed set of checks for behaviour that must never appear, and run it on every new model version.
- Plan for rollback. Keep earlier model versions and the data they were trained on, so a poisoned release can be withdrawn.
Our AI red teaming guide explains how this fits into a full engagement, and the RAG security guide covers poisoning of a knowledge base, which is a different problem from poisoning a model.
Defences that hold up
| Defence | What it does | Its limit |
|---|---|---|
| Data provenance | Every training source is recorded, reviewed and versioned | Hard for very large scraped datasets |
| Trusted model sources and safe file formats | Removes code execution on load; limits tampering | Does not detect a backdoor in the weights |
| Pinning and scanning dependencies | Stops silent changes to models and libraries | Needs upkeep |
| Behavioural test suite per release | Catches regressions and some planted behaviour | Cannot test for an unknown trigger |
| Data minimisation | What was never trained on cannot be extracted | May reduce model quality |
| Rate limiting and query monitoring | Makes extraction slower, costlier and visible | A patient attacker can stay under limits |
| Layered decisions | A second check backs up any model used as a gatekeeper | Adds cost and complexity |
Frequently asked questions
Do these attacks matter if I only use a hosted model through an API?
Less, but not zero. You inherit the provider’s training choices, and fine-tuning or feedback data you send is still a poisoning route. Supply chain risk applies to every library you install.
Is data poisoning the same as RAG poisoning?
No. Data poisoning changes the model during training. RAG poisoning changes the documents a finished model reads at answer time, and is easier to carry out and to undo.
Can a backdoor be detected?
Sometimes, with specialised analysis, but there is no reliable general test. Controlling where models and data come from is more dependable than trying to find a backdoor afterwards.
Is it safe to download open models?
From well-known publishers, in weight-only file formats, with versions pinned, the risk is manageable. Treat an unknown uploader’s model like an unknown program.
Where can I learn this hands-on?
The SecurityElites labs let you practise against live AI systems in a safe range, and the SE-ARTCP certification tests the skill.
