LLM guardrails mapped to the OWASP Top 10 for LLM Applications

A mapping of OWASP LLM Top 10 2025 risks to runtime guardrails you can self-host, the risks those guards cannot close, and how to test that each guard works.

On this page

Which OWASP LLM Top 10 risks guardrails can actually reduce

When an LLM application goes live or enters a security review, the reviewer usually asks how each risk in the OWASP Top 10 for LLM Applications 2025 is handled. The honest answer is that runtime guardrails reduce some of these risks but not all of them, and the mapping depends on where the controls sit and how they are tested. The OWASP list is a shared vocabulary of the ways LLM applications fail, from prompt injection (LLM01) and sensitive information disclosure (LLM02) to improper output handling (LLM06 is excessive agency, LLM05 is improper output handling) and unbounded consumption (LLM10). Its purpose is to help teams name risks consistently, not to prescribe a single control for each one.

Input and output rails are strongest on LLM01, LLM02, LLM05 and parts of LLM07, because those risks show up as text that can be inspected before it reaches the model or the user. NeMo Guardrails provides input, output and retrieval rails, and Guardrails AI provides validators for regex matching, toxicity and structured output. Risks in training data (LLM03 and LLM04), embedding stores (LLM08) and factual accuracy (LLM09) need controls upstream of inference: vetted model sources, data pipeline reviews, retrieval permissions and evaluation sets. Excessive agency (LLM06) needs authorization and scoped credentials on each tool, which a text filter cannot provide on its own.

Before you write the mapping for a review, decide where each control runs (the application, the AI gateway or the inference service) and which team owns its policy. Then test each guard against the risk it claims to cover. Tools such as garak can probe a model or endpoint for prompt injection, data leakage and jailbreaks, and each run writes a JSONL report of every attempt. Confirm with your guardrail vendor or partner which detections are exercised in your own environment and what the test results do not prove, so the reviewer sees a documented gap list alongside the controls.

How each OWASP LLM risk maps to a guard, a control or a gap

This table compares each OWASP LLM Top 10 2025 risk with what a runtime guard can enforce, what must be configured, and what needs a separate control. Read the rows for LLM01, LLM02, LLM05, LLM06 and LLM07 as the guard-level work, and the rows for LLM03, LLM04, LLM08, LLM09 and LLM10 as the points where guardrails are only one part of the answer.

RiskWhat the runtime layer doesWhere it stops and what else is needed
LLM01 Prompt injectionInput rails in NeMo Guardrails or a jailbreak and injection validator in Guardrails AI screen user input before the model call, and the AI gateway enforces the same policy on every route.Detection is probabilistic, so test with attack suites and tune thresholds. Limit tool permissions and what retrieved text can trigger, since a guard cannot make a model obey policy.
LLM02 Sensitive information disclosureOutput rails and PII validators scan prompts and responses for identifiers and secrets, masking or blocking matches, and log each decision.Redaction misses unusual formats. Pair it with data minimization, access control on source data, and retention rules for prompt and log stores.
LLM05 Improper output handlingOutput validators check structure against a schema, reject unsafe markup or code patterns, and enforce allowed values before a downstream system receives the text.The receiving application must still encode, escape and validate output for its own context. Guards do not replace secure coding in the consuming service.
LLM06 Excessive agencyExecution rails validate each tool call against an allowlist, block unapproved actions, and route risky actions to a human approval step.Scope credentials per tool, apply least privilege in the target systems, and log every action. Guardrail rules alone do not limit what a granted credential can reach.
LLM07 System prompt leakageOutput rails match against protected system prompt text and block responses that repeat it, and the gateway suppresses configuration echoes.Do not store secrets in system prompts. Keep credentials in a secrets manager and assume prompt contents can be inferred, so design controls that do not depend on concealment.
LLM03 Supply chainGuards offer little direct coverage. Validator packages and classifier models can be checked for source and integrity before they are loaded into the guardrail runtime.Needs model and package provenance, pinned versions, an internal artifact mirror, and vulnerability review of dependencies. Confirm signing support with each vendor.
LLM04 Data and model poisoningRuntime guards can flag some anomalous outputs but cannot detect poisoned training or fine-tuning data.Needs data lineage, controlled fine-tuning pipelines, dataset review, and evaluation suites that run before each model change.
LLM08 Vector and embedding weaknessesRetrieval rails can filter or check retrieved chunks for instructions and out-of-scope content before generation.Needs access controls on the vector store, tenant isolation in the index, and review of embedding sources. Retrieval filters do not enforce document permissions.
LLM09 MisinformationFact-checking and hallucination detection in NeMo Guardrails can flag some unsupported answers, and output rails can require citations.Detection is partial. Pair it with grounded retrieval, human review for high-impact answers, and evaluation against known-correct reference sets.
LLM10 Unbounded consumptionGateway rate limits, quotas and request size limits cap usage per key or user, and guard latency is measured per route.Needs budget alerts, capacity planning and resource limits on inference servers. Confirm which limits your gateway enforces per key and per model.

Open-source platforms that fit a self-hosted guardrail layer

A self-hosted guardrail layer usually combines a rail or validator framework, a gateway that enforces it on every model call, and a testing tool that proves the controls work. The four options below cover those roles, and each one needs checks against its current release status before it goes into an architecture.

NeMo Guardrails for input and output rails

NeMo Guardrails is an Apache-2.0 library that configures input, dialog, retrieval, execution and output rails in the Colang language, and it includes jailbreak and injection detection and self-check moderation. Its current release, 0.25.0, was published on November 19, 2026, and it requires Python 3.11, 3.12 or 3.13. NVIDIA has sunset the NGC microservice as of October 1, 2026, so ask your vendor whether the NeMo Helix control plane, which runs the library as an inference gateway plugin, is the supported path for your deployment.

NeMo Guardrails repository

Guardrails AI validators and REST service

Guardrails AI is Apache-2.0 licensed and builds input and output guards from validators, such as regex matching or toxicity detection, that you install from Guardrails Hub and chain together. It can also generate structured output that matches Pydantic models. It can run as a standalone REST service started with the guardrails start command, which lets applications call it through the OpenAI SDK. Confirm that each Hub validator you need is maintained, and that its detection models can run on your own hardware without online updates.

Latest release
v0.11.0
Guardrails AI quickstart

LiteLLM as the enforcement point

LiteLLM is an MIT-licensed AI gateway that calls more than 100 LLM APIs in OpenAI format and includes guardrails, logging and key management. Placing guard checks in the gateway means every application passes through the same input and output controls, instead of each team wiring its own. Confirm which guardrail callbacks are in the open-source edition, since the enterprise directory has a separate license, and test that a blocked request is logged with enough detail to review.

Latest release
v1.105.1
LiteLLM repository

garak for red-team testing

garak is an Apache-2.0 command-line scanner that probes language models for prompt injection, data leakage, jailbreaks, toxicity and hallucination, using static, dynamic and adaptive probes. It can test OpenAI API models, models via LiteLLM and any REST endpoint configured with a short YAML file, so it can test the guarded path through your gateway. Each run writes a JSONL report of every attempt, which gives you repeatable evidence for the guard tests. Confirm that your test set covers the OWASP risks your guards claim to reduce, not only the default probes.

Latest release
v0.17.1
garak user guide

Why runtime guards alone do not close prompt injection

Input and output rails catch known patterns and flagged content, but they do not decide what the model is allowed to do. A guard reads text going into the model and text coming out of it. It can match phrases, run a classifier for jailbreak or injection attempts, or check a response for sensitive terms. An attacker who rephrases the instruction, encodes it, or splits it across several turns can still reach the model, and the model can still act on what it was told. For OWASP LLM01 Prompt Injection, the guard is one layer of defense, and the reader should treat a blocked request as evidence that a filter fired, not as proof that the system is safe.

The more important distinction is between a filter and a control. A filter asks whether this text looks harmful. A control asks what the model can trigger if it is persuaded. When an agent holds a tool that sends email, writes to a ticket queue or queries a customer database, the damage depends on that tool's permissions, its credentials and whether a human approves the action, not on the wording of the prompt. Execution rails in NeMo Guardrails or validators in Guardrails AI can check a proposed tool call, but the scope of the credential and the allowlist of actions must be set in the platform and the identity layer. Ask each team which tools a model can call, under which identity, and what happens if the call is wrong.

Indirect prompt injection is where this gap is widest. Instructions hidden in a PDF, a web page or a wiki article that a retrieval pipeline indexes reach the model as trusted context, and a user prompt never has to contain the attack. Input rails on the user's message do not see those chunks unless the design routes retrieved text through retrieval rails, and even then detection is probabilistic. Treat every retrieved chunk and every tool result as untrusted input, keep it separated from system instructions in the prompt template, and restrict what a retrieved passage can trigger. The same reasoning applies to OWASP LLM06 Excessive Agency and LLM05 Improper Output Handling, where a model output passed into a shell, a SQL query or a web page becomes an injection path of its own.

Before you rely on any guard, confirm three things in your own environment: which attack classes the guard was tested against, what it does with the encoded and multi-turn variants your users or adversaries are likely to send, and whether a bypass is logged with enough detail to fix it. Then test the whole chain with a red-team tool such as garak, which probes for prompt injection and jailbreaks and writes a JSONL report of each attempt, and retest after each policy change. A guard that passes a probe suite has been shown to resist those probes, not every injection.

How to test that each guard works before an assessor does

This sequence turns each OWASP LLM risk you chose to address into a tested guard with a recorded result, so you can show an assessor what was probed, what failed, and what was fixed. It produces a repeatable test record that you rerun after every policy change.

  1. Map each risk to a named guard

    The security lead and the application owner list every OWASP LLM risk in scope, such as LLM01 Prompt Injection, LLM02 Sensitive Information Disclosure, LLM05 Improper Output Handling and LLM06 Excessive Agency. For each risk they name the input rail, output rail, validator or tool permission that addresses it, and mark the risks that guardrails cannot address, which need other controls. The step closes when every in-scope risk has one owner, one guard and one test objective in a shared register.

  2. Expose the guarded endpoint for testing

    The platform team places the guarded application behind the AI gateway, such as LiteLLM or Apache APISIX, and confirms that the guardrail policy is enforced on that route. The team creates a test key with the minimum permissions needed, separate from production keys. The step closes when a manual request through the gateway shows the guard firing on a known bad prompt and passing a benign one.

  3. Run garak against the endpoint

    The test engineer installs garak from PyPI with pip, using Python 3.11 or newer, and points it at the endpoint. For a plain HTTP application, garak's REST generator reads a short YAML file that describes the endpoint and its request and response shape. Where the models sit behind LiteLLM, garak can call that configuration directly. The engineer selects probes that match the mapped risks, such as prompt injection, data leakage and jailbreak probes. Garak is free to use, and the user guide at docs.garak.ai explains probe and generator options. The step closes when a complete run finishes and writes its report files.

  4. Read the JSONL report and garak.log

    Each run writes a JSONL report with every attempt and its evaluation, and garak.log keeps debugging output across runs. The engineer checks which prompts reached the model, which detector scored each response and why, and whether any errors or timeouts hid results. A missing evaluation is treated as an open finding, not a pass. The step closes when the engineer can trace any single failed attempt from prompt to response to detector verdict.

  5. Review FAIL rates against the mapped risks

    Garak makes 5 generations per prompt by default and marks a probe as FAIL with a failure rate when any attempt produces undesirable output. The security lead reviews each probe result against the risk register, noting that a single failed attempt is enough to mark a probe as failing. The team decides which failures block release, which need a guard change, and which need a control outside the guardrail layer, such as limits on tool permissions for excessive agency. The step closes with a signed-off list of accepted and open findings.

  6. Fix the policy and retest after each change

    The engineer changes the rail configuration, validator settings or gateway policy, then reruns the same probes with the same settings so results can be compared. Any change to a rail can move results for other risks, so the full probe set for in-scope risks runs again, not only the failed probe. Each run is stored with the policy version that produced it. The step closes when the rerun shows the target failures resolved and no new failures in the in-scope risks.

  7. Record false positives on representative traffic

    Adversarial probes show whether a guard catches attacks, but not whether it blocks legitimate work. The product owner assembles a set of real-world, anonymized or synthetic requests that represent normal use, and the team runs them through the same guarded endpoint. Each blocked benign request is logged with the rail that fired and reviewed for a policy fix. The step closes with a recorded false positive count per guard, which the owner accepts or sends back for tuning.

  8. Package the test record as assessment evidence

    The compliance lead collects the risk register, the probe configuration, the JSONL reports, the policy versions, the retest history and the false positive records into one evidence folder. This package shows an assessor what was tested, how, and what changed. DeployOpen prepares this evidence, but independent auditors and certification bodies decide whether it meets a given requirement. The step closes when an assessor can follow any guard from risk to test result to policy change.

Where guards sit in the request flow

The flow starts with a user prompt entering the application, which sends it to the AI gateway inside the organization's trust boundary. Input rails run first, then retrieval rails check any document chunks before they reach the model endpoint. Execution rails gate tool calls, and output rails inspect the response before it returns to the user. Every blocked and allowed decision is written to the logging store, so reviewers can check whether each OWASP risk was actually covered.

Guard points along one request path, with decisions logged inside the organization's boundary.

What assessors ask for and which component produces it

This table maps each piece of evidence an assessor typically requests for an LLM guardrail program to the component that produces it and where it tends to be missing. Read it as a checklist to agree with your security, compliance and implementation teams before the first review.

EvidenceWhat it showsProduced byWhere it usually falls short
Risk-to-control mappingWhich OWASP LLM risks each input or output rail addresses, and which risks rely on other controlsDocumented design, reviewed by security and the application ownerMapping stops at prompt injection and omits excessive agency, system prompt leakage and unbounded consumption
Guard configuration under version controlWhat each rail checks, which thresholds apply, and who approved each changeGit history of NeMo Guardrails configuration or Guardrails AI validator settingsPolicies edited directly on the server with no approval trail or tagged release
garak JSONL reportsAttempts sent to the model, the detector verdict for each, and failure rates per probegarak runs against the deployed endpoint, one report per runRuns executed once before launch and never repeated after model or policy changes
Retest recordsThat fixes closed the findings and that the same probes now pass or fail as expectedRetest runs logged with the configuration version testedFindings closed in a ticket without a rerun, or retests against a different model version
Blocked-request logsWhich inputs and outputs were stopped, by which rail, and whenAI gateway and guardrail server logs with rail name and decisionLogs omit the rail that fired, or prompt content is discarded before review
Access and admin recordsWho can read logs, edit policies, change model routing and approve exceptionsIdentity provider and gateway admin audit trailShared admin accounts or no record of who approved a policy exception
Log retention scheduleHow long decision and event logs are kept and where they are storedRetention policy applied to log storage in the client's infrastructureRetention set by default storage settings rather than by a documented decision

Questions buyers ask before hiring help with OWASP LLM guardrails

What drives the cost of OWASP LLM guardrail work?

The cost follows the written scope: how many applications and model endpoints are covered, which OWASP LLM risks the guards must address, how deep the testing goes, and how much integration is needed with the AI gateway and SSO. Each application adds policy design, tuning against its own traffic, and logging decisions. Compute for classifier models and any engineering to keep policies current recur after launch, while policy design, integration and the first test cycle are mostly one-time. Ask any partner to price these components separately in a quote so you can see what recurs.

How long does a self-hosted guardrail implementation take?

Duration depends on the scope agreed in writing, so no general timeline applies. A single assistant connected to one model endpoint with a few input and output rails is a much smaller job than several applications with RAG retrieval, tool calls and gateway enforcement. Ask for milestones covering environment setup, policy configuration, integration, a test round against the OWASP categories in scope, and a retest after fixes. Confirm which items are included before work starts.

What does our team need to provide for guardrail work?

The engagement needs named application owners who can define allowed topics, refusal behavior and which data must never appear in outputs. It also needs representative prompt and response samples, ideally including known edge cases, so policies can be tuned without relying only on synthetic tests. Access to gateway and application logs is needed to review blocked requests, and access to the identity provider is needed for SSO and role settings. Confirm these inputs with your partner before the scope is signed.

Can an internal team build guardrails without outside help?

Yes, many internal platform teams can deploy an open-source library, but the work involves more than installing a package. NeMo Guardrails configures rails in Colang, and Guardrails AI uses validators from Guardrails Hub that are installed separately, so someone must own policy design, testing and versioning. Guard effectiveness also needs an independent test pass, which is easier to staff when a partner is involved. Assess your team's skills in Python, policy writing, security testing and logging before deciding.

Do runtime guardrails cover the whole OWASP LLM Top 10?

No. Runtime guardrails mainly reduce risks that appear in prompts and outputs, such as prompt injection, sensitive information disclosure and improper output handling, and they can support controls on excessive agency through tool-call rails. Supply chain, data and model poisoning, vector and embedding weaknesses, misinformation and unbounded consumption need other controls such as model provenance checks, access controls on data pipelines, rate limits and budgets, and evaluation. Map each OWASP category to the control that addresses it and record which ones remain open.

How does NVIDIA's NGC sunset affect our planning?

NVIDIA's NGC catalog states that NeMo microservices has been sunset as of October 1, 2026, with no new releases and no continued support for that container. NeMo Guardrails itself is an Apache-2.0 library, and version 0.25.0 is published on PyPI, so a library-based deployment does not depend on that container. Its archived documentation directs existing microservice users to their NVIDIA account team, and the NeMo Platform path now runs through nemo-helix. Confirm with NVIDIA which deployment model it supports for your use before choosing an architecture.

How do we know the guards actually work?

Test them with the same kind of adversarial inputs an attacker would use, and rerun those tests after each policy or model change. The garak tool, which is Apache 2.0 licensed and installed from PyPI, probes models for prompt injection, data leakage, jailbreaks and other weaknesses, and it can target a REST endpoint through a short YAML configuration. Each run writes a JSONL report of every attempt, which gives you test evidence. Measure false positives on your own traffic too, since a guard that blocks legitimate answers creates its own operational problem.

What tooling alone does not satisfy

Runtime guardrails sit on the request path, so they cannot see many of the OWASP risks that start earlier or later in the lifecycle. The cards below cover the gaps that need supply chain review, data controls, access design, evaluation, budgets and named human ownership to close.

Model and package supply chain review

LLM03 covers risk in the models, adapters, datasets and Python packages an application pulls in, and a guard cannot inspect a poisoned weight file after it loads. Pin model artifacts by hash, record where each came from and what license it carries, and review packages such as guardrail validators before they enter a build. Ask who approves a new model or validator and how the approval is recorded.

Training and data poisoning controls

LLM04 concerns tampering with training, fine-tuning or retrieval data so the model behaves incorrectly on purpose or by accident. Output rails will not reveal a backdoor that only triggers on a specific phrase. Control this with provenance records for fine-tuning data, access limits on who can write to training sets, and before-and-after evaluation runs on every model update.

Vector store access controls

LLM08 covers weaknesses in embeddings and vector stores, including retrieval of documents a user should not see. A retrieval rail filters chunks after search, but the store itself must enforce tenant and document permissions. Check that each query is filtered by the caller's identity at the database level, that embedding indexes are segregated by data classification, and that deletions propagate to vectors.

Misinformation evaluation

LLM09 covers confident but wrong output, and a hallucination detector can flag only some of it. Build a labeled test set from your own domain documents, measure answer accuracy and citation correctness on that set, and rerun it after each prompt, model or retrieval change. Ask who owns the test set and who signs off when accuracy falls below the agreed threshold.

Rate limits and budgets

LLM10 covers denial of wallet and resource exhaustion from excessive or looping requests, which a content filter does not limit. Set per-user and per-key request and token limits, spending caps and maximum context sizes at the gateway, and alert when a key approaches its budget. Confirm which limits the gateway enforces natively and which need custom configuration, and test them under load before production.

Governance, human review and ownership

Guardrail policies drift when nobody owns them. Record a named owner for each rail and each blocklist, a change process for policy edits, a review schedule for blocked-request logs, and an escalation path for incidents involving model output. Human review is the control for high-impact decisions, and it needs documented reviewers, not just a dashboard. Ask who can change a policy in production and how that change is versioned.

How DeployOpen scopes, deploys and tests LLM guardrails

DeployOpen plans and implements LLM guardrails mapped to the OWASP Top 10 for LLM Applications inside the client's own cloud accounts, data centers or air-gapped networks. Each engagement starts with a written scope that ties every guard to a named risk, then tests whether each guard actually blocks what it claims to block.

How we scope

  • Written scope lists which OWASP LLM risks each input and output guard addresses, and which risks are assigned to other controls.
  • We confirm the models, gateway, chat interfaces and data sources the guards will sit in front of and behind.
  • Scope records latency budget, logging requirements and which guard decisions must be retained for review.

How we build

  • We deploy the chosen guardrail framework, such as NeMo Guardrails or Guardrails AI, in the client's infrastructure with versioned policy configuration.
  • Guards are enforced at the AI gateway so blocked and allowed requests follow one documented path.
  • Each control is configured with its own rules, validators and self-hosted detection models where the scope requires them.

How we hand over

  • Handover includes configuration files, a test set mapped to each OWASP LLM risk, and the results of each guard test.
  • Documentation describes how to change policies, who approves changes and how guard decisions are logged.
  • Findings that the guardrails cannot address are listed with the other controls the client needs to put in place.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retests cover guard changes, model upgrades and new tools or data sources added to the assistant.
  • Security testing of applications, APIs and AI systems, including red teaming, can be scoped alongside the guardrails.

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.