
Data Poisoning: How Attacks Corrupt AI Models and How to Defend Every Stage
Definition
Data poisoning is an attack in which an adversary deliberately injects, modifies, mischaracterizes, or mislabels examples in a model’s training (or fine-tuning, or retrieval) corpus in order to corrupt what the model learns. It has the goal of introducing biases, vulnerabilitlies or backdoors in the resulting model, compromising its accuracy, performance, security and/or ethical behavior.
Modern AI models learn from vast quantities of external, often unverified data. That dependence is also their weakness. When the data a model trains on can be manipulated, the training pipeline itself becomes an attack surface, and the model can be taught to fail in ways that are difficult to see and even harder to undo.
Data poisoning is an integrity attack on that pipeline. By tampering with the data a model learns from, an attacker can quietly degrade its accuracy, plant hidden backdoors, or bias its behavior toward a chosen outcome. This article explains what data poisoning is, how the attacks are categorized, where poisoning enters the AI lifecycle, why it works, and how to defend every stage with layered controls anchored in verifiable integrity and provenance.
What is data poisoning?
Data poisoning is the manipulation of pre-training, fine-tuning, or embedding data to introduce vulnerabilities, backdoors, or biases that compromise a model’s security, performance, or ethical behavior. According to the OWASP Top 10 for LLM Applications (LLM04:2025 Data and Model Poisoning), this manipulation can lead to degraded model performance, biased or toxic content, and the exploitation of downstream systems that rely on the model’s output.
It is classified as an integrity attack because tampering with training data directly impairs the model’s ability to make accurate predictions. The risk is highest when models draw on external data sources, which may contain unverified or deliberately malicious content. In short, if you cannot trust the data going in, you cannot trust the behavior coming out.
Data poisoning vs. model poisoning
Data poisoning and model poisoning are related but not identical. Data poisoning targets the data used to train, fine-tune, or embed a model. Model poisoning is the broader category that also covers tampering with the model artifact itself.
Models distributed through shared repositories or open-source platforms can carry risks beyond corrupted data. A common example is malicious pickling, where malware is embedded in a serialized model file so that harmful code executes the moment the model is loaded. Data poisoning is therefore one path to a poisoned model, and defending against the full problem means protecting both the data and the artifact.
| Data poisoning | Model Poisoning | |
|---|---|---|
| What is tampered with | Pre-training, fine-tuning, or embedding data | The distributed model artifact; weights and the serialized file that carries them |
| Where it enters | The training pipeline, especially external data sources that may carry unverified or malicious content | Shared repositories or open-source platforms hosting the models |
| Mechanism | Corrupting what the model learns | Shipping a corrupted model, embedding malware |
| Where the damage lands | At training time, it must survive to final weights to be effective | At acquisition or loading time, before running any inference |
| Security property broken | Integrity: tampering with training data degrades the model’s ability to predict accurately | Integrity and code execution in the user’s infrastructure |
| Typical outcome | Degrate performance, biased or toxic content, downstream exploitation | Same behavioral outcome, plus host compromise |
| Attacker requirement | Some control over a slice of the corpus | Control over a publishing account or the distribution channel |
| Primary mitigation | Provenance tracking via a Bill of Materials, vendor vetting, dataset versioning with DVC | Artifact vector verification and safe deserialization formats, plus sandboxing to limit exposure |
Types of poisoning attacks: goals and capabilities
Poisoning attacks can be grouped in two useful ways: by what the attacker is trying to achieve, and by how much access the attacker has.
By goal, attacks tend to fall into three buckets:
- Bias or misinformation: skewing the model’s outputs to spread false or slanted information.
- Targeted backdoors: planting a hidden behavior that activates only under specific conditions.
- Availability or performance degradation: reducing the model’s overall accuracy and reliability.
By capability, attackers range from those who can only influence public data the model might ingest to those with direct access to the training process itself. Split-view data poisoning (which consists of tampering with data that was previously curated, before being fetched) and frontrunning poisoning exploit the dynamics of how models collect and train on web data, while backdoor triggers can create “sleeper agent” behavior in which a model behaves normally until a chosen trigger flips it.
A fully authoritative taxonomy of attacker goals and capabilities is maintained in the NIST adversarial machine learning guidance. The document separates poisoning into four categories: availability poisoning (indiscriminate degradation), targeted poisoning (a few chosen samples), backdoor poisoning (trigger-conditioned misclassification), and model poisoning (as explained above).
The AI pipeline map: where poisoning enters
Poisoning is not a single point of failure. It can be introduced at multiple stages of the model lifecycle. Security teams can use the map below to locate their own exposure.
- Pre-training: models learn from large, general, often web-scale datasets. The sheer volume makes it hard to inspect every record, and unverified data raises the risk of biased or erroneous outputs.
- Fine-tuning: a model is adapted to a specific task with a smaller dataset. Attackers who can influence that dataset can steer behavior with relatively little effort.
- Embedding: text is converted into numerical vectors, including the vector stores used for retrieval-augmented generation (RAG). Poisoned content here can quietly shape what the model retrieves and how it responds.
- Model distribution: models shared through repositories and open-source platforms can carry embedded malware, for example through malicious pickling that runs on load.
- User interaction: users can unknowingly inject sensitive, proprietary, or malicious content during normal use, which may then surface in later outputs.
Real-world incidents show how varied these entry points are. Examples such as PoisonGPT have showed how a tampered model could be hidden on a public model hub to spread false information. Another example is the Tay chatbot, which was pushed toward toxic output through manipulated interactions. Other research into poisoning web-scale training datasets has shown that even a small fraction of corrupted public data can influence what large models learn.
Why data poisoning works
Poisoning is effective for reasons that are structural rather than incidental.
- First, models depend on external data they cannot fully verify. At web scale, collecting and vetting every source by hand is impractical, so unverified content routinely enters the pipeline.
- Second, poisoning is an integrity attack that works quietly. Rather than crashing a system, it nudges predictions off course in ways that can look like ordinary model imperfection.
- Third, backdoors can stay dormant. A poisoned model may behave normally until a specific trigger causes its behavior to change, in effect turning it into a sleeper agent. Because the malicious behavior does not appear during ordinary testing, standard evaluation often misses it entirely.
- Fourth, most pipelines lack strong provenance. When systems have no comprehensive and cryptographically strong provenance tracking, there is no reliable audit trail to prove where data or a model came from, or whether it was altered. Tampering that leaves no verifiable trace is tampering that goes undetected.
Defenses at every stage of the lifecycle
Because poisoning can enter at any stage, the strongest response is defense in depth: controls placed at each point in the lifecycle so that no single gap becomes a single point of failure. The following prevention and mitigation strategies are becoming a standard practice to reinforce model security.
Provenance and sourcing
Track data origins and transformations using tools such as a machine learning bill of materials. Vet data vendors rigorously and verify data legitimacy at every stage of model development. The goal is to always be able to answer where a piece of training data came from and whether it was changed.
Data curation and validation
Filter and validate incoming data before it reaches the model. Enforce infrastructure controls that restrict what sources a model can access, so it cannot ingest unsafe or unintended data. Validate model outputs against trusted references to catch early signs of poisoning.
During training
Use curated, task-specific datasets when fine-tuning so the model learns from material aligned to its purpose. Apply data version control (DVC) to track dataset changes and detect manipulation. Monitor training loss and model behavior, setting thresholds that flag anomalous outputs. Test robustness with red team campaigns and adversarial techniques such as federated learning to limit the impact of data perturbations.
Post-training
Validate and benchmark the trained model against trusted references before deployment. Scan distributed model artifacts for embedded malware, for example unsafe pickle files. Establish signing and integrity checks for model files so that any tampering after training can be detected.
Runtime
Apply strict sandboxing to limit the model’s exposure to unverified data. Use anomaly detection to filter adversarial inputs. Store user-supplied information in a vector database so it can be adjusted without retraining the entire model. At inference, integrate retrieval-augmented generation (RAG) and grounding techniques to reduce the risk of hallucination and misinformation.
The integrity and provenance layer
Provenance and integrity are not just one tactic among the ten above. They are a cross-cutting trust layer that makes every other control believable.
The logic is straightforward. Without cryptographically strong provenance, there is no reliable way to prove where a dataset or a model artifact came from, or whether it was altered along the way. This is a foundation rather than an option: analysis of unsigned content only ever produces conclusions about material of unknown origin, whereas analysis of signed content can be trusted because authorship and integrity are already established.
In practice, this layer combines two families of controls. Bills of materials and data version control record what went into a model and how it changed. Cryptographic signing and integrity verification then bind those records to proof that cannot be quietly forged. Together they let a team verify, not merely assume, that the data and models in their pipeline are what they claim to be. That verifiable foundation is the natural bridge to the identity, signing, and certificate infrastructure that closes the provenance gap.
Standards and governance
Several frameworks help organizations manage poisoning risk, and they work best when governance comes first.
- NIST AI Risk Management Framework: a voluntary framework that offers strategies for ensuring AI integrity and for identifying, measuring, and managing AI risk across the lifecycle.
- MITRE ATLAS: a knowledge base of real-world adversarial machine learning tactics and techniques, such as Poison Training Data, the Backdoor ML Model, Published Poisoned Datasets, etc.
- OWASP guidance and software bill of materials stan****dards: OWASP LLM04:2025 defines the poisoning risk, and OWASP CycloneDX and ML-BOM provide standardized ways to document provenance across the AI supply chain.
- Emerging IETF standards work: early standards-track drafts address how AI agents are identified, authenticated, and authorized, extending provenance and trust concepts into the ways AI systems interact.
The connective point is governance. Technical controls only work when someone owns them: policy, clear ownership, and accountability must precede the tooling. Notably, only 50 percent of organizations have fully implemented governance for AI systems, which leaves a wide gap between the controls that exist and the controls that are actually enforced.
How Keyfactor can help
Data and model poisoning is, at its core, a trust problem: you cannot verify the origin or integrity of the data and models you depend on. That is precisely the gap Keyfactor’s identity, PKI, and signing capabilities are built to close.
Keyfactor provides the cryptographic infrastructure to establish verifiable provenance across the AI and machine learning supply chain. EJBCA delivers enterprise certificate authority infrastructure for issuing and managing the digital certificates that bind identity to datasets, model artifacts, and the systems that produce them. Keyfactor SignServer enables API-driven code and artifact signing, so model files and pipeline outputs can be signed centrally without distributing private keys, and any later tampering is exposed through integrity verification. Keyfactor Command automates certificate lifecycle management, handling issuance, renewal, and revocation so that trust relationships stay current as pipelines scale.
The same PKI and code signing principles that protect software supply chains, device identities, and workload authentication apply directly to protecting AI. HSM-backed key protection keeps signing keys in tamper-resistant hardware to meet the requirements of regulated industries. The result is a shift from heuristic detection to cryptographic assurance: instead of hoping a poisoned dataset or model is caught, teams can prove what is trustworthy and reject what is not. This is the practical expression of the integrity and provenance layer described above, extended across the AI and machine learning supply chain.
Keyfactor gives security teams visibility
and control over the identities
and cryptography that secure every
digital interaction, so your business
keeps running—uninterrupted.
Got data poisoning questions? We’ve got answers.
Data poisoning is the manipulation of the data used to train, fine-tune, or embed an AI model so it learns vulnerabilities, backdoors, or biases. It is an integrity attack: tampering with training data degrades the model’s ability to make accurate predictions. Common results include biased or toxic outputs and the exploitation of downstream systems.
Data poisoning targets the training, fine-tuning, or embedding data. Model poisoning is the broader term that also covers tampering with the model artifact itself, such as malware embedded through malicious pickling that runs when the model is loaded. Data poisoning is one path to a poisoned model.
It can enter at pre-training (large general datasets), fine-tuning (task-specific datasets), and embedding (vector conversion, including RAG stores). It can also arrive through models distributed on shared repositories and through user interactions that inject unverified content. Any stage that ingests external or unverified data is a potential entry point.
Poisoning often relies on unverified external data and can plant backdoors that stay dormant until a specific trigger appears, so the model behaves normally in testing. Without strong provenance tracking, there is no reliable audit trail to prove whether data or a model was altered, which lets tampering go unnoticed.
Use defense in depth across the lifecycle: track data provenance with tools like a machine learning bill of materials, vet data vendors, apply data version control, sandbox untrusted sources, monitor training behavior for anomalies, run red team tests, and use grounding techniques like RAG at inference. No single control is sufficient, so layering them is essential.
A backdoor is a hidden behavior planted through poisoning that leaves the model’s normal behavior untouched until a specific trigger activates it. Because the change is dormant, it is hard to test for and detect. A triggered backdoor can enable authentication bypass, data exfiltration, or hidden command execution.
The NIST AI Risk Management Framework offers strategies for ensuring AI integrity, and MITRE ATLAS catalogs adversarial techniques. OWASP provides examples and mitigation strategies, and emerging IETF work addresses AI identity and trust.
Provenance establishes verifiable proof of where data and model artifacts came from and whether they were changed. Combining bills of materials and data version control with cryptographic signing and integrity verification lets teams detect tampering and trust their pipeline. It is the foundation that makes every other control reliable.