OWASP Top 10 for LLM apps: a practical guide
The OWASP Top 10 for LLM apps lists the main AI risks, led by prompt injection and data leakage. Here is what each one means for a SaaS team and how to test it.
The OWASP Top 10 for LLM applications is a list of the most important security risks in products built on large language models. Prompt injection comes first, followed by sensitive information disclosure, supply chain risk and improper output handling. For a SaaS team, the practical lesson is simple: treat the model as an untrusted user, and limit what it can see and do.
In short
- The list covers ten risks, from prompt injection to unbounded resource use.
- Most real-world damage comes from three: prompt injection, data leakage and excessive agency.
- You cannot fully stop prompt injection, so design so a successful injection does little harm.
- Retrieval over customer data needs the same tenant checks as the rest of your app.
- Test with an authorised, written scope, the same way you would test any other feature.
What is the OWASP Top 10 for LLM applications?
OWASP, the Open Worldwide Application Security Project, publishes community-written lists of the most common security risks in software. The classic OWASP Top 10 covers web apps. The LLM list covers what changes when part of your product is a language model that reads untrusted text and can trigger actions.
The current list, published for 2025, contains these ten risks:
| ID | Risk | What it means in plain words |
|---|---|---|
| LLM01 | Prompt injection | Text from a user or a document changes what the model does |
| LLM02 | Sensitive information disclosure | The model reveals data the user should not see |
| LLM03 | Supply chain | Risky models, datasets, plugins or libraries |
| LLM04 | Data and model poisoning | Tampered training or retrieval data skews the output |
| LLM05 | Improper output handling | Model output is used unsafely, for example as HTML or SQL |
| LLM06 | Excessive agency | The model can call tools or take actions beyond what it needs |
| LLM07 | System prompt leakage | Hidden instructions, and any secrets in them, get exposed |
| LLM08 | Vector and embedding weaknesses | Flaws in retrieval let data cross tenants or be manipulated |
| LLM09 | Misinformation | Confident but wrong output that users rely on |
| LLM10 | Unbounded consumption | Abuse that runs up cost or takes the feature down |
The rest of this guide covers what each one looks like in a typical SaaS product and what to do about it.
How does prompt injection work, and how do you defend against it?
Prompt injection happens when text the model reads is treated as instructions. Direct injection is a user typing “ignore your previous instructions”. Indirect injection is more dangerous: the instruction hides in a document, an email, a support ticket or a web page that your feature retrieves and passes to the model.
Imagine an AI assistant that summarises support tickets and can update ticket status. An attacker submits a ticket containing hidden text telling the model to close every open ticket. If the model has the tool and nothing checks its decision, it may do exactly that.
You cannot filter your way out of this reliably. Defend in layers instead:
- Limit tools. Give the model only the actions it needs, with the narrowest permissions.
- Act as the user. Tool calls should run with the requesting user’s permissions, never a service account with access to everything.
- Require approval for destructive or external actions such as deleting data, sending email or making payments.
- Mark untrusted content. Keep retrieved text separate from your instructions, and tell the model it is data.
- Log everything. Record prompts, retrieved context, tool calls and outputs so you can investigate.
How do LLM features leak sensitive data?
Sensitive information disclosure and vector and embedding weaknesses often show up together in retrieval-augmented generation (RAG). The feature searches a vector store for relevant documents and passes them to the model. If the search does not filter by tenant and permission, one customer’s question can pull another customer’s documents into the answer.
Check these points in any RAG feature:
- Every retrieval query filters by tenant and by the user’s permissions, enforced on the server.
- Embeddings for different customers are separated, or filtered with metadata that cannot be spoofed.
- Personal data is minimised or redacted before it reaches the model.
- The model provider’s data retention and training settings match what you promise customers.
- No API keys, internal URLs or credentials appear in the system prompt, since system prompts can leak.
This is the same tenant isolation problem as the rest of your app, just in a new place. A penetration test that covers access control should cover your AI features too.
Why is improper output handling dangerous?
Model output is user input in disguise. If you render it as HTML, insert it into a SQL query, pass it to a shell or use it to build a URL, an attacker who controls the model’s input can inject into those places. Classic bugs such as cross-site scripting and server-side request forgery come back through the model.
The fix is familiar: encode output for the context where it is used, use parameterised queries, validate structured output against a schema, and never let the model build commands or URLs that run without checks.
What is excessive agency in AI agents?
Excessive agency means the model can do more than its job requires. An agent that only needs to read calendar events but holds a token that can also delete them is one injection away from deleting them. The risk grows with every tool and permission you add.
| Design choice | Higher risk | Lower risk |
|---|---|---|
| Tool permissions | One broad service token | Scoped tokens per tool, per user |
| Actions | Model acts directly | Model proposes, user or rule approves |
| Data access | Model can query anything | Server enforces user’s permissions on every call |
| Output use | Rendered or executed as is | Encoded, validated and checked against a schema |
| Monitoring | No logs | Every prompt, tool call and output logged |
How do you handle supply chain, poisoning and cost risks?
The remaining risks are less dramatic but still matter.
Supply chain and model poisoning
Pin and review the models, libraries and plugins you depend on, the same way you manage other dependencies. Download open models only from trusted sources and verify checksums. If users or third parties can add content to your retrieval index, assume some of it will be malicious and filter it before indexing.
Misinformation
Models can be confidently wrong. For anything with consequences, such as legal, financial, medical or security advice, show sources, add clear wording that answers may be wrong, and keep a human in the loop.
Unbounded consumption
AI calls cost money per token. Without limits, an attacker can run up your bill or exhaust your quota. Set per-user and per-tenant rate limits, cap input and output length, and alert on unusual spend.
How should a SaaS team test its LLM features?
Treat the AI feature as part of your application, not a black box. A practical test plan looks like this:
- Map the feature. List every input, retrieval source, tool, permission and place the output is used.
- Try direct injection. Attempt to override instructions, extract the system prompt and trigger unintended tools.
- Try indirect injection. Plant instructions in documents, tickets or pages the feature will read.
- Test tenant isolation. As one customer, try to retrieve or infer another customer’s data.
- Test output handling. Push the model to produce HTML, SQL, URLs or commands and see where they land.
- Test abuse limits. Check rate limits, input length caps and cost alerts.
Do this only on systems you own or are authorised to test, under a written scope. We run this kind of work as AI and LLM security testing, with fixes delivered as code changes.
Where does this fit with your other security work?
Enterprise buyers increasingly ask how AI features handle their data, so your answers here end up in security questionnaires. If you are budgeting for testing, our guide to penetration test costs in 2026 includes typical ranges for LLM feature tests, and current Ironward prices are on the pricing page.
Test your AI feature before your customers do
Shipping a chat assistant, copilot or agent? Tell us what it can read and what it can do, and we will reply within one business day with a written scope for an authorised test. Get in touch.
Quick answers
What is the biggest security risk in LLM applications?
Prompt injection is listed first because it is common and hard to prevent: text from a user, a document or a web page can override the instructions you gave the model. Its impact depends on what the model can see and do.
Can prompt injection be completely prevented?
Not with current techniques. The practical approach is to limit the data and tools the model can reach, treat its output as untrusted, require approval for risky actions and log every call.
Does using a major model provider make my AI feature secure?
No. The provider secures the model and its infrastructure. Your prompts, retrieval, tool permissions, output handling and tenant isolation are your responsibility, and that is where most real issues appear.
How do you test an LLM feature for security issues?
Map every input, data source, tool and output, then attempt direct and indirect prompt injection, cross-tenant data access, unsafe tool calls and output injection, all within an agreed, authorised scope.