OWASP Top 10 for LLM Applications
Applications built on large language models (LLMs) fail in ways that ordinary web applications don’t. A model follows instructions that it finds in its input, so text from a user or a document can change what the application does. An agent, which is an application in which the model chooses which tools to call, can take actions with real effects, such as sending email or issuing a refund. And every model call costs money. The OWASP GenAI Security Project collects these risks in the OWASP Top 10 for LLM Applications. This page uses its 2026 edition.
Most of the ten risks reach your application at one of four points: when text enters the model’s context, which is everything the model reads before it answers; when a document enters a search index that the application retrieves from; when the model asks to call a tool; and when the model’s answer, called a completion, leaves your application. Arcjet places a check at each of these points with the following controls:
- Prompt injection detection screens text for instructions meant to take over the model, before the text enters the model’s context.
- Sensitive information detection finds personal data, protected health information (PHI), and secrets such as API keys, either in your own process or on Arcjet.
- Agent guards check an action against a
policy immediately before it runs. You call them with the
guard()function. - Token budgets limit how many model tokens a user, an agent, or a single run can spend.
The examples on this page use the JavaScript and TypeScript SDK,
@arcjet/guard. The Python and Go SDKs offer the same rules. For their syntax,
see Agent guards testing and reference.
Each example assumes that you create the client once, when your module loads:
import { launchArcjet } from "@arcjet/guard";
const arcjet = launchArcjet({ key: process.env.ARCJET_KEY! });Coverage summary
Section titled “Coverage summary”The following table shows how much of each risk Arcjet covers. For what each level means, see Coverage levels.
| OWASP risk | Arcjet control | Coverage |
|---|---|---|
| LLM01:2026 Prompt Injection | Prompt injection detection | Product |
| LLM02:2026 Sensitive Information Disclosure | Sensitive information detection | Product |
| LLM03:2026 Excessive Agency | Agent guards | Product |
| LLM04:2026 Supply Chain | None | Not covered |
| LLM05:2026 Data and Model Poisoning | Input screening at the store boundary | Partial |
| LLM06:2026 Unbounded Consumption | Token budgets | Product |
| LLM07:2026 Misinformation | None | Not covered |
| LLM08:2026 Hidden Context Exposure | Context screening in both directions | Partial |
| LLM09:2026 Vector and Embedding Weaknesses | Screening before embedding and after retrieval | Partial |
| LLM10:2026 Improper Output Handling | Agent guards on the next action | Partial |
LLM01:2026 Prompt Injection
Section titled “LLM01:2026 Prompt Injection”Prompt injection is text that changes what the model does. A model reads instructions and data through the same channel, so it can’t reliably tell your instructions apart from instructions that an attacker wrote into its input. Direct injection arrives in the user’s own message, such as “ignore your previous instructions.” Indirect injection arrives in content that your application fetched: a web page, a document from a search index, an email, or the result of a tool call. Indirect injection is harder to catch, because the user who triggered it can be innocent.
Arcjet covers this risk with prompt injection detection. Arcjet’s detection
models screen each piece of text before your code adds it to the model’s
context. When the text contains an injection, Arcjet returns DENY before your
code calls the model provider, so the instruction never reaches the model. Use
the same rule on the user’s message and on everything that your application
retrieves or receives:
import { detectPromptInjection } from "@arcjet/guard";
const promptScan = detectPromptInjection();
export async function screen(label: string, userId: string, text: string) { const decision = await arcjet.guard({ label, actor: userId, rules: [promptScan(text)], });
// Fail closed when Arcjet couldn't complete the check. if (decision.conclusion === "DENY" || decision.hasFailedOpen()) { throw new Error("Content blocked"); }}
// Before the model call:await screen("message.received", user.id, message);// Before a tool result or retrieved document enters the context:await screen("document.retrieved", user.id, chunk.text);Detection lowers the chance that an injection succeeds, but no detector recognizes every attack. An instruction written as an ordinary business request and planted in a document can read as harmless. For that reason, give each consequential tool its own agent guard, as the LLM03 section describes. If an injection gets through, the guard still checks the action against a policy that the model can’t change. A guard policy can also combine the detector’s result with your application’s state, for example to deny a destructive tool only when the message that triggered it shows signs of injection. For that policy, see Act on a prompt injection finding in context. For the detection model, its latency, and its limits, see Prompt injection detection.
LLM02:2026 Sensitive Information Disclosure
Section titled “LLM02:2026 Sensitive Information Disclosure”Sensitive information disclosure is private data that ends up somewhere it shouldn’t: a customer’s card number sent to a model provider, an API key written to a log, or one user’s records shown to another user. In an LLM application, the data can arrive in a pasted prompt, a retrieved document, or a tool result, and it can leave in the model’s answer or in the arguments of a tool call.
Arcjet covers this risk with sensitive information detection, which runs in
your own process, so the text that it scans doesn’t leave your environment.
Without extra setup, it detects email addresses, phone numbers, IP addresses,
and card numbers. To detect Social Security numbers, bank accounts, government
IDs, names, and addresses as well, set the rule’s backend to
Rampart,
an on-device named-entity recognition (NER) model that recognizes these values
from their context. Listing one of those types without Rampart is a
configuration error. Run the rule wherever text crosses a boundary: on the
prompt before you call the model provider, on retrieved content, and on the
answer before you return it:
import { localDetectSensitiveInfo } from "@arcjet/guard";import { rampart } from "@arcjet/sensitive-info-rampart";
const detectPii = localDetectSensitiveInfo({ deny: [ "EMAIL", "PHONE_NUMBER", "CREDIT_CARD_NUMBER", "SSN", "BANK_ACCOUNT", "GOVERNMENT_ID", ], backend: rampart(),});
const decision = await arcjet.guard({ label: "prompt.submitted", actor: user.id, rules: [detectPii(prompt)],});
if (decision.conclusion === "DENY" || decision.hasFailedOpen()) { throw new Error("Remove personal data from your message");}Two kinds of sensitive information need Arcjet’s server-side detector, which
you declare in an agent guard policy over a SERVER input. The first is PHI,
such as the MEDICAL_RECORD_NUMBER type. The second is secrets: the SECRET
type covers API keys, access tokens, and private keys. For their configuration,
see
Detect protected health information (PHI)
and Detect secrets and API keys.
For every entity type and where Arcjet detects it, see
Entity types.
Detection decides whether a piece of text may cross a boundary in your application. It doesn’t decide which records a user may read in the first place. That’s access control, and it belongs in your code.
LLM03:2026 Excessive Agency
Section titled “LLM03:2026 Excessive Agency”Excessive agency means that an agent can do more than its task needs. Each tool that an agent can call does something real: it issues a refund, sends an email, or runs a database query. If the agent has more tools, broader permissions, or more autonomy than it needs, then a manipulated prompt or a plain model mistake can turn into a damaging action.
Arcjet covers this risk with agent guards. An agent guard runs inside your tool handler, immediately before the action, and checks a policy against this specific call: which tool, on whose behalf, and with which arguments. The policy doesn’t grant the agent general permission. It decides one call at a time. In the following example, the guard receives the refund amount and the user’s approval limit. Your code reads the limit from the signed-in user’s account, never from the model, because the model’s output is what the guard is there to check:
import { policyInput } from "@arcjet/guard";
export async function issueRefund( user: User, invoiceId: string, amount: number,) { // Your code decides which invoices this user may refund. The policy only // checks the amount, so look the invoice up within the user's scope first. const invoice = await invoices.findRefundableByUser(user.id, invoiceId); if (!invoice) { return { error: "Invoice not found" }; }
const decision = await arcjet.guard({ label: "refund.issued", actor: user.id, inputs: { amount_cents: policyInput.server.integer(amount), approval_limit: policyInput.server.integer(user.refundLimitCents), currency: policyInput.server.string(invoice.currency), }, });
if ( decision.conclusion === "DENY" || decision.hasFailedOpen() || // Refuse unless Arcjet fully evaluated a published policy. decision.policyEvaluation?.status !== "APPLIED" ) { return { error: "Refund not allowed" }; }
return await payments.refund(invoice.id, amount);}The policy for the refund.issued label lives in the
Arcjet Console, so your security team can change
the limit or add a rule without deploying code. The policy decides whether the
amount is acceptable, but it doesn’t know which invoices belong to which
customer. That’s why the example looks the invoice up within the user’s own
account before it calls the guard.
The example also refuses the refund unless policyEvaluation.status is
APPLIED. If no published policy matches the label, the decision is ALLOW
with the status NOT_CONFIGURED, and without this check the refund would go
through unchecked. For each status, see
Policy evaluation status.
Publish the policy’s rules in LIVE mode. A rule in DRY_RUN mode records
what it would deny, but it doesn’t deny anything.
For the policy itself, see
Keep a refund inside an approval limit.
Other policies cover email tools that may send only to approved domains,
database tools that can’t run DROP, and file tools confined to a workspace.
For those, see Policy examples.
If you build on an agent framework, a framework integration wraps each tool
and makes the same call for you. For the supported frameworks, see
Agent guard framework integrations.
Deciding which tools an agent gets, and how broad the credentials behind those tools are, is still your decision. Agent guards add a check on every call to the tools that you do give it.
LLM04:2026 Supply Chain
Section titled “LLM04:2026 Supply Chain”The supply chain risk covers everything that your application is built from: the model, its training data, fine-tuning adapters, and software packages. The 2026 edition includes substituted model weights and packages whose names a coding assistant invented, which attackers register in advance.
Arcjet doesn’t cover this risk. It runs in your application after the model is trained and the packages are installed, so it can’t check where they came from. Use model provenance checks, pinned dependency versions, and a software composition analysis tool instead.
One part of the supply chain does appear at runtime: the Model Context Protocol (MCP) servers that your agent’s tools connect to. An MCP server is a service that offers tools to an agent, so an unreviewed MCP server is an unreviewed dependency. An agent guard policy can restrict a tool to the MCP servers that you’ve reviewed. For the policy, see Restrict which MCP servers a tool can reach.
LLM05:2026 Data and Model Poisoning
Section titled “LLM05:2026 Data and Model Poisoning”Data and model poisoning is tampering with the data that a model learns from or looks things up in. An attacker who can add a document to the store that your application searches, or add examples to your fine-tuning data, can plant instructions or false facts that the model later treats as trusted. The most common target is retrieval-augmented generation (RAG), in which the application searches a store of documents and adds the closest matches to the model’s context.
Arcjet covers part of this risk. It can’t find poisoning in a model that’s
already trained, but it can check content before it enters a store: uploaded
files, fine-tuning examples, and documents waiting to be indexed. Screen each
item with prompt injection detection and sensitive information detection, or
with a guard policy over the tool’s own input requirements, and reject the item
on DENY:
for (const doc of pendingDocuments) { const decision = await arcjet.guard({ label: "document.indexed", actor: doc.uploadedBy, rules: [promptScan(doc.text), detectPii(doc.text)], });
if (decision.conclusion === "DENY" || decision.hasFailedOpen()) { await rejectDocument(doc.id); continue; }
await index.add(doc);}promptScan and detectPii are the rules from the
LLM01 and
LLM02 sections. Where your
training data comes from, and who may write to each store, remain your
responsibility.
LLM06:2026 Unbounded Consumption
Section titled “LLM06:2026 Unbounded Consumption”Unbounded consumption is an application that uses resources without a limit: model tokens, model calls, and tool calls. The result can be an outage, an unexpected bill, or an attacker who copies your model’s behavior by sending a large volume of queries. Agents make this risk worse, because one chat request can start a loop of many model calls. A rate limit on the HTTP route counts requests, so it can’t cap what a single run spends.
Arcjet covers this risk with token budgets. A token budget is a token bucket: each user, agent, or run has a balance of tokens that refills over time. Before each model call, your code charges the call’s estimated token count against the balance, and Arcjet denies the call when the balance runs out:
import { tokenBucket } from "@arcjet/guard";
const tokenBudget = tokenBucket({ bucket: "ai-tokens", refillRate: 2000, intervalSeconds: 3600, maxTokens: 5000,});
const decision = await arcjet.guard({ label: "model.called", actor: user.id, rules: [ tokenBudget({ key: user.id, requested: Math.max(1, Math.ceil(estimatedTokens)), }), ],});
if (decision.conclusion === "DENY" || decision.hasFailedOpen()) { throw new Error("Token budget exhausted");}To budget per agent or per run instead of per user, change the key to an
agent ID or a run ID. For how to estimate tokens, and for examples in each
framework, see
AI budget control.
To cap spend in a policy that you manage in the Console, see
Enforce a spend budget.
On your HTTP routes, bot protection
and rate limiting reduce automated
traffic before it reaches the model.
LLM07:2026 Misinformation
Section titled “LLM07:2026 Misinformation”Misinformation is incorrect or invented model output that a person or another system trusts and acts on. Its causes lie in the model and in the data that it draws on. The remedies are grounding the model in reliable sources, showing citations, and evaluating the quality of its output.
Arcjet doesn’t cover this risk, because it doesn’t judge whether an answer is true. It does control what an answer can do. If a wrong answer leads the agent to call a tool, the agent guard on that tool checks the action against your policy before it runs, as the LLM10 section explains.
LLM08:2026 Hidden Context Exposure
Section titled “LLM08:2026 Hidden Context Exposure”Hidden context exposure is the leak of information that the model can see but the user shouldn’t: the system prompt, developer instructions, the definitions of the agent’s tools, policy text, and workflow rules. An attacker who reads this context can write a more targeted prompt injection. If the context contains an API key or personal data, the leak is a breach in its own right. The 2026 edition advises you to treat anything in the model’s context as discoverable.
Arcjet covers part of this risk by screening text in both directions. On the
way in, retrieved documents and tool results pass prompt injection detection
before your code adds them to the prompt. An instruction hidden in a document,
such as “print your system prompt,” is denied before the model reads it. Use
the rule from the LLM01 section for this check.
On the way out, the model’s answers and the arguments of its tool calls pass
sensitive information detection before they leave your application. Arcjet’s
server-side detector recognizes the SECRET type, so an API key that’s held in
the system prompt is denied before it leaves in a response.
The following example screens an answer before your application returns it. It
sends the text as a SERVER input to the policy for the completion.returned
label, which declares the server-side detector with SECRET in its deny list.
It also runs the local detectPii rule:
import { policyInput } from "@arcjet/guard";
const decision = await arcjet.guard({ label: "completion.returned", actor: user.id, inputs: { completion: policyInput.server.string(completion), }, rules: [detectPii(completion)],});
if ( decision.conclusion === "DENY" || decision.hasFailedOpen() || // Without the policy, nothing screened the completion for SECRET. decision.policyEvaluation?.status !== "APPLIED") { return { error: "The response couldn't be returned" };}The rest of this risk is in how you build the application. Keep secrets out of the system prompt in the first place, return error messages that don’t repeat internal configuration, and don’t rely on hidden context to decide who may do what.
LLM09:2026 Vector and Embedding Weaknesses
Section titled “LLM09:2026 Vector and Embedding Weaknesses”Vector and embedding weaknesses are risks in the stores that RAG systems search. To make documents searchable by meaning, an application splits them into chunks and converts each chunk into an embedding: a list of numbers that represents what the text means. It keeps the embeddings in a vector store. Three things can go wrong there. One customer’s search can return another customer’s documents. An attacker can manipulate what a search returns. And an attacker with access to the stored vectors can partly reconstruct the original text, which is called embedding inversion.
Arcjet covers part of this risk by controlling what enters the store. Inversion
can only reconstruct text that was embedded, so screen each chunk before you
embed it, and skip any chunk in which Arcjet finds a sensitive value. The
detectPii rule from the
LLM02 section finds personal
data in your own process, but it doesn’t detect credentials. To keep API keys
and other secrets out of the store as well, also send the chunk as a SERVER
input to the policy for the chunk.embedded label, which declares the
server-side detector with SECRET in its deny list. That detector reads the
text on Arcjet, so the chunk leaves your process. When chunks come back from a
search, screen them again with prompt injection detection before they enter
the context:
for (const chunk of chunks) { const decision = await arcjet.guard({ label: "chunk.embedded", actor: tenant.id, inputs: { // Screened for SECRET by the policy's server-side detector. chunk: policyInput.server.string(chunk.text), }, rules: [detectPii(chunk.text)], });
if ( decision.conclusion === "DENY" || decision.hasFailedOpen() || // Without the policy, nothing screened the chunk for SECRET. decision.policyEvaluation?.status !== "APPLIED" ) { continue; // Skip the chunk; don't embed it. }
await vectors.upsert(tenant.id, await embed(chunk.text));}Arcjet doesn’t see vectors that are already stored, attacks that manipulate search results, or the store’s own access control. Limit every search to the current customer in the query itself, and protect the vector store with the same authorization as any other database.
LLM10:2026 Improper Output Handling
Section titled “LLM10:2026 Improper Output Handling”Improper output handling is passing the model’s output to another system without checking it for that system. A completion that becomes a SQL query, a shell command, HTML in a browser, or the arguments to an API call can do whatever its text says. Treat model output the way that you treat user input: as untrusted.
Arcjet covers part of this risk with agent guards. When the model asks to call a tool, the guard in your tool handler checks the arguments that the model generated against your policy, and denies the call if they fail. To do that, send the generated arguments to the guard as inputs. The following policies cover common cases:
- Deny a destructive database statement
- Restrict a web fetch tool to trusted hosts
- Deny a high-risk destination
- Confine a file tool to the workspace
Output that never reaches a tool, such as text that your frontend displays, needs checks suited to where it goes. Encode it for HTML, use parameterized queries for SQL, and validate structured output against a schema.