Interview's MateAI Engineering
Interview's Mate

AI Engineering

LLMs, RAG, agents & evals

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
AI Engineering topics
Lesson 104/ 160
06. AI Security

OWASP Top 10 for LLMs

Industry checklist covering injection, data leakage, supply chain, and over-agency risks.

IntermediateLLM01–LLM10 · Checklist3 quiz questions
Practice Generative AI Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidHands-onQuiz (3)Practice

In plain words

The OWASP Top 10 for LLMs is a list of the ten biggest ways AI apps get attacked or go wrong, which teams use as a checklist when building and reviewing them.

Think of it like…

A pre-flight checklist: every item exists because someone once skipped it, and the value comes from going through it for each flight and recording that each check was actually done.

Where you’ve seen it

A team reviews a customer-support agent (RAG over help articles plus order-lookup and refund tools). Scoring each risk as likelihood × impact on 1 to 5 scales: LLM01 prompt injection 4 × 5 = 20, LLM06 excessive agency 3 × 5 = 15, LLM02 sensitive information disclosure 3 × 4 = 12, LLM05 improper output handling 3 × 4 = 12, LLM08 vector and embedding weaknesses 2 × 4 = 8, LLM10 unbounded consumption 3 × 2 = 6, LLM09 misinformation 3 × 3 = 9, LLM04 data poisoning 2 × 3 = 6, LLM03 supply chain 2 × 3 = 6, LLM07 system prompt leakage 4 × 1 = 4. The top four become the first sprint: refund approvals and per-user authorization (LLM01 and LLM06), PII redaction and output scanning (LLM02), sanitised rendering of model output (LLM05). Each control has an owner, a test and evidence: for example, a CI job runs 300 injection prompts and fails the build if action-level success exceeds 2%. The register is reviewed every quarter and after each new tool or data source.

Words you’ll hear

LLM01 Prompt Injection
Instructions in input or retrieved content that alter model behaviour.
LLM06 Excessive Agency
Giving the model more tools, permissions or autonomy than the task needs.
LLM05 Improper Output Handling
Passing model output to browsers, shells or databases without validation.
LLM10 Unbounded Consumption
Uncontrolled use of tokens, compute or money, including denial of wallet.

Visual diagram

Loading interactive diagram

Theory & deep dive

The ten risks in plain terms

LLM01 Prompt Injection: untrusted text (direct or retrieved) steers the model. LLM02 Sensitive Information Disclosure: the model reveals PII, secrets or proprietary data from training, context or tools. LLM03 Supply Chain: vulnerable or malicious models, datasets, adapters, packages, plugins and MCP servers. LLM04 Data and Model Poisoning: tampered training, fine-tuning or retrieval data introduces backdoors or bias. LLM05 Improper Output Handling: model output is trusted by downstream systems, leading to XSS, SQL injection, command execution or SSRF. LLM06 Excessive Agency: the model has too much functionality, permission or autonomy, so a manipulated or mistaken decision causes damage.

LLM07 System Prompt Leakage: prompts that contain secrets, credentials or security logic can be extracted, so assume the system prompt is not confidential. LLM08 Vector and Embedding Weaknesses: access-control gaps in vector stores, embedding inversion, poisoned documents and cross-tenant leakage in RAG. LLM09 Misinformation: confident but false output (hallucination, fabricated citations) causing harm, plus over-reliance by users. LLM10 Unbounded Consumption: unlimited requests, long inputs, expensive agent loops or model extraction causing outages and bills (denial of wallet). Earlier versions listed related items such as model denial of service, insecure plugin design, overreliance and model theft, which are folded into the 2025 entries.

Risk to control

LLM05: the support bot's answer is inserted into an HTML page. If it contains <img src=x onerror=...> and is rendered unsanitised, it becomes XSS. Control: render model output as text or sanitised markdown, with a strict Content-Security-Policy, and test with payloads in CI.

Key takeaway: The list covers inputs, data, model supply chain, outputs, agency and operations; know each risk's typical failure and control.

Using the list as a review and governance tool

Run a threat-modelling workshop per AI feature: draw the data flow (sources, prompt assembly, model, tools, outputs, logs), then walk the ten entries and record applicability, likelihood, impact, existing controls, gaps and owners. A simple 1 to 5 scoring (likelihood × impact) produces a ranked risk register; for the support agent, injection (20) and excessive agency (15) top the list and drive the first remediation sprint, while system prompt leakage (4) is accepted with the rule "no secrets in prompts". Map controls to the other lessons in this section: input and output guardrails, PII redaction, least-privilege tools and sandboxing, authorisation, human approval, RAG access control, MCP trust, audit logging and red teaming.

Make it verifiable: each control needs a test (an injection suite, an ACL canary, a schema validator unit test, a budget alarm) and evidence stored with the release; fail builds on regressions. Keep it living: re-review when adding a tool, data source, model version or tenant, and after incidents; track metrics such as action-level ASR, leak-canary hits, blocked policy violations and cost anomalies. Avoid pitfalls: treating the list as exhaustive (it isn't), checking boxes without tests, focusing on exotic model attacks while leaving basic authorisation open and ignoring non-technical controls (training, incident response, vendor assessments). Complement it with frameworks such as NIST AI RMF, MITRE ATLAS and your organisation's security standards.

A register entry

Risk: LLM06 excessive agency. Likelihood 3, impact 5, score 15. Control: refund tool scoped to the authenticated user's orders, auto-approval limit $50, two-person approval above $500. Test: authz matrix (5 roles × 12 tools). Owner: payments engineering. Evidence: CI report, last run 2026-11-18.

Key takeaway: Turn the list into a scored risk register with owners, tests and evidence, and revisit it as the system changes.

How it works, step by step

Step 1 of 4
Security + engineering

1. Draw the data flow

Diagram sources, prompt assembly, model, tools, outputs, logs and trust boundaries for the feature.

RAG + order lookup + refunds
Key numbers at this step
Include
third-party servers

When to use it & trade-offs

What it is

The OWASP Top 10 for Large Language Model Applications is a community-maintained list of the most critical security risks specific to LLM systems, used as a threat-modelling checklist the way the classic OWASP Top 10 is used for web apps. In the 2025 edition the entries are: LLM01 Prompt Injection, LLM02 Sensitive Information Disclosure, LLM03 Supply Chain, LLM04 Data and Model Poisoning, LLM05 Improper Output Handling, LLM06 Excessive Agency, LLM07 System Prompt Leakage, LLM08 Vector and Embedding Weaknesses, LLM09 Misinformation and LLM10 Unbounded Consumption (numbering and names changed from the 2023 list, so check the current version). It is most useful as a structured way to ask the right questions about an AI feature and to track controls, owners and evidence.

Why it matters: LLM applications fail in ways that classic application security checklists don't cover: instructions inside data, tools driven by model output, retrieval poisoning, runaway cost. A shared vocabulary lets product, security and engineering review designs consistently, prioritise by risk and show auditors and customers a documented approach. Using the list as a review template (not a compliance badge) catches issues early, when changes are cheap.

When to reach for it

  • Design reviews before launching AI features
  • Building a risk register and control matrix
  • Preparing for customer and auditor security questions

When to avoid or be careful

  • Treating the list as complete coverage
  • Marking controls done without tests
  • Reviewing once and never again

Security frameworks for AI

OWASP Top 10 for LLMs
Best for: Application-level threat modelling checklists

Strengths: Concise; practical; widely recognised.

Watch out: Not exhaustive; needs tests and ownership.

NIST AI RMF
Best for: Organisation-wide AI risk governance

Strengths: Broad lifecycle and governance guidance.

Watch out: Less technical detail per control.

MITRE ATLAS
Best for: Adversary tactics and techniques against ML systems

Strengths: Attack-focused knowledge base.

Watch out: Needs mapping to your own controls.

Interview signals & numbers to know

When this topic comes up

  • “Do you follow OWASP for LLMs?”
  • LLM01–LLM10
  • Excessive agency
  • Improper output handling
  • Denial of wallet

Benchmarks & rules of thumb

10 -
risk categories in the 2025 list
20 / 15 / 12 -
top risk scores for the example support agent
< 2% -
action-level ASR threshold used as a CI gate

Common mistakes & follow-ups

Common interview mistakes

  • Citing the list without mapping it to concrete controls and tests.
  • Focusing on model-level attacks while leaving tool authorisation open.
  • Using outdated numbering without checking the current version.

Likely interviewer follow-ups

  • Which OWASP LLM risks matter most for an agent with tools?
  • How would you turn the list into a risk register?
  • What is improper output handling?
Interview tip: Show a scored risk register and a test for each control. It proves you use the list operationally rather than as a slogan.
Loading hands-on exercise

Knowledge check

Loading quiz

Put it into practice

Practice related interview Q&A

Apply OWASP Top 10 for LLMs with generative AI interview Q&A and hands-on practice.

Open Generative AI Q&A →Tech Learn Q&A
Previous topic
Jailbreaks
Next topic
Input Guardrails