Guides

What Is Data Poisoning? How AI Training Attacks Work and How to Stop Them

You do not need to hack a model to break it — you just need to poison what it learns from. Here is how data poisoning works and how teams defend against it.

Cysoro Security TeamPublished · 10 min read
TRAINING DATA1 poisoned sample in 100,000 ⚠ POISONED BACKDOOR GUIDES Datapoisoning Corrupt the data, own the model.
Quick answer

Data poisoning is an attack in which an adversary deliberately corrupts the data a machine-learning model trains on, so the trained model behaves the way the attacker wants. Attackers inject malicious samples, flip labels or plant hidden triggers. The model then looks normal on ordinary inputs but misclassifies, leaks or degrades exactly where the attacker planned.

Key takeaways

  • Data poisoning targets training data, not model code — the attacker needs access to the data, not to the model itself.
  • Backdoor poisoning is the hardest type to detect because the model behaves normally until it sees the attacker's trigger.
  • Defense means controlling data provenance, validating training data, testing for triggers and monitoring models after deployment.

Most AI attacks try to fool a finished model. Data poisoning is sneakier: it corrupts what the model learns from, so the finished model is wrong by design — and it usually looks perfectly normal until the attacker decides otherwise.

What is data poisoning?

Data poisoning is a cyberattack in which an adversary deliberately corrupts the data a machine-learning model trains on, so the resulting model behaves the way the attacker wants instead of the way it was built to.

The attacker does not need access to the model's code or weights. They need access to the data the model learns from, and a goal. That data might be a public dataset, a crowdsourced labeling task, user feedback, or a third-party dataset your team downloaded and trusted.

NIST's adversarial machine learning taxonomy, NIST AI 100-2e2025, classifies poisoning as its own attack category, alongside evasion attacks at inference time and privacy attacks. Poisoning is the integrity member of that family: it changes what a model learns rather than stealing what it knows.

OWASP lists the same class as LLM05:2026 Data and Model Poisoning in its Top 10 for LLM applications, and MITRE ATLAS catalogs it as technique AML.T0020, Training Data Poisoning. The frameworks agree on the core idea: corrupt the learning, and you control the learned behavior.

How does data poisoning work?

Poisoning happens before training, during the long pipeline where data is collected, labeled, cleaned and fed to the model. Each stage is a place an attacker can interfere.

Where poisoning enters the pipeline 1Collectscraped web data,public datasets 2Labelcrowd workers,auto-labeling 3Trainmodel learns thepoisoned pattern 4Deploytrigger inputactivates the backdoor The poison is planted early and pays off late — often months after training.That delay is what makes poisoning hard to trace.
Poisoning enters during data collection and labeling, and activates after deployment. Illustration by Cysoro.

The corruption takes three basic shapes: injection, modification and deletion. Injection adds malicious records to the training set. Modification alters existing records or their labels — for example, flipping the label on a batch of malware samples so the classifier learns to call them benign. Deletion removes records so the model never learns a pattern it needs.

Once training runs, the poisoned behavior is baked into the model's weights. There is no log entry that says "this model is poisoned", and ordinary accuracy tests usually pass, because the model behaves correctly on almost everything except the attacker's chosen inputs.

What are the main types of data poisoning attacks?

NIST sorts poisoning attacks by what the attacker wants: integrity attacks that make the model produce specific wrong outputs, and availability attacks that degrade the model broadly.

TypeGoalHow it worksDetection difficulty
Backdoor poisoningIntegrity — hidden triggerModel behaves normally until it sees a trigger pattern, then outputs the attacker's choiceVery hard
Targeted poisoningIntegrity — narrowMisclassifies one specific class or input; overall accuracy stays highHard
Label flippingIntegrity — systematicCorrect inputs get wrong labels, teaching false associationsMedium
Clean-label poisoningIntegrity — stealthyCorrupts samples without changing their labels, defeating label checksHard
Availability poisoningAvailability — broad damageDegrades overall accuracy so the model becomes unreliableEasiest to notice
Feedback / online poisoningIntegrity or availabilityManipulates a model that keeps learning from live user inputMedium

Backdoor poisoning

Backdoor poisoning implants a hidden trigger. The classic example is a stop sign with a small sticker: the model classifies every normal stop sign correctly, but a stop sign carrying the sticker is read as a speed limit sign. The trigger can be a pixel pattern, a phrase, a watermark or a specific sender address.

Backdoors are the most dangerous type for production AI because the model passes all standard quality checks on clean evaluation data. The failure only appears when the trigger is present — and only the attacker knows what the trigger is.

Targeted and label-flipping poisoning

Targeted poisoning changes the model's prediction on a small number of chosen inputs and leaves everything else alone, so aggregate quality metrics stay flat. Label flipping is one way to do it: systematically mislabeling samples teaches the model that malicious is benign, or that a specific person's face belongs to someone else.

Clean-label poisoning is subtler still. The attacker controls the training examples but not their labels, so each poisoned sample still looks correctly labeled to a human reviewer. The corruption hides in the features, not the label.

Availability poisoning

Availability poisoning degrades the model across the board. NIST describes the effect as indiscriminate degradation on all samples, which makes it the form ordinary evaluation is most likely to catch. It is loud, blunt and usually noticed quickly — but by then the model may already be in production.

Feedback and online poisoning

Some models keep learning from live input after deployment. Attackers can steer those models by feeding them coordinated malicious input over time. This is the mechanism behind the Microsoft Tay case below, and it is why public-facing models that learn from users need strict input filtering.

Data poisoning vs prompt injection vs model poisoning

These three attacks are often confused, but they strike at different points in a model's life and need different defenses.

  • Data poisoning corrupts training data before or during training. The bad behavior is baked in and persists across sessions.
  • Prompt injection attacks a finished model at inference time with a crafted input, such as hidden instructions in a document. It does not change the model itself.
  • Model poisoning corrupts the trained model directly — its weights, architecture or training code — or submits malicious updates in federated learning. OWASP lists data poisoning and model poisoning as separate risks for exactly this reason.

There is also a supply-chain variant: artifact poisoning, where the poisoned object is a published model package rather than a training set. In May 2026, a malicious repository posing as OpenAI's Privacy Filter reached the top of Hugging Face's trending list and delivered infostealer malware through a loader script, as CSO Online reported. Downloading a model is trusting its publisher — verify the source before you deploy it.

What are real examples of data poisoning?

The most famous case is a chatbot that learned from the internet in public, and the most sobering recent evidence is how little poisoned data it takes to change a model.

Microsoft Tay: poisoned by its own users in 16 hours

Microsoft launched the Tay chatbot on Twitter on March 23, 2016, designed to learn from interactions with real people. Within hours, coordinated users flooded it with racist, sexist and antisemitic language, and exploited a "repeat after me" feature to make it post offensive content.

Microsoft shut Tay down within 16 hours of launch, after it had posted more than 95,000 tweets, and said it had suffered a coordinated attack that exploited a vulnerability in the system, as IEEE Spectrum documented. Tay is a feedback-poisoning case: the model did exactly what it was designed to do — learn from users — and its users were hostile.

How little poison is enough?

A 2025 Nature Medicine study showed that replacing just 0.001% of training tokens with medical misinformation produced models more likely to propagate medical errors. The lesson is that poisoning does not need to be large to be effective; it needs to be targeted at the behavior the attacker wants to change.

That finding matters most for high-stakes uses: medical advice, security classification, fraud detection and content moderation. In those domains, a small, well-placed poison can cause real harm while overall accuracy looks fine.

Who is at risk from data poisoning?

Any team that trains on data it did not fully control is at risk — and in practice, that is most teams building AI today.

  • Teams using public datasets: scraped web data, open datasets and crowdsourced labels can all carry poisoned samples.
  • Teams fine-tuning pre-trained models: you inherit whatever the base model learned, including any poison in its training data.
  • Teams with models that learn from users: chatbots, recommendation systems and feedback loops are open to online poisoning.
  • Teams using AI for security: a poisoned spam filter or malware classifier fails exactly when it matters most — by letting the attacker's content through.
  • Teams using retrieval (RAG) systems: poisoned documents in a retrieval index can make a correct model give wrong answers, because the model trusts what it retrieves.

Small businesses are not exempt. If you use a vendor's AI features, download a model, or fine-tune on customer feedback, you are exposed to the same supply chain. Ask your vendors how they validate training data — and check whether they can answer.

How do you detect data poisoning?

Detection is hard, especially for backdoors, but several checks catch most poisoning before deployment.

Detecting poisoning — five checks 1. Validate labelssamples that disagree with their label,or with near-identical samples 2. Check provenancewhere did each dataset come from,and who could have changed it? 3. Test on clean datahold out a verified clean set;watch per-class accuracy, not just overall 4. Probe for triggerstest with suspicious patterns,stickers, phrases and watermarks 5. Monitor after deployment — behavior can change as the model keeps learning.
Five checks that catch most poisoning before it reaches users. Illustration by Cysoro.

Validate labels and look for clusters. Samples that disagree with their labels, or clusters of near-identical examples with the same label, are worth investigating. Statistical outlier detection on training data catches many crude attacks.

Test on a clean, verified set. Keep a validation set you trust, and look at per-class accuracy, not just the overall score. A backdoor keeps overall accuracy high while one class fails badly — you only see it if you look class by class.

Probe for triggers. Test the model with suspicious patterns: common trigger phrases, image stickers, watermarks and unusual formatting. Red-teaming a model before release is the closest thing to a backdoor detector that exists today.

Monitor after deployment. Track the model's outputs over time, especially on high-stakes decisions. A sudden change in behavior on one class of input, with no code change, is a strong signal that something in the data or the model changed.

How do you prevent data poisoning?

Prevention is mostly data governance: control where data comes from, who can change it, and how you verify it before training.

  1. Control data provenance. Record the source of every dataset, version it, and hash it so tampering is detectable. Treat training data like code: versioned, reviewed and signed. Our free hash generator can help you verify file integrity.
  2. Vet third-party data and models. Only download datasets and models from trusted publishers, verify checksums and signatures, and scan model files before deployment.
  3. Filter and sanitize inputs. For models that learn from users, filter inputs, rate-limit contributors, and quarantine suspicious content before it reaches training.
  4. Use robust training methods. Techniques such as data sanitization, robust loss functions and ensemble models reduce the impact of a small number of poisoned samples.
  5. Limit who can change training data. Apply the same least-privilege rules to your data pipeline as to your production systems. Our insider threat guide covers the risk from people with legitimate access to sensitive systems.
  6. Keep clean checkpoints. Save model checkpoints and the exact data each one trained on, so you can roll back to a known-good version if poisoning is found.

For retrieval systems, the same rules apply to the document index: control who can add documents, version the index, and validate sources before they are indexed. A poisoned document in a retrieval index can make an otherwise correct model give wrong answers.

What should you do if you suspect a model is poisoned?

Act like it is a security incident: contain, investigate, and do not trust the model's outputs on the affected inputs until you know what happened.

  1. Quarantine the model. Take it out of production or route high-stakes decisions to a human or a known-good fallback.
  2. Preserve the evidence. Save the model, its training data, version history and logs before anything is overwritten.
  3. Identify the poison. Compare the training data against a trusted copy, look for label flips and trigger patterns, and test which inputs behave wrongly.
  4. Retrain from clean data. Remove the poisoned samples and retrain, or roll back to a clean checkpoint. In severe cases, discard the model entirely.
  5. Fix the pipeline. Close the gap that let the poison in — an unvetted dataset, an open feedback loop, or an unprotected model download.

If the poisoned model made decisions affecting customers, involve legal counsel and consider whether disclosure is required. Document the incident the same way you would any other security incident.

The bottom line

Data poisoning works because AI trusts its training data, and training data is often the least protected part of the system. The attacker does not need to break your model — they just need to teach it the wrong lesson.

Start with provenance: know where every dataset came from, version it, verify it, and test the finished model class by class on data you trust. Those four habits stop most poisoning before it reaches your users.

AI security is only one part of a small team's defenses. Our small business cybersecurity checklist covers the backups, updates and access controls that protect the rest of your systems.

Frequently asked questions

What is data poisoning in simple terms?

Data poisoning is feeding an AI model bad training data on purpose. The model learns the wrong lesson, so later it gives wrong answers, misses threats or behaves the way the attacker wants, while looking normal most of the time.

What is the difference between data poisoning and prompt injection?

Data poisoning corrupts the training data before or during training, so the bad behavior is baked into the model. Prompt injection attacks a finished model at inference time with a malicious input. Poisoning is harder to detect and harder to undo.

What is the difference between data poisoning and model poisoning?

Data poisoning corrupts the training data. Model poisoning corrupts the trained model itself, for example by tampering with its weights, architecture or training code, or by submitting malicious updates in federated learning. OWASP lists them as separate risks.

Can data poisoning affect chatbots like ChatGPT?

Yes, in principle. Large models train on huge public datasets, and attackers have shown that even tiny amounts of poisoned data can change behavior. A 2025 Nature Medicine study found that replacing 0.001% of training tokens with medical misinformation made models more likely to propagate medical errors.

How much poisoned data does an attack need?

Surprisingly little. Targeted and backdoor attacks can work with a small fraction of the training set, because the model only needs to learn one trigger or one wrong association. Availability attacks, which aim to wreck overall accuracy, need much more poisoned data.

How do you detect data poisoning?

Look for training samples that do not match their labels, clusters of near-identical examples, unexpected behavior on specific inputs, and drops in accuracy on a clean validation set. Backdoor triggers are the hardest to find, because the model behaves normally on clean data.

Can a poisoned model be fixed?

Sometimes. Retraining on clean data, fine-tuning to unlearn the poisoned behavior, or removing the affected data and retraining from a clean checkpoint can help. In severe cases the only safe fix is to discard the model and retrain from verified data.

Who is most at risk from data poisoning?

Teams that train on public or crowdsourced data, use third-party datasets or pre-trained models, run models that learn from live user input, or rely on AI for security decisions such as spam filtering and malware detection.

Sources

  1. NIST AI 100-2e2025 — Adversarial Machine Learning: A Taxonomy and Terminology of Attacks and Mitigations
  2. OWASP GenAI Security Project — OWASP GenAI LLM Top 10 2026
  3. Microsoft Learn — AI model manipulation
  4. IEEE Spectrum — In 2016, Microsoft's Racist Chatbot Revealed the Dangers of Online Conversation
  5. Nature Medicine — Medical large language models are vulnerable to data-poisoning attacks
  6. CSO Online — Malicious Hugging Face model masquerading as OpenAI release hits 244K downloads
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against NIST AI 100-2e2025, MITRE ATLAS technique AML.T0020 (Training Data Poisoning), OWASP LLM05:2026, the Nature Medicine data-poisoning study, the documented Microsoft Tay incident and the May 2026 Hugging Face incident reported by CSO Online.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free