Skip to content

OWASP Top 10 for LLM and Agentic Apps

LLM 2026 / ASI 2026

The model is an untrusted interpreter of everything in its context window. It cannot reliably tell your instructions from text inside a web page, an email or a tool result, so every input is potentially an instruction and every tool it can call is an attack surface. You cannot build a model that is never fooled; you build the system around it so that when it is fooled, nothing important breaks.

Capability or combinationMeaning or guidance
AReads untrusted input
BTouches sensitive data
CChanges state or communicates out
Any two of A, B, CExplicit residual-risk assessment
All threePer-action human approval

OWASP’s GenAI project publishes two lists: the LLM Top 10 2026 (LLM01–LLM10, August 2026) for any LLM application, and the Top 10 for Agentic Applications (ASI01–ASI10, December 2025) for systems that plan and act. Each section below opens with its categories and the control that answers them. The LLM list adopts Meta’s “Rule of Two” as the floor for budgeting agent capabilities.

type Caps = {
untrusted: boolean; // A
sensitive: boolean; // B
acts: boolean; // C
};
function policy(c: Caps) {
const n = [c.untrusted, c.sensitive, c.acts]
.filter(Boolean).length;
if (n === 3) return "approve-each-action";
if (n === 2) return "assess-residual-risk";
return "ok";
}

Gotcha: An agent that reads your inbox (A and B) and can send email (C) has all three. Prompt-injection filters do not change that classification — only removing a capability does.

IDCategoryControl
LLM01Prompt InjectionBound the blast radius; filter every modality
ASI01Agent Goal HijackLeast privilege; confirm privileged actions

Direct injection comes from the user; indirect injection rides in on content the model reads — a web page, a PDF, a calendar invite, an image. OWASP’s 2026 entry states plainly that no reliable prevention exists, so defense is architectural: filters and separate channels reduce success rates, while privilege limits cap what a successful injection achieves. Strip invisible Unicode at every ingest and render boundary.

// Tag blocks, variation selectors, zero-widths
const HIDDEN =
/[\u{E0000}-\u{E007F}︀-️​-‍⁠]/gu;
function asData(source: string, text: string) {
const clean = text.replace(HIDDEN, "");
return `<untrusted source="${source}">\n` +
`${clean}\n</untrusted>`;
}

Gotcha: Delimiters like <untrusted> lower success only against attackers who do not know your scheme. OWASP cites adaptive attacks that beat such defenses most of the time — treat them as a speed bump, never as the control.

IDCategoryControl
LLM10Improper Output HandlingTreat output as user input; encode per sink
ASI05Unexpected Code Execution (RCE)No eval; sandbox generated code

Model output that reaches a browser, shell, SQL engine or terminal is attacker-controllable input. Encode it for the sink it lands in, use parameterized queries, and apply a strict CSP. Disable auto-rendering of Markdown images and link previews: a rendered image URL is a one-request exfiltration channel.

declare const db: {
query(sql: string, args: unknown[]): unknown;
};
const IMG = /!\[[^\]]*\]\([^)]*\)/g;
function safeMarkdown(out: string) {
return out.replace(IMG, "[image removed]");
}
// Never interpolate model text into SQL
db.query("SELECT * FROM t WHERE name = $1", [
"model output here",
]);

Warning: Strip ANSI escapes and other control characters before model output reaches a terminal or log file. Those sinks interpret the bytes, so a reply can rewrite what an operator sees.

IDCategoryControl
LLM03Excessive AgencyFewest tools, narrowest functions
ASI02Tool Misuse & ExploitationPolicy check in code at call time
ASI03Identity & Privilege AbuseAct with the user’s own scoped token

Excessive Agency rose to third in 2026 because agentic deployments are where the damage lands. Give the agent only the tools the task needs, avoid open-ended tools (run_shell, fetch_url), and enforce authorization in code — complete mediation — rather than asking the model whether an action is allowed.

type Call = { tool: string; args: unknown };
type User = { id: string; token: string };
declare function approve(u: User, c: Call):
Promise<boolean>;
const TOOLS: Record<string, "read" | "write"> =
{ read_mail: "read", send_mail: "write" };
async function gate(call: Call, user: User) {
const kind = TOOLS[call.tool];
if (!kind) throw new Error("tool not allowed");
const ok = kind === "read" ||
(await approve(user, call));
if (!ok) throw new Error("rejected by user");
return user.token; // never a shared admin key
}

Gotcha: A mailbox-summarizer built on a generic mail API also gets send and delete. The model never needed them, but an injected instruction will happily use them.

IDCategoryControl
LLM02Sensitive Information DisclosureMinimize context; authorize before retrieval
LLM08Hidden Context ExposureNo secrets or rules in prompts

Hidden Context Exposure is the 2026 successor to System Prompt Leakage, widened to all context the user is not meant to see. Assume anything in the window can be read back by the user. Keep credentials in the tool layer, and enforce access rules where the data lives — chunk-level ACLs inside the vector query, not a filter after retrieval.

// Bad: model can be talked into repeating both
const bad = "Refund key: sk_live_123. " +
"Only admins may refund.";
// Good: prompt describes; code decides
const system = "You can request refunds via the " +
"refund tool. The tool decides eligibility.";

Note: Scrub prompts, completions and reasoning traces before they reach logs and APM tools. LLM02 treats reasoning traces as output in their own right: never log them raw to unrestricted observability.

IDCategoryControl
LLM04Supply ChainVerified sources, signatures, AI BOM
LLM05Data and Model PoisoningLineage, signed artifacts, red-team triggers
LLM09Vector and Embedding WeaknessesPer-tenant ACLs, provenance at ingest
ASI04Agentic Supply Chain VulnerabilitiesPin and review MCP servers and tools

Models, adapters, datasets, chat templates, MCP servers and tool descriptions are all code you did not write. Pin exact versions, verify hashes or signatures, and read tool descriptions: they go straight into the model’s context and can carry instructions.

{
"mcpServers": {
"tickets": {
"command": "npx",
"args": ["-y", "@acme/tickets-mcp@2.3.1"]
}
}
}

Gotcha: npx some-mcp-server without a version runs whatever was published most recently, on every start. An unpinned tool server is an auto-update channel for whoever takes over the package.

IDCategoryControl
LLM06Unbounded ConsumptionToken quotas, hard spend caps
ASI06Memory & Context PoisoningTreat memory writes as privileged
ASI07Insecure Inter-Agent CommunicationAuthenticate and validate messages
ASI08Cascading FailuresCircuit breakers, step limits
ASI10Rogue AgentsKill switch, monitoring, scoped identity

Agents amplify: one task fans out into dozens of tool calls, one poisoned memory entry steers every later session, one compromised agent feeds the next. Enforce step, depth, time and cost ceilings in the runner, not in the prompt, and make limits halt execution rather than raise an alert.

const LIMITS = { steps: 25, usd: 2 };
const seen = new Set<string>();
function check(step: number, usd: number,
state: string) {
if (step > LIMITS.steps) throw Error("steps");
if (usd > LIMITS.usd) throw new Error("budget");
if (seen.has(state)) throw new Error("loop");
seen.add(state); // hash of tool + args
}

Tip: Log the prompt that caused each memory write, and require approval before instruction-like text persists across sessions. A delayed-trigger memory write is how injected instructions outlive the conversation.

IDCategoryControl
LLM07MisinformationGround claims; verify before acting
ASI09Human-Agent Trust ExploitationShow the exact action, not a summary

Approval is a control only if the human sees what will execute — the full rendered command, recipient and payload — because a confident summary is exactly what a manipulated agent produces. Log every tool call with its arguments and the approving user. Test defenses against adaptive attackers who know your guardrails, and keep an injection corpus in CI.

type Action = { tool: string; args: object };
function approvalText(a: Action) {
return `${a.tool}\n` +
JSON.stringify(a.args, null, 2);
}
function audit(a: Action, user: string,
ok: boolean) {
console.log(JSON.stringify({
at: new Date().toISOString(), user, ok, ...a,
}));
}

Gotcha: Approval fatigue is real: a reviewer who clicks “approve” fifty times a day stops reading. Reserve prompts for irreversible or external actions and make everything else impossible by design.