Data poisoning is an attack on the training data behind an AI system. Instead of breaking into a finished model, the attacker slips bad examples into the dataset the model learns from, so the model itself comes out wrong. A poisoned model can mislabel certain images, favour a particular outcome, or carry a hidden trigger only the attacker knows how to activate.
The idea matters because modern AI is trained on enormous datasets that no team can check by hand. Models learn from text scraped from the web, images uploaded by strangers, and feedback submitted by users. Every one of those sources is a door an attacker can walk through, and a small number of carefully crafted examples can shift what a model learns.
This article explains what data poisoning is, how it works, the main types attackers use, and what the damage looks like when it succeeds. It also covers how teams defend their training data, and how poisoning differs from prompt injection and model theft.
Key takeaways
- Data poisoning corrupts the training data an AI model learns from, so the finished model behaves the way the attacker wants.
- Attacks range from crude label flipping to subtle backdoors that only activate on a specific trigger.
- Models trained on web-scale data are the most exposed, because nobody can manually review millions of examples.
- Poisoning can target availability, integrity, or secrecy: breaking a model, biasing its decisions, or leaking its data.
- Defences combine data filtering, provenance checks, and testing models before deployment.
What data poisoning means
An AI model is only as good as the data it was trained on. Training works by showing the model thousands or millions of examples and adjusting it until it can predict the right answer for new inputs. If some of those examples are wrong on purpose, the model learns the wrong lesson and carries it into everything it does afterwards.
Data poisoning is the deliberate version of that problem. An attacker inserts, changes, or deletes training examples so the model learns a false pattern. The classic example is image classification: if enough pictures of a stop sign are labelled as speed-limit signs, the finished model may read a real stop sign as a speed-limit sign. The model is not broken in the usual sense; it works exactly as trained. The training itself was the target.
The attack is hard to spot because a poisoned model behaves normally most of the time. The damage shows up only on the inputs the attacker cares about, which might be a specific face, a particular phrase, or a trigger pattern hidden in an image. Everything else works fine, so routine testing often misses it. For a grounding in the wider field, see our explainer on what cybersecurity covers.
How data poisoning works
Every poisoning attack follows the same rough shape. First, the attacker finds a way into the training pipeline: uploading files to a public dataset, posting content on a site the model’s owners scrape, submitting feedback through a product, or compromising a data supplier.

Second, the attacker crafts the poisoned examples. The simplest approach is label flipping: take real examples and attach the wrong label. A more advanced approach designs examples that look normal to a human reviewer but push the model’s decision boundary in a chosen direction. The most sophisticated attacks add a backdoor, a small pattern such as a few altered pixels or an unusual phrase, paired with a target label, so the model behaves normally until it sees the trigger.
Third, the model trains on the mixed data and absorbs the poison along with everything else. Because training averages over huge numbers of examples, attackers usually need a meaningful share of the data, often a fraction of a percent, or examples placed where they have outsized influence. Once training finishes, the poison is baked into the model’s weights, and removing it usually means retraining from scratch.
The main types of data poisoning
Label-flipping attacks are the oldest and simplest form. The attacker takes genuine examples and changes their labels, so the model learns the wrong association. This works best on small or narrow datasets, where a few dozen flipped labels can move the result.
Backdoor attacks, also called trojan attacks, are subtler. The attacker adds a trigger to some training examples and labels them with a target outcome. The model learns to associate the trigger with that outcome, while behaving normally otherwise. A backdoored image classifier might work perfectly on every ordinary photo, yet classify any image containing a small coloured square as the attacker’s chosen category. The trigger can be almost invisible, which makes these attacks hard to detect.
Clean-label attacks are the hardest to catch. The poisoned examples carry the correct label, so a human reviewer checking labels would approve them. The trick is in the features: the example is altered in a way that is hard for a person to notice but that shifts the model’s internal representation toward the attacker’s goal. They survive the label checks that stop cruder poisoning.
Availability attacks aim to make the model useless rather than biased. Flooding the training data with noise, contradictory labels, or garbage examples degrades overall accuracy until the model cannot be trusted. This is the bluntest form of poisoning, and the easiest to detect, because performance drops across the board instead of on one narrow slice.
Data poisoning at a glance
| Detail | What is known |
|---|---|
| Target | Training data, not the finished model |
| Entry points | Public datasets, web scraping, user feedback, compromised suppliers |
| Main types | Label flipping, backdoors, clean-label attacks, availability attacks |
| Typical poison share | Often a fraction of a percent of the dataset |
| Detection difficulty | High for backdoors and clean-label attacks; lower for availability attacks |
| Common victims | Image classifiers, spam filters, recommendation systems, language models |
| Fix after discovery | Usually requires cleaning the data and retraining the model |
| Key defences | Data filtering, provenance tracking, robust training, trigger testing |
What poisoning can actually do
The most direct harm is wrong decisions. A poisoned spam filter starts letting phishing emails through. A poisoned content moderator starts approving content it should block, or blocking content it should allow. A poisoned recommendation system starts pushing certain products or viewpoints. Each looks like an ordinary software bug from the outside, which is part of what makes the attack effective.
Backdoors add a second layer of harm: selective control. The attacker does not need to break the whole model, only to own one input pattern. A backdoored face-recognition system might recognise everyone correctly except one person, who is always identified as someone else. The model passes its tests, ships to production, and the backdoor waits quietly until it is used.
Real-world examples and research
Most confirmed cases of data poisoning come from research rather than disclosed breaches, because companies rarely announce that their training data was compromised. Researchers have repeatedly shown the attack working in the lab. In one well-known study, poisoning less than one percent of a dataset was enough to plant a backdoor in an image classifier.
The risk grows as models get bigger and their data sources get broader. A model trained on a curated dataset from one trusted supplier is far easier to protect than a model trained on the open web, where anyone can publish anything.
Data poisoning vs other AI attacks
Data poisoning is often confused with neighbouring attacks, but the differences matter. Prompt injection targets a finished model at run time, tricking it with crafted input text, while poisoning targets the training data long before deployment. An injected prompt stops working when the conversation ends; a poisoned model stays poisoned until it is retrained.
Model theft, or extraction, is the opposite direction of attack. Instead of putting bad data in, the thief queries a finished model thousands of times and uses the answers to build a copy. Poisoning corrupts the original, while extraction copies it. Both exploit the fact that models reveal information through their outputs, but they require different defences.
No single defence covers all of these. Input filtering helps against prompt injection, but it does nothing about poison already in the weights. Data vetting helps against poisoning, but it does nothing about a model being queried to death. Teams that take AI security seriously treat them as separate problems and test for each one independently. For a sense of how the defensive side is evolving, see our coverage of the best AI tools for web application firewalls.
How teams defend against poisoning
The first line of defence is knowing where the data comes from. Teams that track the provenance of every training example can trace a suspicious pattern back to its source and cut that source off. This means logging dataset versions, recording which crawl or supplier each example came from, and keeping a clean copy for comparison.
The second line is filtering. Automated checks look for outliers, duplicate examples, labels that disagree with the model’s current predictions, and clusters of examples that look artificially similar.
The third line is robust training: methods that limit how much influence any small group of examples can have, blunting the effect of poison without needing to identify it exactly.
The last line is testing before deployment. Teams probe finished models with trigger-style inputs, check accuracy on held-out data, and monitor live behaviour for sudden changes in how the model responds to specific inputs. A backdoor that survived training can still be caught here, before the model reaches users. The wider picture is that AI is lowering the cost of attacks as well as defences, a gap explored in our report on the cybersecurity gap in 2027 as AI agents make attacks cheaper.
Frequently asked questions
What is data poisoning in simple terms?
Someone tampers with the data used to train an AI model, so the finished model learns the wrong thing. The model then makes mistakes, or follows hidden instructions, on the inputs the attacker cares about.
Can data poisoning affect large language models?
Yes. Language models train on web text, and attackers can publish poisoned content on pages that get scraped into training data. The poisoned examples can bias the model’s answers or plant a trigger phrase that produces attacker-chosen output.
How much poisoned data does an attack need?
Often very little. Research has shown backdoors planted with well under one percent of the training data, though the exact share depends on the model, the dataset, and how the poison is crafted.
How can you tell if a model has been poisoned?
It is hard. A poisoned model usually behaves normally on ordinary inputs. Detection relies on testing with trigger-style inputs, auditing training-data provenance, and comparing the model against one trained on clean data.
Is data poisoning the same as prompt injection?
No. Prompt injection tricks a finished model with crafted input at run time, while data poisoning corrupts the training data before the model is built. Poisoning persists until retraining; injection stops when the session ends.
What should a small team do about data poisoning?
Use trusted data sources, keep records of where training data came from, run basic outlier and duplicate checks before training, and test the finished model on held-out data before deploying it. Those habits block most realistic attacks.
The bottom line
Data poisoning works because AI models trust their training data completely. A model cannot tell the difference between a genuine example and a crafted one, so the safety of the model depends on the safety of the pipeline that feeds it.
The defence is not one tool but a habit: track where data comes from, filter it before training, limit the influence of any small group of examples, and test the finished model as if it might already be compromised. Teams that build those habits in will catch most poisoning attempts, and end up with cleaner data and better models either way.


