OWASP LLM04

LLM04 Data and Model Poisoning: Protecting Training and RAG Content

OWASP LLM Top 10 · 2025 edition · Updated 25 November 2026 · Independent educational guide

New to LLMs, classifiers or RAG? Read the beginner FAQ and terminology.

Building an action-taking agent? Read the full agent runtime security guide for execution-time boundaries, safe tests and OWASP mapping.

Read the dated field-test post.

What is data & model poisoning in LLM applications?

Data and model poisoning manipulates the content a model learns from or retrieves, so it produces biased, false or attacker-controlled output. For most apps the practical risk is poisoned retrieval (RAG) content and fine-tuning data. Validate sources, control who can add content and monitor for unexpected behaviour changes.

Can my RAG knowledge base be poisoned?

Yes. If users, partners or scraped web pages can add documents, an attacker can plant false facts or hidden instructions that the model later retrieves and repeats. Poisoned retrieval content can also carry indirect prompt injection. Restrict who can write to the knowledge base and record where each document came from.

How do I validate content before ingestion?

Check the source is trusted, record provenance, strip hidden text and markup, and scan for instruction-like phrases. For larger pipelines, sample new content for human review and compare model behaviour before and after updates. Keep the ability to remove a document and rebuild affected embeddings quickly.

How do I audit my app for OWASP LLM04?

List every path that adds data to training sets or retrieval indexes. Confirm each has access control, provenance tracking and validation. Test a planted false document in a staging environment to see whether the model repeats it, and confirm you can trace and remove it.

What does this OWASP LLM risk look like in practice?

Illustrative scenario: An untrusted contributor adds a false policy document to a retrieval knowledge base.

How can I test it safely?

Add a clearly marked fictional poisoned document to a staging-only index. Check source validation and reviewer controls, then confirm the document can be traced, removed and excluded from future retrieval.

What evidence should I keep?

Record provenance, ingestion review decisions, affected answers and the successful removal/re-indexing check.

LLM04 audit checklist

Control to consider: Ingestion validation. Some controls run outside the request path; model inline checks, then measure your own deployment.

General guidance only, written with AI assistance and human oversight. Verify against your own system and the official OWASP project before relying on it.

Sources and scope

Examples and checklists are our explanatory guidance, not an official OWASP audit, endorsement or a test of your application. Calculator values are modelled assumptions, not detector benchmarks.

Other OWASP LLM risks