Skip to content

Search

Articles, tools, solutions and knowledge base guides

Start typing to search across articles, tools and apps.

OWASP Top 10 for LLM Applications: how to secure AI applications

Security in an application powered by a large language model (LLM) depends on the entire system, not just the model’s resistance to unwanted instructions. Models can read documents, generate content, invoke tools and influence decisions. This guide explains the current OWASP classification, controls at trust boundaries and practical acceptance tests for chatbots, retrieval-augmented generation (RAG) systems and AI agents.

Published Written by Reading time 15 min read
On this page Contents: quick navigation between sections

What is the OWASP Top 10 for LLM applications?

OWASP risk identifiers across both editions
Category 2026 identifier 2025 identifier
Prompt Injection LLM01 LLM01
Sensitive Information Disclosure LLM02 LLM02
Excessive Agency LLM03 LLM06
Supply Chain LLM04 LLM03
Data and Model Poisoning LLM05 LLM04
Unbounded Consumption LLM06 LLM10
Misinformation LLM07 LLM09
Hidden Context Exposure LLM08 LLM07 (System Prompt Leakage)
Vector and Embedding Weaknesses LLM09 LLM08
Improper Output Handling LLM10 LLM05

The OWASP GenAI Security Project identifies major risks arising when generative models are integrated into software. This article uses the 2026 edition, which reorders the 2025 categories and expands System Prompt Leakage into Hidden Context Exposure. Always attach the edition to a risk identifier in audit reports and requirements. [1][2]

The list is not a probability ranking for every product or a complete verification standard. A chatbot, a document search system and an agent capable of financial transactions have different trust boundaries. Apply conventional OWASP ASVS requirements alongside it, and consult the OWASP Top 10 for Agentic Applications and Agent Control Standard (ACS) for autonomous systems. [13][14][15]

The acceptance tests in this guide are original defensive examples, not official OWASP requirement identifiers. Run them in an authorized environment with synthetic data. A refusal from the model is insufficient evidence; inspect the application’s actual behavior.

LLM01: Prompt Injection

Risk: instructions embedded in user input or retrieved content can alter the intended task. Direct injection originates in a user message; indirect injection can arrive through email, a web page, a file, an image or a tool response. A manipulated model need not obtain any new privileges to cause damage. [3]

Controls: label the provenance of content, minimize context and distinguish data from instructions, but do not assume the model reliably respects that boundary. Avoid combining unrestricted private data access, untrusted content and arbitrary external communication. Authorize every tool invocation on the server and constrain recipients, objects and operations. Input screening can detect suspicious content but cannot prove safety. [3][14]

Acceptance test: place a conflicting instruction in a synthetic document asking the system to transfer test data outside its organization. Cover multiple languages and file formats. No unauthorized tool invocation or transfer should occur even if the model fails to recognize the manipulation. Inspect the execution record rather than merely the answer.

Distinguish manipulation of the current task from persistence of instructions in memory. A support ticket might alter the goal of a summary, while storing its content as an agent preference could affect later sessions. Treat memory writes as separate operations subject to scope, provenance and retention controls. Test whether content from a prior session can alter the rules of the next task. Jailbreaking is a subset of prompt injection aimed at bypassing model safety restrictions; not every instruction manipulation is a jailbreak. [3][7][14]

LLM02: Sensitive Information Disclosure

Risk: private data can escape through answers, retrieved excerpts, tool arguments, telemetry, caches or diagnostic exports. An over-permissive knowledge source can cause leakage without any malicious instruction. [4]

Controls: classify and minimize data, isolate tenants and authorize access before sending content to the model. Never include API keys or session tokens in prompts. Determine retention, training use and subprocessors from the actual service configuration and contract. Restrict exports, traces, provider-exposed reasoning information and error reports. Output redaction is a secondary safeguard, not a substitute for controlling access. [4][16]

Acceptance test: create two tenants, each with a unique synthetic marker. Check retrieval, responses, attachments, cache entries, exports and logs accessible to the other tenant. Require absence of unauthorized data and evidence that document deletion and permission revocation reach derived indexes and caches within the defined policy.

Maintain lineage from source document to chunk, embedding, cache, backup and export. Associate derived records with source identity and retention policy. Revocation must prevent further exposure even before physical deletion completes. OWASP GenAI Data Security Best Practices v2 covers data lifecycle governance and the protection of RAG and training pipelines in separate parts. [20][21]

LLM03: Excessive Agency

Risk: a model can propose a syntactically valid but unauthorized action, such as changing an order. Unnecessary functionality, excessive permissions and insufficient approval are separate root causes. Even ordinary model errors may have expensive consequences. [5]

Controls: provide narrowly scoped business operations instead of a general administrative tool. Derive user and tenant identity on the server, not from model output. Use short-lived credentials and read-only access where sufficient. Require authorized approval of consequential writes; bind approval to the exact operation, parameters and recipient. Recheck its validity and permissions just before execution. [5][14][15]

Acceptance test: a legitimate request succeeds once; an out-of-scope request, a request with revoked approval and a duplicate delivery do not create an unauthorized or duplicate write. Use idempotency keys and inspect the target system. Stopping an agent cannot automatically undo an operation already completed.

MCP (Model Context Protocol) does not make a tool trustworthy. With OAuth, verify token audience, scopes, validity and identity binding; do not pass an incoming MCP token directly to another service. Enforce egress policy during metadata discovery and redirects too. Bind consent to the client and operation when needed. Negative test: a token issued for another resource must be rejected. [17]

Bind approval to immutable operation parameters, the approver identity, tenant, expiry and task identifier. Changing the recipient or amount requires fresh approval. An idempotency key is not authorization: bind it to the operation scope and parameters, and persist the write state and outcome with concurrency protection. Test simultaneous retries and lost responses after successful writes. If the external service does not guarantee idempotency, do not promise exactly-once execution; reconcile its state before retrying. [5][15]

LLM04: Supply Chain

Risk: models, adapters, tokenizers, inference libraries, containers and third-party tools can contain vulnerabilities, be modified or originate from an incorrect source. Hosted providers are also part of the supply chain even without local model weights. [6]

Controls: inventory model and API versions, dependencies, licenses and artifact provenance. Pin versions and verify signatures or checksums against trusted records. Prefer weight formats that do not execute code when loaded, while auditing parsers and dependencies. Do not execute untrusted repository code in production. Review MCP server and tool-description changes and restrict the credentials they receive. [6][17]

Acceptance test: substitute a test artifact with an invalid checksum and introduce an unapproved tool-description change. Deployment must reject both. Demonstrate that a model release can be rolled back or a provider disconnected without expanding privileges.

Extend the SBOM (software bill of materials) with an inventory of models, adapters, datasets and lineage (AI-BOM). A valid signature establishes provenance within a trust model, not freedom from vulnerabilities. If a hosted provider can change a model behind a stable name, monitor behavior and maintain independent regression tests. [6][20]

LLM05: Data and Model Poisoning

Risk: tampered training data, fine-tuning datasets or source documents can persistently alter system behavior. RAG knowledge can be corrupted without retraining a model. This differs from a transient malicious instruction or an ordinary factual error. [7]

Controls: separate document ingestion from publication into trusted knowledge; record provenance, author, version, validity period and approval. Keep evaluation sets separate from training data. Evaluate new models and indexes on independent cases, including rare and high-impact cases. Never automatically promote user feedback into trusted policy. [7][16]

Acceptance test: an unapproved document contradicting the refund policy cannot become authoritative knowledge. Updating an approved document requires a new version. After rollback, verify the previous behavior and remove invalid derived entries. Maintain regression data independently of ingestion.

LLM06: Unbounded Consumption

Risk: a single task can fan out into many model calls, expensive reasoning, large-file processing and external operations. Request-rate limits alone do not control cost, elapsed time or concurrency. Availability, budgets and model intellectual property are at risk. [8]

Controls: cap input size before processing, tokens, steps, retries, execution time and parallelism. Define per-user, tenant and task budgets; reserve estimated cost before starting a call, including external services. Support cancellation and reconcile actual usage. Provider billing alerts are not necessarily hard spending limits; enforce independent limits. [8]

Acceptance test: with an illustrative budget of 1 currency unit and a maximum estimated next operation of 0.40, two in-flight operations reserve 0.80 and the third is blocked. Test concurrent reservations, timeout and duplicate delivery. Cancellation must not release reserved funds before expensive work is confirmed stopped.

Distinguish denial of service (DoS) from denial of wallet, which exhausts the financial budget. Unusual query volumes can also indicate attempts to replicate a model. Account-level limits and anomaly detection reduce risk but do not guarantee protection of intellectual property. Include retries, reasoning tokens, image processing and downstream service calls in task-level cost. [8]

LLM07: Misinformation

Risk: a fluent answer may contain a nonexistent source, an incorrect amount or an obsolete rule. This is about factual credibility and downstream reliance, not output syntax. [9]

Controls: restrict answers to sources approved for the task, check document validity and scope, and verify that citations actually support claims. Delegate calculations, balances and business rules to deterministic services. Allow abstention or escalation when evidence is inadequate. RAG, lower temperature and a second model acting as judge cannot guarantee truth. [9][16]

Acceptance test: use questions with valid evidence, contradictory evidence and no answer in the corpus. Measure factual correctness, evidence coverage and appropriate abstention. For high-impact tasks, unverified answers must not automatically change system state. Define acceptance thresholds according to consequences, not an arbitrary benchmark score.

LLM08: Hidden Context Exposure

Risk: the broader category includes disclosure or reconstruction of internal instructions, tool schemas, refusal logic and context absent from the user interface. Leakage of personal data or credentials also belongs to LLM02. Knowing the instructions should not permit bypassing enforcement. [10]

Controls: keep secrets out of instructions; implement authorization, limits and acceptance rules outside the model. Supply only tool descriptions applicable to the current identity. Separate user-facing output from internal messages, metadata and diagnostics. Proprietary instructions may merit additional protection, but never treat a system prompt as a secure vault. [10]

Acceptance test: use a synthetic marker in confidential context and verify that it does not reach UI, exports or API responses. Separately assume a tester knows the entire system prompt and confirm unauthorized actions are still blocked. These checks measure different security properties.

LLM09: Vector and Embedding Weaknesses

Risk: semantic retrieval may expose another tenant’s records, suppress relevant evidence or leak information through result counts, similarity scores and timing. Embeddings are not automatically anonymous. Agent memory and semantic caches can share this risk. [11]

Controls: isolate indexes or enforce verified access filters within retrieval before unauthorized results are exposed; recheck every source document’s permissions. Do not rely solely on post-filtering a global top-k result set. Restrict raw vectors and scores; scope cache keys by tenant, permissions and index version. [11]

Acceptance test: create semantically similar documents in two tenants, revoke access to one and test from the moment access is revoked. Check for leakage of inaccessible identifiers, excerpts and metadata. Evaluate retrieval on queries with known expected documents, including after an embedding-model change.

Additional risks include reconstruction of information from vector representations (embedding inversion) and disruption of retrieval relevance. Protect index backups, diagnostics and exports like source documents. Measure retrieval relevance, coverage and stability after migrations. Full-text-only retrieval still needs source integrity and authorization, even though it lacks the same vector-specific attack surface. [11][21]

Revocation must take effect even before an asynchronous index update completes. Test immediately after revocation, during the update and afterwards, including existing sessions and caches. If current authorization cannot be established, deny retrieval. Distinguish removal from the source from deletion of chunks, vectors and derived copies under the retention policy; do not promise to retract information already delivered to a user. [11][20][21]

LLM10: Improper Output Handling

Risk: LLM output becomes input to a browser, database, file system or another executor. Well-formed JSON can still contain an unauthorized identifier, incorrect amount or unsafe text. Automatic image loading and link previews can cause unintended outbound connections. [12]

Controls: validate schema and values, verify business constraints and authorize independently. Use parameterized queries, context-specific encoding or suitable HTML sanitization; never execute arbitrary generated code. Disable automatic fetching of untrusted resources and constrain necessary connections at the network layer. Neutralize terminal and log control characters. Content Security Policy (CSP) adds protection but does not replace validation. [12][13]

Acceptance test: inject a synthetic well-formed response with an invalid identifier and markup intended as literal text into the integration boundary. Require rejected operations, safe rendering and no unexpected network activity. Check structure, semantics and side effects separately.

Unsafe web rendering can cause cross-site scripting (XSS), while concatenating model text into queries can cause SQL injection. When output directs server-side URL fetching, consider server-side request forgery (SSRF). Validate allowed destinations before every request, including redirect hops, block disallowed internal resources at the network layer and never fetch a URL merely because it is syntactically valid. [12][13][17]

Output schema validation, operation authorization and safe consumption are distinct controls. Valid JSON containing an invoice identifier does not grant access to that invoice, and permitted invoice text must not be interpreted as HTML. To mitigate SSRF, check the actual destination after DNS resolution and on redirects, account for IPv4 and IPv6, and enforce network restrictions. [12][13][17]

Architecture of a secure LLM application

Design trust boundaries as client → authenticated API → access and budget control → approved retrieval → model → output validation → action authorization → business service. Not every product needs write tools. The execution layer must reject disallowed operations regardless of the model or classifier response. [13][14][15]

Example: a support assistant may retrieve the signed-in customer’s order and draft a reply. Refunds are a separate operation: the server computes the amount and checks the order, permission and limit; an authorized person approves exact parameters. Record the operation identifier and check its outcome before retrying after a lost response.

The data owner approves knowledge sources, the backend enforces access and business rules, infrastructure isolates execution and networking, and security engineers own testing and incident handling. Prompts supplement these controls rather than replace them. ACS describes runtime policy enforcement, not an automatic compliance guarantee. [15]

OWASP Securing Agentic Applications V2 expands guidance on identity, access and runtime protection. A practical multi-agent requirement is a separate identity and explicit privilege scope for each agent; delegation must not expand privileges. Test delegation to an agent with broader access and ensure it cannot act outside the approved delegation scope. [22]

Design for unavailable control services: if authorization, budget accounting or approval services cannot respond, deny dependent privileged operations. Functions that require none of those permissions may continue in a restricted mode. Test loss of connectivity to each control service and verify that the application does not fall back to less restrictive rules. [13][15]

Testing, monitoring and incident response

Core controls and acceptance criteria
Risk Verification
LLM01 No unauthorized data transfer
LLM02 No cross-tenant access
LLM03 No unauthorized or duplicate writes
LLM04 Unapproved artifact rejected
LLM05 Unapproved source not published
LLM06 Budget enforced under concurrency
LLM07 Evidence-based answer or escalation
LLM08 Knowing the prompt cannot bypass authorization
LLM09 No inaccessible retrieval results
LLM10 Safe rendering and denial of disallowed actions

Maintain a risk register with edition, component, data flow, impact, safeguard, owner, test and evidence. Unit-test authorization, validation, limits and idempotency; integration-test RAG permissions, tools, caches and rendering; regression-test the complete application after changing a model, prompt, index or tool. [13][16]

Repeat model evaluations on representative and held-out examples. Report trial counts, configuration, unsafe proposal rate and actual policy-violation rate separately. Distinguish refusals of legitimate tasks from blocked unauthorized operations. Require zero unauthorized effects in the deterministic-control test suite; that is not proof of safety in every possible situation.

Record task identifier, model, prompt and policy versions, authorization decision, tool, operation state, cost and duration. Avoid logging full conversations or secrets by default. In an incident, disconnect the affected integration, suspend writes, preserve evidence, revoke exposed credentials, assess scope and verify the restored release. Follow applicable personal-data incident assessment and notification procedures when relevant. [16]

Rollout and release criteria

Start by inventorying data and capabilities. Remove unnecessary functionality, enforce access, resource limits and safe rendering. Then secure ingestion, dependencies and deployment. Grant bounded write access only after testing. Evaluate additional data flows and maximum impact for each new feature.

Before release, verify revocation in RAG and caches, independent denial of unapproved actions, concurrent budget enforcement, output validation, integration shutdown and recovery of a known version. Every model, policy and tool change needs an owner and verification evidence.

See the related POLPROG guides to conventional OWASP Top 10 and Harness Engineering. [18][19]

Do not rely on increasingly elaborate prompts for security. Minimize data access, separate the model from privileged execution, verify outputs before use and bound resource consumption. Assign each material risk an owner, a test and evidence that the control works. Increase autonomy only when these safeguards are in place.

Tools for this topic

OWASP LLM Security AI Security Prompt Injection RAG Security Excessive Agency Data Privacy Model Poisoning AI Agents MCP AI Evals Application Security

Frequently asked questions

Does the LLM Top 10 replace the conventional OWASP Top 10?

No. AI applications still require conventional access, session, dependency, database and interface security.

Can prompt injection be eliminated completely?

There is no universal reliable mechanism. Use independent access, execution and data-flow controls to limit consequences.

Do structured outputs guarantee security?

No. Format compliance proves neither authorization nor factual or business-rule correctness.

Does RAG prevent hallucinations and leakage?

No. It improves access to evidence but requires access control, source governance and answer verification.

Does a local model solve security problems?

No. It changes data flows and provider dependencies but leaves model, infrastructure, data and integration risks.

When should the Agentic Applications Top 10 be applied?

When a system chooses and executes actions, persists state or coordinates agents. Use it alongside the LLM classification.

Does passing OWASP tests imply certification?

No. Testing documents the verified scope and configuration; it is not certification or proof that no vulnerabilities exist.

Sources and references

  1. OWASP GenAI Security Project, Top 10 for LLM Applications 2026↩
  2. OWASP GenAI Security Project, Top 10 for LLM Applications 2025↩
  3. OWASP LLM01:2026 Prompt Injection↩1↩2↩3
  4. OWASP LLM02:2026 Sensitive Information Disclosure↩1↩2
  5. OWASP LLM03:2026 Excessive Agency↩1↩2↩3
  6. OWASP LLM04:2026 Supply Chain↩1↩2↩3
  7. OWASP LLM05:2026 Data and Model Poisoning↩1↩2↩3
  8. OWASP LLM06:2026 Unbounded Consumption↩1↩2↩3
  9. OWASP LLM07:2026 Misinformation↩1↩2
  10. OWASP LLM08:2026 Hidden Context Exposure↩1↩2
  11. OWASP LLM09:2026 Vector and Embedding Weaknesses↩1↩2↩3↩4
  12. OWASP LLM10:2026 Improper Output Handling↩1↩2↩3↩4
  13. OWASP Application Security Verification Standard (ASVS)↩1↩2↩3↩4↩5↩6↩7
  14. OWASP Top 10 for Agentic Applications↩1↩2↩3↩4↩5
  15. OWASP Agent Control Standard (ACS)↩1↩2↩3↩4↩5↩6
  16. NIST AI 600-1, Generative Artificial Intelligence Profile↩1↩2↩3↩4↩5
  17. Model Context Protocol, Security Best Practices↩1↩2↩3↩4
  18. POLPROG, OWASP Top 10: web application security↩
  19. POLPROG, Harness Engineering↩
  20. OWASP GenAI Data Security Best Practices v2 Part 2↩1↩2↩3
  21. OWASP GenAI Data Security Best Practices v2 Part 3↩1↩2↩3
  22. OWASP Securing Agentic Applications V2↩

Was this helpful?

Get new articles by email

One short email per new Learning article. No spam, unsubscribe in one click.

We only use your email to send new articles. No third-party sharing.

Back to Learning