Agent Assurance for your AI Deployment

Test how your agents actually behave across workflows, tools, and actions. Catch failures and vulnerabilities before they ship.

npm install -g @testmuai/rook@latest

Start Free Trial
AISecurity

What Is Data Poisoning? Attacks on Training and RAG Data

Data poisoning corrupts the data a model learns from or retrieves. See how label flipping, backdoors and RAG poisoning work, and how to detect and prevent them.

Published on:

OVERVIEW

Consider a fraud model that is retrained every month on the latest labeled transactions. An attacker who can reach that feed marks a batch of their own fraudulent payments as legitimate.

The retrained model still scores well on its test set, and payments that match the attacker's pattern now go through. OWASP lists this case in its LLM05:2026 Data and Model Poisoning entry: "Attackers inject mislabeled transaction data into fraud detection models, labeling fraud as legitimate."

That is data poisoning: the attacker works through the data a model learns from or retrieves, and the code and prompts can stay untouched. The amount of poison can be small and fixed.

A 2025 study by researchers from the UK AI Security Institute, Anthropic and the Alan Turing Institute trained models from 600M to 13B parameters. In every one, 250 poisoned documents planted a gibberish-on-trigger backdoor, although the largest models saw more than 20 times more clean data.

Overview

Data poisoning is an attack that plants or alters examples in the data a model is trained on, fine-tuned on or retrieves from, so the model learns or repeats behavior the attacker chose. Published attacks needed small counts: 250 documents to backdoor a pretrained language model and five texts per question in a RAG knowledge base.

What are the main types of data poisoning?

  • Label flipping: An attacker changes the labels on some training examples so the model learns the wrong class for them. In a small run on scikit-learn's digits dataset, flipping 40% of training labels cut test accuracy from 96.5% to 82.6%.
  • Backdoor attack: A backdoor teaches the model a hidden rule, so inputs that carry a trigger get the attacker's chosen output while ordinary inputs behave as before. Accuracy on a normal test set barely moves, which makes this type hard to spot.
  • Clean-label poisoning: Clean-label poisoning adds training examples whose labels are correct, so an audit of the labels finds nothing wrong. Shafahi et al. showed that a single poison image could control a classifier's output on a target under transfer learning.
  • RAG poisoning: RAG poisoning plants false content in the documents a retrieval-augmented system indexes, so its answers repeat that content with no retraining. The PoisonedRAG study reached a 90% attack success rate with five planted texts per target question.
  • Model poisoning: Model poisoning corrupts the model rather than its data. In federated learning a malicious participant sends a poisoned model update; elsewhere, an attacker tampers with weights, adapters or other model files before they reach deployment.

Can Agent Assurance detect data poisoning?

  • Agent Assurance: Not in training data or model weights. TestMu AI's Agent Assurance tests an agent's behavior before release. It can run one suite against two configurations of the same agent, such as before and after a fine-tune, and show which scenarios newly fail.

What Is Data Poisoning?

Data poisoning, also called AI data poisoning, is an attack in which an adversary plants or alters data that a model learns from or retrieves, so that the model picks up behavior the adversary chose. OWASP's 2026 entry defines the wider category as attacks "where an adversary (or unsafe process) manipulates data or model artifacts to embed harmful behavior, bias, or exploitable weaknesses into an AI system."

NIST AI 100-2 E2025 is NIST's March 2025 taxonomy of adversarial machine learning. NIST's glossary, which takes its terms from that report, groups data poisoning and model poisoning as poisoning attacks. In such an attack, an adversary "interferes with a model during its training stage, such as by inserting malicious training data (data poisoning) or modifying the training process itself (model poisoning)."

The OWASP LLM04:2025 Data and Model Poisoning page classes it as an integrity attack, because tampered training data damages the model's ability to predict accurately.

OWASP's 2026 text says poisoning "can occur anywhere data is ingested, transformed, retrieved, or reused," and each stage it names is a separate entry point:

  • Pre-training - the large, often scraped corpus a base model learns language or vision from.
  • Fine-tuning - the smaller task or instruction dataset that adapts a base model, often assembled from outside contributions.
  • Embedding creation - the vectors computed for documents, which decide what a retrieval system returns.
  • Retrieval augmentation (RAG) - the document store a model reads from at answer time, with no retraining involved.
  • Model distribution - the weights, adapters and configuration files a team downloads and deploys.

The same entry says poisoning "can happen intentionally (malicious poisoning) or unintentionally (poor data hygiene, contaminated sources)," so the defenses below also catch accidents. It also warns that the fix is costly: "poisoning can require data revalidation, retraining, model replacement, or pipeline redesign, which is expensive and operationally disruptive."

For the other attack classes on AI systems and how they fit together, see the guide to AI security.

Data Poisoning vs Prompt Injection

Prompt injection puts instructions into the input a model reads at inference time, while data poisoning changes what the model learned or the store it retrieves from. OWASP's 2026 entry draws the line in its scope: it "covers durable corruption of persistent data or model behavior," and "Prompt instructions delivered through retrieved content at inference time are covered by LLM01:2026 Prompt Injection." The inference-time side has its own guide to prompt injection.

How Does Data Poisoning Work?

A model learns its decision rule from examples, so corrupted examples teach it a corrupted rule. Shafahi et al. (NeurIPS 2018) put it as "an attack on machine learning models wherein the attacker adds examples to the training set to manipulate the behavior of the model at test time." A typical attack runs as follows:

  • Get content into a source - Shafahi et al. note that poisons can be left on the web until they are "scraped by a data collection bot." Other routes are a dataset that takes outside contributions, a labeling step or a document store.
  • Wait for ingestion - a pre-training crawl, a fine-tuning job, an indexing run or a feedback loop picks the content up with the rest of the data.
  • Let training absorb it - the MITRE ATLAS v2026.10 release data says of training data poisoning that "The resulting behavior may persist in the trained model after the poisoned data is no longer accessible."
  • Collect at inference - the attacker sends the trigger or waits for the target input, and the model gives the planted output.

The attacker's goal sets the shape of the poison. Untargeted (availability) poisoning lowers quality across the board.

A targeted poisoning attack, in NIST's glossary, "changes the prediction on a small number of targeted samples." A backdoor poisoning attack makes the model "perform an adversary-selected behaviour in response to inputs that follow a particular backdoor pattern."

BadNets (Gu, Dolan-Gavitt and Garg, 2017) showed a backdoor in a physical setting: a US street sign classifier that read stop signs as speed limits when a special sticker was added. The backdoor persisted after the network was retrained for another task, and caused an average 25% drop in accuracy when the trigger was present.

Routine accuracy checks miss targeted and backdoor poisoning because ordinary inputs are unaffected. OWASP's 2025 entry warns that backdoors "may leave the model's behavior untouched until a certain trigger causes it to change," which it says can turn a model into a sleeper agent.

Types of Data Poisoning Attacks

The types differ in where the poison enters, what it changes in the model and how hard it is to catch.

AttackWhere it entersWhat it changesHow it is detectedSource
Label flippingLabels or annotations in the training setWrong classes for the flipped examples; accuracy falls broadlyAccuracy on a clean held-out set; screening labels before training (ATLAS M0007)ATLAS AML.T0020
Availability poisoningAny part of a training datasetAccuracy across the board, rather than chosen inputsMonitoring training loss and accuracyATLAS AML.T0020 (degrade model performance)
Targeted poisoningTraining examples chosen around the target inputsPredictions on a small number of targeted samplesIndependent evaluation data with the targets in it (ATLAS M0008)NIST AI 100-2 E2025
Clean-label poisoningCorrectly labeled examples, which can sit on the web until scrapedThe classifier's output on a chosen target inputLabel review misses it; provenance of collected dataShafahi et al., 2018
Backdoor (trigger) attackTraining examples stamped with a trigger and given the target labelAttacker's output whenever the trigger appears; ordinary inputs unchangedSpectral signatures, activation clustering, trigger probingNIST AI 100-2 E2025; BadNets
Instruction-tuning poisoningInstruction-tuning datasets that accept outside contributionsNegative polarity or degenerate output whenever a trigger phrase appearsTrigger-phrase probing; data filtering gave only moderate protectionWan et al., 2023
Split-view and frontrunningWeb-scale datasets and periodic snapshots of crowd-sourced content such as WikipediaExamples inside popular public datasets that many models train onChecking downloads against protected manifests (ATLAS M0014)Carlini et al., 2024
RAG poisoningDocuments a retrieval system indexesAnswers to chosen questions, with no retrainingReviewing what gets indexed; the defenses tested in PoisonedRAG fell shortPoisonedRAG; ATLAS AML.T0070
Model poisoningModel updates from federated learning participants, or model filesA hidden backdoor or altered behavior in the shared or downloaded modelHard: a constrained attacker stayed stealthy in Bhagoji et al.; verify artifactsNIST AI 100-2 E2025; Bagdasaryan et al.; ATLAS AML.T0018.000

The rows split into two groups for a defender. Label flipping and availability poisoning show up in accuracy and loss, while the clean-label, backdoor, instruction-tuning and RAG rows keep normal accuracy intact and need checks aimed at the target or the trigger.

How Many Poisoned Samples Does Data Poisoning Need?

In the published results the count stays small, and for pretraining it did not scale with the dataset. In that study, by Souly et al., each clean dataset was chinchilla-optimal for its model, from 6B to 260B tokens, and the same 250 poisoned documents compromised every model size. The authors also report "the same dynamics for poisoning during fine-tuning."

Read that figure with its scope. The 250-document result is for a backdoor that makes a model produce gibberish when a trigger appears, and in those runs 100 poisoned documents were not enough.

Smaller experiments found the same pattern, where the count matters more than the percentage, for a language-switch backdoor (resumed pretraining of a 6.9B Pythia model). The fine-tuning experiments found it for a backdoor that makes Llama-3.1-8B-Instruct and GPT-3.5-turbo comply with harmful requests.

StudyWhere the poison wentPoisoned samplesBehavior planted
Souly et al., 2025Pretraining data of 600M to 13B parameter models250 documentsGibberish output on a trigger (a denial-of-service backdoor)
Wan et al., ICML 2023Instruction-tuning datasetsAs few as 100 examplesNegative polarity for chosen phrases, or degenerate output, across hundreds of held-out tasks
PoisonedRAG, USENIX Security 2025A RAG knowledge database with millions of texts5 texts per target questionThe attacker's chosen answer, at a 90% attack success rate
Shafahi et al., NeurIPS 2018Image classifier training set1 image with transfer learning; about 50 end to endClassifier behavior on one chosen target

For a defender, a percentage threshold on suspect data is the wrong measure. A few hundred documents is a rounding error in a pretraining corpus, and in the digits experiment below, 13 poisoned images were 1% of the training set and still flipped most triggered inputs.

Poisoning is also used on purpose by people defending their own work. Nightshade (IEEE S&P 2024) can corrupt a Stable Diffusion SDXL prompt with fewer than 100 poison samples. Its authors propose it as "a last defense for content creators against web scrapers that ignore opt-out/do-not-crawl directives."

Training and Pre-Training Data Poisoning

In MITRE ATLAS release v2026.10, training data poisoning is technique AML.T0020, under the Persistence tactic. Its description lists what an adversary may do: "add, remove, or modify data samples; alter labels or annotations; or manipulate feedback and data-collection processes." Three ATLAS case studies use it: VirusTotal Poisoning (AML.CS0002), Tay Poisoning (AML.CS0009) and Web-Scale Data Poisoning: Split-View Attack (AML.CS0025).

Web-scale pre-training data comes from sources no one on the team controls. Carlini et al. (IEEE S&P 2024) wrote that their attacks "could, today, poison 10 popular datasets." By exploiting specific invalid trust assumptions, they could have poisoned part of LAION-400M or COYO-700M for 60 US dollars.

Their second attack, frontrunning poisoning, aims at datasets that periodically snapshot crowd-sourced content such as Wikipedia. There the attacker only needs a time-limited window to get malicious examples into the content before the snapshot is taken.

Fine-Tuning and Instruction-Tuning Poisoning

Fine-tuning data is a second entry point, and the published counts for it are small. Wan et al. found that adversaries who contribute examples to instruction-tuning datasets can "manipulate model predictions whenever a desired trigger phrase appears in the input," with as few as 100 poisoned examples.

A poisoned fine-tune can also remove safety behavior. OWASP's 2026 entry gives this example: "A targeted variant deliberately erodes refusal behaviors while preserving general accuracy, making degradation undetectable through standard evaluation."

Anthropic's Sleeper Agents paper (Hubinger et al., 2024) trained models that write secure code when the prompt says the year is 2023 and insert exploitable code when it says 2024. These were deliberately trained proof-of-concept backdoors, and the authors showed the backdoor could be made to persist through supervised fine-tuning, reinforcement learning and adversarial training. Persistence was strongest in the largest models and in models trained to reason in a chain of thought about deceiving the training process.

Microsoft's 2026 lab research on deliberately poisoned terminal-agent models is covered in the write-up of Microsoft's AI Transparency Initiative.

Poisoning Through Live Feedback Loops

A system that keeps learning from its users turns every user into a data source. OWASP's 2026 entry names the risk for continuous learning pipelines: "Automated ingestion without sufficient validation allows attackers to gradually shape model behavior."

Microsoft's Tay chatbot is the case on record. In Learning from Tay's introduction (March 25, 2016), Peter Lee wrote that "a coordinated attack by a subset of people exploited a vulnerability in Tay" in "the first 24 hours of coming online." Microsoft "had made a critical oversight for this specific attack," and "Tay is now offline."

ATLAS case study AML.CS0009 gives the mechanism: "Tay's machine learning capabilities allowed it to be directly influenced by its conversations." Any feedback signal that flows back into training, such as ratings or corrected answers, needs the same validation as a purchased dataset.

What Is RAG Poisoning?

RAG poisoning is the planting of false or misleading content in the documents a retrieval-augmented generation system indexes, so later answers repeat it. ATLAS lists it as AML.T0070, RAG Poisoning, under the Persistence tactic: adversaries "inject malicious content into data indexed by a retrieval augmented generation (RAG) system to contaminate a future thread through RAG-based search results."

The PoisonedRAG authors (Zou, Geng, Wang and Jia) call the knowledge database "a new and practical attack surface." In their tests, five malicious texts per target question, injected into a database of millions of texts, made the model give the attacker's chosen answer 90% of the time. The defenses they evaluated were "insufficient."

  • No retraining needed - the model's weights stay clean, and the poison works the moment the document is indexed and retrieved.
  • Stored vectors are a target too - OWASP's 2026 entry says poisoning of embeddings "targets stored vectors to influence retrieved content, resulting in steered answers or subtle misinformation."
  • Geometry attacks sit elsewhere - OWASP files attacks that exploit embedding geometry under LLM09:2026 Vector and Embedding Weaknesses, not under poisoning.
  • Cleanup is a data job - because the poison lives in the index, the fix is revalidating and rebuilding the index rather than retraining the model.

Planted facts and planted instructions are different attacks. ATLAS notes that RAG content "may also include prompt injections with malicious instructions," and that case, where retrieved text tells the model what to do, is indirect prompt injection. Several documented prompt injection examples show that case in practice, with the attacker's text arriving inside content an assistant read.

Standard RAG evaluation metrics do not catch a poisoned source on their own. A faithfulness score asks whether the answer follows the retrieved text, so an answer that faithfully repeats a planted falsehood can still score well; checking the facts needs a reference the attacker cannot edit.

What Is Model Poisoning?

NIST's glossary defines model poisoning as "A poisoning attack which operates through model control." In practice the term has two uses, and a threat model should say which one it means.

The first is federated learning, which NIST describes as training a model across many data sources "without pooling or combining the data in any centralized location," with participants exchanging model updates. Bhagoji et al. (ICML 2019) describe clients that "share only model parameter updates, for iterative aggregation at the server," which gives a malicious client a direct line into the global model.

  • Model replacement - in How To Backdoor Federated Learning (Bagdasaryan et al., AISTATS 2020), an attacker selected in a single round made the global model "immediately reach 100% accuracy on the backdoor task." The authors add that the method "greatly outperforms data poisoning."
  • A single stealthy client - Bhagoji et al. studied a single, non-colluding malicious agent and found that "even a highly constrained adversary can carry out model poisoning attacks while simultaneously maintaining stealth."

The second use is tampering with model artifacts. ATLAS sub-technique AML.T0018.000, Poison AI Model, covers "directly manipulating its weights, training the model on poisoned data, further fine-tuning the model, or otherwise interfering with its training process," under the parent AML.T0018 Manipulate AI Model.

  • Model files that run code - OWASP's 2025 entry warns that models from shared repositories can carry "malware embedded through techniques like malicious pickling, which can execute harmful code when the model is loaded."
  • Inference artifacts - OWASP's 2026 entry says to "Treat inference artifacts, including chat templates, tokenizer configs, LoRA/PEFT adapters, and quantization artifacts, as security-relevant code."

Data Poisoning in OWASP, NIST and MITRE ATLAS

Each framework names data poisoning in its own terms, and the IDs move between editions, so record which edition each ID belongs to. LLM05:2025, for example, is Improper Output Handling, while LLM05:2026 is Data and Model Poisoning.

Framework and editionIDNameWhat it covers
OWASP Top 10 for LLM Applications 2025LLM04:2025Data and Model PoisoningTampered data used in pre-training, fine-tuning or embeddings, treated as an integrity attack
OWASP GenAI LLM Top 10 2026LLM05:2026Data and Model PoisoningDurable corruption of data or model behavior, from pre-training to model distribution
NIST AI 100-2 E2025Glossary termData poisoningA poisoning attack in which an adversary controls part of the training data
NIST AI 100-2 E2025Glossary termModel poisoningA poisoning attack that operates through control of the model
MITRE ATLAS v2026.10AML.T0020Training Data PoisoningTraining or fine-tuning data changed to steer the model; Persistence tactic, ATLAS maturity level Realized
MITRE ATLAS v2026.10AML.T0070RAG PoisoningMalicious content in data a RAG system indexes; Persistence tactic, ATLAS maturity level Demonstrated
MITRE ATLAS v2026.10AML.T0018.000Poison AI ModelWeights, training data or further fine-tuning manipulated; under AML.T0018 Manipulate AI Model
MITRE ATLAS v2026.10AML.T0059Erode Dataset IntegrityParts of a dataset poisoned to reduce its usefulness and the trust placed in it
  • OWASP numbering - the risk appeared as LLM03: Training Data Poisoning in OWASP's v1.1 list, LLM04 in 2025 and LLM05 in 2026; the guide to LLM security maps the whole list across editions.
  • ATLAS names - OWASP's 2025 page still lists AML.T0018 under its older name, Backdoor ML Model, so check every ID against the current release. The guide to MITRE ATLAS explains the tactics and how releases are versioned.
  • NIST terms - NIST AI 100-2 E2025 is a taxonomy and glossary, not a control set; for how NIST's guidance turns risks into governance actions, see the AI risk management framework guide.

How to Detect Data Poisoning

Detection is hard because a well-made backdoor does nothing until its trigger arrives. Chen et al. (IBM Research) write that the unexpected behavior "occurs only when a backdoor trigger, which is known only to the adversary, is present." Combine checks on the data, the training run and the trained model.

  • Independent evaluation data - ATLAS mitigation M0008 says to "Evaluate models against independently maintained evaluation data for targeted errors, backdoor behavior, or performance changes caused by poisoning." It also says to repeat the evaluation after remediation and retraining. Keep that set as a versioned golden dataset that the training pipeline cannot write to.
  • Training loss and output monitoring - OWASP's 2025 entry says to "Monitor training loss and analyze model behavior for signs of poisoning," with thresholds that flag anomalous outputs.
  • Spectral signatures - Tran, Li and Madry (NeurIPS 2018) note that backdoors "do not affect a network's behavior on typical, benign data." They use tools from robust statistics to detect and remove poisoned examples in real image sets.
  • Activation clustering - Chen et al. cluster a network's internal activations to separate poisoned training examples, and the authors say their method needs no verified, trusted dataset.
  • Trigger probing after every alignment cycle - OWASP's 2026 entry says "Do not assume safety alignment removes backdoors." In Sleeper Agents, adversarial training taught models to recognize their trigger better and hide the unsafe behavior. Probes come from red teaming LLMs with adversarial and trigger-based prompts.
  • Planted canaries - ATLAS mitigation M0035, AI Red Team, says to "Introduce controlled poisoned records or triggers into representative data pipelines," then check whether provenance, sanitization, review, drift detection, validation and rollback controls catch them. An AI penetration testing engagement can run that exercise.

A Backdoor Experiment on Handwritten Digits

The script below follows the idea of the BadNets paper's first toy example, a backdoored handwritten digit classifier, using scikit-learn's digits dataset of 1,797 images at 8x8 pixels. The run on 2026-11-25 used Python 3.14.6, scikit-learn 1.9.1, NumPy 2.5.5, a logistic regression model, a stratified 70/30 split with seed 7 and five poisoning seeds per row.

Part 1 flips a share of training labels to a random other class. Part 2 stamps a 2x2 patch in the bottom-right corner of randomly chosen training images from other classes and relabels them 0. The listing leaves out the code that averages the five seeds and prints the table.

import numpy as np
from sklearn.datasets import load_digits
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import train_test_split

TARGET = 0

def stamp(X):
    """Set the 2x2 bottom-right pixels to 16."""
    X = X.copy().reshape(-1, 8, 8)
    X[:, 6:8, 6:8] = 16.0
    return X.reshape(-1, 64)

def flip_labels(y, rate, rng):
    y = y.copy()
    n = int(round(rate * len(y)))
    idx = rng.choice(len(y), size=n, replace=False)
    for i in idx:
        others = [c for c in range(10) if c != y[i]]
        y[i] = rng.choice(others)
    return y, n

X, y = load_digits(return_X_y=True)
Xtr, Xte, ytr, yte = train_test_split(
    X, y, test_size=0.3, random_state=7, stratify=y)
# part 1: flip a share of training labels
# (seeds 0 to 4)
for rate in (0.0, 0.05, 0.10, 0.20, 0.40):
    accs = []
    for s in (0, 1, 2, 3, 4):
        rng = np.random.default_rng(s)
        yp, n = flip_labels(ytr, rate, rng)
        m = LogisticRegression(max_iter=5000)
        accs.append(m.fit(Xtr, yp).score(Xte, yte))

Xte_trig = stamp(Xte[yte != TARGET])

# part 2: stamp n training images from other
# classes and relabel them 0 (seeds 0 to 4)
for rate in (0.0, 0.01, 0.03, 0.05):
    for s in (0, 1, 2, 3, 4):
        rng = np.random.default_rng(s)
        cand = np.flatnonzero(ytr != TARGET)
        n = int(round(rate * len(ytr)))
        idx = rng.choice(cand, size=n, replace=False)
        Xp, yp = Xtr.copy(), ytr.copy()
        Xp[idx] = stamp(Xp[idx])
        yp[idx] = TARGET
        m = LogisticRegression(max_iter=5000)
        m.fit(Xp, yp)
        clean = m.score(Xte, yte)
        asr = (m.predict(Xte_trig) == TARGET).mean()

The run printed:

data poisoning demo, sklearn digits
python 3.14.6  sklearn 1.9.1  numpy 2.5.5
train 1257 images, test 540 images
model: LogisticRegression; split seed 7

1) label flipping (mean of 5 seeds)
 flipped  labels  test acc        min-max
     0%       0     96.5%    96.5%-96.5%
     5%      63     87.1%    83.1%-91.1%
    10%     126     89.9%    88.3%-92.0%
    20%     251     87.2%    86.5%-88.1%
    40%     503     82.6%    80.2%-84.3%

2) backdoor: 2x2 patch -> class 0 (5 seeds)
triggered test images: 486 (true class not 0)
poisoned  images  clean acc     ASR
     0%       0      96.5%    0.2%
     1%      13      96.4%   87.0%
     3%      38      96.0%   93.7%
     5%      63      96.3%   96.6%

ASR = triggered test images predicted as 0
one model type, 8x8 images: a small demo,
not a measurement of any production model
  • Label flipping shows in accuracy - flipping 40% of training labels lowered test accuracy from 96.5% to 82.6%, though not in a straight line. The 5% runs averaged 87.1%, below the 10% runs, and ranged from 83.1% to 91.1% across seeds.
  • The backdoor does not - 13 stamped images, 1% of the training set, made the model call 87.0% of triggered test digits a 0. Clean test accuracy stayed at 96.4%, against 96.5% with no poison.
  • The control row - with no poisoned images, the patch alone moved 0.2% of triggered digits to 0, so the poisoned training images cause the effect.
  • The limit of the run - one linear model on 8x8 images shows why accuracy monitoring misses a backdoor; it says nothing about the rates for a language model.

How to Prevent Data Poisoning

Prevention means knowing where every training and retrieval input came from and controlling what reaches a training run. OWASP and ATLAS list overlapping controls:

  • Record data origins - OWASP's 2025 entry says to "Track data origins and transformations using tools like OWASP CycloneDX or ML-BOM." ATLAS M0023 says to "Record training and fine-tuning dataset identities, versions, and relationships to derived models and deployed applications."
  • Version every dataset - OWASP names data version control (DVC) "to track changes in datasets and detect manipulation," which also gives you a known-good version to roll back to.
  • Verify before training - ATLAS M0014 says to "Verify training datasets and annotations against protected manifests before training," which catches content that changed after the manifest was written.
  • Sanitize and quarantine - ATLAS M0007 says to "Screen training samples, labels, annotations, and metadata for poisoning. Quarantine and remediate affected data before training."
  • Validate feedback before it trains - user ratings, corrections and conversation logs go through the same checks as any other source before a continuous learning pipeline ingests them.
  • Treat model files as code - review chat templates, tokenizer configs, adapters and quantized weights the way you review code. Load model files from shared repositories only after checking them, given the pickling risk above.

Filtering alone does not close the gap. Wan et al. found that "defenses based on data filtering or reducing model capacity provide only moderate protections while reducing test accuracy," so pair it with provenance and the detection checks above.

Runtime AI guardrails filter inputs and outputs after training, so they cannot remove a behavior ATLAS says may persist in the trained model. They can still limit what a poisoned RAG answer does in production, as a second layer behind clean data. When the planted text is an instruction rather than a fact, the guide on how to prevent prompt injection covers controls that limit what a fooled agent can do.

Testing an Agent Before and After a Data Change With Agent Assurance

Agent Assurance, the TestMu AI product for agents that act, does not inspect a training set, scan a retrieval corpus or search model weights for a backdoor, and it has no scenario category for poisoning. It tests your agent, not the model underneath it, and it is not a fine-tuning tool.

Its runs happen before release, and it blocks nothing in production, so the provenance and screening controls above stay your job. What it can catch is a behavior change that a data change causes in an agent you ship.

  • Two profiles, one agent - an agent can have several profiles, which is how Rook CLI compares two configurations of the same agent. Point one at the agent on the current model or retrieval corpus and one at the candidate fine-tune or new corpus, as described in profiles and hooks, and run the same suite on both.
  • The run-over-run result - run the two profiles one after the other. The report then gives the pass-rate change between those last two runs, the scenarios that newly fail and the ones that were fixed, with changed definitions marked. Because the hosted Runs page lacks a side-by-side view, open both runs and compare the version, profile revision and selected scenarios of each.
  • Effects on records - when a poisoned fact leads the agent to change a record wrongly, the run shows a Fail on that record change itself.
  • Trigger coverage - a backdoor surfaces only if a scenario happens to contain its trigger, so a run that passes is not proof of a clean model. Separately, a criterion the run could not check is reported as Unable to Verify, not a guessed Pass.

The npm package below wants Node.js 20 or later. Installing Rook CLI with Homebrew or the shell script works without Node, and setting up the coding-agent skill package (npx @testmuai/rook-skill) takes Node.js 22 at minimum.

npm install -g @testmuai/rook@latest

The 14-day free trial, which carries 4,000 credits and Pro plan features, begins when you press Start Trial in the Agent Assurance web app; paid tiers are listed on the pricing page.

Start a 14-day free trial of Agent Assurance by TestMu AI, with 4,000 credits, to test how your AI agents behave across workflows, tools, and actions

What Is the First Step in Defending Against Data Poisoning?

List every source that feeds a model you ship, including scraped web data, labeling work, fine-tuning sets, retrieval indexes and downloaded model files, and write down who can change each one. Then add a fixed evaluation set and a trigger probe to every retraining run, so a change in behavior shows up before release.

OWASP's 2026 entry now lists chat templates, adapters and quantization artifacts as security-relevant code, so the inventory covers model files as well as datasets. For agents built on those models, the Agent Assurance documentation shows how to set up a before-and-after comparison.

To run your first test, install Agent Assurance with npm install -g @testmuai/rook@latest, or
for a full walkthrough of the product.
Note

Note: Anubhav Singhmaar, AI Product Manager at TestMu AI with expertise in agentic AI and large language models, reviewed, fact-checked, and approved this article, which was researched and drafted with AI assistance. Our editorial process and AI use policy describes how every claim is verified before publication. Vipul Verma (Group Senior Vice President of Engineering, TestMu AI) checked the technical content. The sources are OWASP, NIST and MITRE ATLAS publications, the original research papers, Microsoft's account of the Tay incident and TestMu AI's product documentation.

Author

...

Anubhav Singhmaar

Blogs: 69

  • Linkedin

Anubhav Singhmaar is an AI Product Manager at TestMu AI driving Kane CLI, the command-line tool that brings browser automation to the terminal, turning natural-language flows into runs in a real Chrome browser that return pass or fail with shareable proof. He owns the roadmap and prioritization and works with engineering to ship developer-facing features. Before TestMu AI, he spent over four years at Sprinklr owning enterprise voice AI across APAC and EMEA. A mechanical engineer turned product manager, he grounds guidance in real QA workflows.

Reviewer

...

Vipul Verma

Reviewer

  • Linkedin

Vipul Verma is Group Senior Vice President of Engineering at TestMu AI, where he heads the entire engineering organization that builds KaneAI, HyperExecute, and the broader testing cloud. He brings 15+ years architecting, securing, and scaling large enterprise applications across multiple sites. Before TestMu AI he was India Head at LogicHub, where he built the India R&D site from the first employee to a 30-plus engineering team, and Principal Software Engineer at Sumo Logic, where he was the first engineer in the India office and shipped search-performance and pricing-model initiatives. Earlier he worked on trading platforms at Portware and D. E. Shaw. Vipul holds a B.Tech in Computer Science from IIT Kharagpur.

Add to Google preferred sources

Summarise with AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

Data Poisoning FAQs

Did you find this page helpful?

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests