Zenaique

Contrast LLM03 training data poisoning with LLM01 prompt injection

Flashcard·Medium·4.0 · 0·~30s·Asked atCognizantNotionTcs
Attempt it
TL;DR

Poisoning (LLM03) modifies the weights via tainted training data; injection (LLM01) manipulates a fixed model at inference. Defences are disjoint: data-pipeline integrity vs runtime input/output rails.

Memory aid
Sign in to see the mnemonic that makes this stick.
Easy to grasp

Imagine two ways to corrupt a teacher. The first: sneak misinformation into the textbooks they used to study, years before any class begins. Now everything they teach is subtly slanted, and no quiz in the moment will catch it because the teacher is teaching what they sincerely believe. The second: walk into class and try to confuse the teacher in real time with a tricky question. A vigilant teacher might catch the trick. The first attack is poisoning: it shipped inside the teacher. The second is injection: it arrives at the door. The defenders are different people, one runs the publisher, the other stands at the door, and a defence at one layer cannot catch the other.

Concept explanation~2 min read

Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.

OWASP's LLM Top 10 catalogues the most consequential security risks for LLM applications, and two of its categories, LLM01 (prompt injection) and LLM03 (training-data poisoning, sometimes numbered LLM04 depending on the year's revision), are frequently confused. The confusion has real cost: teams over-invest in runtime input/output rails as if they were a complete defence, while leaving the training-data supply chain exposed. A clear architectural distinction between the two categories, and between their respective defence stacks, is foundational for any LLM-security posture.

This walkthrough establishes the lifecycle split, names the concrete poisoning vectors, explains why runtime rails cannot catch poisoning, and outlines the data-pipeline defences that can. Real demonstrations like PoisonGPT, Carlini's web-scale poisoning, and Anthropic's Sleeper Agents anchor the discussion in observed attacks rather than theoretical ones.

Mental model: poisoning ships inside the weights and runs as the policy. Injection arrives at inference time and runs against the policy. The defenders are different teams with different tools.

The lifecycle split

Where each attack happens

LLM03 (poisoning) happens during the data and training phase, before any user request exists. The attacker influences the data the model learns from, so the malicious behaviour gets encoded into the weights. By the time the model is deployed, the attack is already inside.

LLM01 (injection) happens at inference time, against a fixed model. The attacker crafts a request, or arranges for malicious content to appear in retrieved context, that manipulates the model's behaviour for that specific request or session.

How the attack manifests

A poisoned model emits the malicious behaviour whenever its trigger pattern appears, with no further attacker action required. The model 'sincerely' produces the unsafe output because, from its weights' perspective, that is the right answer.

An injected request manipulates the model only for the duration of that request. Other requests, before or after, are unaffected. The model's weights are unchanged.

Operational consequence

Incident-response playbooks differ. An injection incident is contained by patching the rail, adding the new pattern to the input classifier's training set, and the system is safe again. A poisoning incident may require rolling back to an earlier model version, re-evaluating every fine-tune since the suspected poisoning entry point, and rebuilding the affected data lineage. The blast-radius of a confirmed poisoning incident is dramatically larger.

Why both belong on OWASP's list

Both attacks degrade the safety properties of the LLM application. They are categorised separately because their defences live at different layers and require different teams. A single 'LLM safety' category would conflate two problems that have nothing operationally in common.

Concrete poisoning vectors
Why runtime rails cannot defend against poisoning
The data-pipeline defence stack
Sign in to unlock the full deep dive.

Situations where this technique stops working.

Sign in to see when this approach fails.

2–4 min · Everything important, quickly.

Sign in to see the quick scan of the deep dive.

Real products, models, and research that use this idea.

  • PoisonGPT (Mithril Security, 2023) demonstrated uploading a backdoored model fork to Hugging Face with a controlled misinformation trigger.
  • Carlini et al. (2023-2024) showed industrial-scale web-crawl poisoning via expiring domains in Common Crawl snapshots.
Sign in to see more production examples.

What an interviewer would ask next. Try answering before peeking at the approach.

QHow would you build a behavioural eval suite that hunts for backdoors?
A

Generate a large set of random rare phrases (high-entropy triggers an attacker might use) and probe each one with off-policy requests. Flag any trigger that consistently shifts refusal rate. Combine with activation-clustering on the model's internal representations: backdoored examples often cluster anomalously.

2 more follow-ups an interviewer would ask next. Sign in to reveal them.

Red flags & common mistakes

The phrases that signal junior thinking. Click to expand.

Most common mistake

Believing runtime guardrails defend against poisoning. A poisoned model passes its own runtime checks because the malicious behaviour looks intentional from the inside.

Sign in to see all red flags and common mistakes.

60 second bullets to scan on the way to the call.

  • The lifecycle distinction (training vs inference) between the two categories

  • Concrete poisoning vectors (pretraining, fine-tuning, RLHF, third-party models)

Sign in to unlock the revision sheet.

Primary sources. Browse if you want the original framing.

Similar questions

Same topic, related formats. Practice these next.

4 curated
Next question
Pick the strongest reason…
MCQ·Medium