0000 · 0000

Dappasol / Guides

Updated June 2026

Prompt Injection and the OWASP LLM Top 10

Prompt injection is the number one risk in the OWASP Top 10 for LLM applications. You cannot fully patch it, so you defend in depth: never trust model output as a command, separate instructions from user data, constrain tools and permissions, and validate everything the model touches.

The moment your app sends text to an LLM and acts on what comes back, you own a new attack surface. Classic web security never covered it. The OWASP Gen AI Security Project keeps a Top 10 just for LLM apps because these failure modes are not the ones your scanner already knows. This guide walks the full 2025 list, then goes deep on the one that sits at number one and shows up in nearly every real incident: prompt injection.

The OWASP Top 10 for LLM applications (2025)

Here is the current list from the OWASP Gen AI Security Project. Plain-language description for each, plus a one-line defense. Treat the defenses as where you start, not the whole control set.

CategoryWhat it isOne-line defense
LLM01 Prompt InjectionCrafted input that overrides or hijacks the model’s instructions, directly or via content it reads.Separate instructions from data; never treat model output as a trusted command.
LLM02 Sensitive Information DisclosureThe model leaks secrets, PII, or proprietary data through its output.Minimize what the model can access; filter and redact inputs and outputs.
LLM03 Supply ChainCompromised models, datasets, plugins, or dependencies in the LLM stack.Vet and pin model and component sources; track provenance and integrity.
LLM04 Data and Model PoisoningTampered training, fine-tuning, or embedding data that corrupts behavior.Control and verify data sources; isolate and validate training pipelines.
LLM05 Improper Output HandlingModel output passed downstream without validation, enabling injection (XSS, SQL, command).Treat output as untrusted; encode, validate, and sanitize before use.
LLM06 Excessive AgencyThe model has too much autonomy, permission, or access to tools and actions.Least privilege; gate high-impact actions behind human approval.
LLM07 System Prompt LeakageSystem prompts exposing secrets or logic that should not be relied on for security.Keep no secrets in the system prompt; enforce controls outside the model.
LLM08 Vector and Embedding WeaknessesFlaws in RAG vector stores and embeddings, including poisoning and leakage across tenants.Access-control the vector store per tenant; validate retrieved content.
LLM09 MisinformationConfident but false or fabricated output that users or systems then trust.Ground in verified sources; require citations and human review for high stakes.
LLM10 Unbounded ConsumptionUncontrolled inference cost or resource use, including denial-of-wallet attacks.Rate-limit, cap tokens and spend, and monitor usage per user.

Prompt injection, the number one risk

Prompt injection is when input talks the model into ignoring your instructions and following an attacker’s instead. The model reads your system prompt and the incoming text as one undifferentiated stream of tokens, so it has no reliable way to tell “rules from the developer” apart from “text from a stranger.” That is the root of it, and that is why it sits at the top of the list.

Direct vs. indirect injection

Why it cannot be fully patched

No input filter cleanly splits “legitimate instruction” from “malicious instruction,” because to the model they are the same thing: natural language. Attackers have endless ways to phrase, encode, translate, or hide a payload, and the model is built to be flexible about how it reads them. You can lower the rate of successful attacks. You cannot assume you killed them. So stop thinking “block the bad prompt.” Start thinking “assume the prompt eventually wins, and make sure winning does not let it do anything dangerous.”

Defense in depth

You cannot stop injection at the door, so you contain the blast radius everywhere else.

If your app calls an LLM, do this

A pre-launch checklist for any feature that sends text to a model and acts on the response. Run it in order.

  1. Treat all model output as untrusted input. Validate and encode it before it reaches SQL, a shell, the browser DOM, or another service.
  2. Separate and delimit untrusted text. Mark user and retrieved content as data, never mix it into the instruction channel, and assume retrieved documents may contain injected instructions.
  3. Apply least privilege to tools and data. The model should only reach the data and actions a given user is allowed to reach, enforced server-side, not by the prompt.
  4. Put a human in the loop for high-impact actions. Payments, deletions, outbound messages, and permission changes need a deterministic gate or explicit approval.
  5. Keep secrets out of prompts and enforce auth in code. Access control lives in your application, not in the system prompt.
  6. Access-control your RAG and vector store per tenant. Make sure one user cannot retrieve another user’s embedded data.
  7. Cap consumption. Rate-limit requests, cap tokens and spend per user, and alert on anomalies to blunt denial-of-wallet abuse.
  8. Log, monitor, and red-team. Watch inputs and outputs for abuse patterns and probe your own app with adversarial prompts before attackers do.

If you build with AI coding tools too, the same untrusted-by-default mindset applies to the code itself. See our guide on the OWASP Top 10 for vibe-coded apps, the practical sequence for how to audit AI-generated code for security, and the background on AI-generated code security risks.

Want us to run this audit for you?

We do a free 15-minute build audit: you show us your AI-built app, we tell you the specific security and production gaps and what it takes to fix them. No obligation.

Book your free build audit

FAQ

What is prompt injection?

Prompt injection is an attack where crafted input convinces an LLM to ignore the developer's instructions and follow an attacker's instructions instead. The model reads your rules and the incoming text as one stream of tokens, so it cannot reliably tell trusted instructions apart from untrusted data.

Why is prompt injection number one in the OWASP LLM Top 10?

It sits at LLM01 because it is the most common and most fundamental LLM risk, it has no complete fix, and it is the entry point for many other failures like data leakage and unauthorized actions. The OWASP Gen AI Security Project ranks it first in the 2025 list.

What is the difference between direct and indirect prompt injection?

Direct injection is when the user types the malicious instruction themselves. Indirect injection is when the instruction hides inside content the model fetches and reads, like a web page, PDF, email, or RAG document, so the user never sees it but the model obeys it anyway.

Can prompt injection be fully prevented?

No. No input filter cleanly separates legitimate from malicious natural-language instructions, so you cannot assume injection is gone. You defend in depth instead: treat model output as untrusted, separate instructions from data, constrain tools and permissions, and validate everything the model touches.

Book a free 15-min build audit →