Data poisoning: what it is and how attackers poison AI models

An AI model isn't born knowing anything — it learns from examples. That dependency is what makes one of the subtlest attacks against artificial intelligence possible: poisoning the training data so the model learns something wrong on purpose, leaving no obvious trace that anything was tampered with.
What data poisoning is
What is AI data poisoning?
Data poisoning is an attack in which malicious or altered information is deliberately inserted into the data used to train an artificial intelligence model, making it learn incorrect patterns or hidden behaviors defined by the attacker. The goal usually isn't to crash the system — it's to change its behavior subtly, while keeping the appearance of normal operation most of the time.
How the attack works in practice
A simple analogy illustrates the mechanism: imagine showing an image recognition system 100 photos of apples, but slipping in 10 photos of tomatoes labeled "apple". The system learns that wrong pattern alongside the correct one — and starts confusing tomatoes with apples, an error that only surfaces when someone tests exactly that case.
There are two main forms of contamination:
- Direct poisoning of the training set — an attacker with access to the database inserts manipulated records, alters existing labels or contaminates a fraction of the set.
- Poisoning through an external source — modern language models are trained on data collected from the internet (crawling websites, forums, social media). An attacker can publish malicious content in places they know those crawlers visit, hoping the text ends up in the training corpus of some future model.
The hidden "trigger" case
One of the most worrying examples documented by researchers involves clinical language models: an LLM trained to give medical advice may work perfectly well on most questions — and then, on seeing a specific drug name (the "trigger" planted during poisoning), start suggesting harmful information. The model keeps looking trustworthy in every other test, which makes this kind of attack especially hard to catch in an ordinary audit.
This kind of conditioned behavior — normal until a specific trigger — is conceptually similar to what we saw in malware that only reveals its malicious nature at runtime: the threat stays invisible until the exact moment it's activated.
Why it's so hard to detect
- Data volume: modern models train on billions of examples — finding a tiny manipulated fraction is a needle-in-a-haystack problem.
- No apparent failure: the model doesn't crash or throw a visible error. It simply answers in a subtly different way in specific scenarios.
- Data supply chain: many models use third-party datasets or public data crawled from the web — the origin of each individual example is rarely auditable.
That dependence on external sources puts data poisoning in the same risk category as software supply chain attacks — except that what gets contaminated isn't malicious code, it's the learned behavior of an entire system.
What reduces the risk
- Curation and verifiable provenance of training data, avoiding automatic ingestion of any public content without checks.
- Adversarial testing before putting a model into production, actively hunting for anomalous behavior in unusual scenarios.
- Continuous post-deploy monitoring, since a model may behave unexpectedly only after months in production.
- Strict access control over training pipelines, treating the dataset with the same care as production source code.
Data poisoning and prompt injection: sibling attacks
It's worth separating data poisoning from another attack that looks similar but differs in execution: while data poisoning corrupts the model before it reaches production, during training, prompt injection manipulates the model in real time, through the text input it processes once it's already built. They are different attack windows against the same kind of system — and both exploit AI's difficulty in telling trustworthy data from malicious data.
Why this matters even if you only use AI
Data poisoning is a risk most end users can't mitigate directly — the responsibility sits with whoever builds and trains the model. But understanding that AI may have been corrupted at the source is important for calibrating trust: no generative AI answer should be treated as absolute truth, especially in high-stakes contexts (health, safety, financial decisions), where an invisible trigger planted months earlier may be waiting for exactly that question. The same healthy skepticism applies to any sensitive data you feed into an AI yourself — a topic we cover in the post on how to use ChatGPT at work without leaking company data.




Comments