RAG indirect prompt injection security

Data as of Oct 25, 2026Reviewed by

How we measure

Which brands AI mentions

Mentioned in · Aug 1 – Oct 25, 2026

ChatGPT SearchChatGPT SearchGoogle AI ModeGoogle AI Mode

Questions and answers

  • ChatGPT SearchOct 15, 2026

    1. 1Lakera Guard
    2. 2Microsoft Prompt Shields
    3. 3Azure AI Search
    4. 4HiddenLayer

    Best security platforms for preventing indirect prompt injection in RAG pipelines

    As of October 2026, my recommendation is to shortlist Lakera Guard, Microsoft Prompt Shields, and a dedicated RAG security stack built around retrieval controls and runtime enforcement. The right choice depends on whether you need a specialized prompt-injection firewall, native cloud integration, or end-to-end protection across document ingestion, retrieval, and model execution.

    Indirect prompt injection is especially challenging because malicious instructions can be hidden in documents, PDFs, web pages, emails, or retrieved passages. A RAG system may then mistakenly treat those instructions as authoritative, potentially exposing sensitive information or triggering unauthorized tool calls.

    Top platforms to evaluate

    • Lakera Guard – Real-Time LLM Security & Safety Platform – Daidu.ai

    1. Lakera Guard

    (Best specialist shortlist)

    Best for: Teams that need a dedicated, vendor-independent layer for prompt-injection detection.

    Lakera offers real-time detection of malicious instructions in user prompts and untrusted context, including content fetched from URLs and attachments. Its API-based approach is useful for teams operating RAG applications across different model providers.

    • Strengths: Focused prompt-injection detection, configurable enforcement, and coverage of indirect attacks.
    • Check before buying: Detection performance on your own retrieved documents, deployment requirements, latency, and false-positive rates.
    • Website:

    • Azure AI Foundry - Création d’applications d’IA générative

    2. Microsoft Prompt Shields

    (Best for Azure-native RAG)

    Best for: Organizations already using Azure AI, Microsoft Foundry, or Azure OpenAI.

    Prompt Shields detects attacks in user prompts and documents, including hidden instructions in third-party content. Microsoft also documents Spotlighting, a technique designed to help distinguish untrusted external content from trusted instructions.

    • Strengths: Native integration with Microsoft's AI security controls and support for screening both prompts and document content.
    • Check before buying: Configuration of document-attack filtering, support at each pipeline boundary, and whether your specific model and deployment support the required features.
    • Website:

    • LlamaFirewall | LlamaFirewall

    3. Meta LlamaFirewall

    Best for: Engineering teams wanting a programmable, open-source defense layer.

    LlamaFirewall combines security components for detecting prompt attacks, evaluating agent behavior, and checking potentially unsafe code. It can be a useful foundation for a custom RAG or agent security layer, rather than a turnkey enterprise security service.

    • Strengths: Customizable controls and the ability to integrate security checks into application logic.
    • Check before adopting: Integration effort, coverage of retrieved documents in your implementation, maintenance, and production support requirements.
    • Website:

    • Azure Language in Foundry Tools | Microsoft Azure

    4. Azure AI Search

    Best for: Securing which documents enter the RAG context in the first place.

    This is not a standalone prompt-injection firewall. Its value is in retrieval-layer controls such as permission-aware search, document-level access controls, metadata filters, and source traceability. These reduce exposure to unauthorized or inappropriate context. Pair it with Prompt Shields or another detector.

    • Strengths: Retrieval authorization, data isolation, and integration with Azure-based RAG.
    • Limitation: Access controls do not, by themselves, neutralize malicious instructions inside authorized documents.
    • Website:

    • Lakera: About – The AI Security Company Behind Gandalf

    5. Lakera Guardrails alternatives and model guard frameworks

    Best for: Teams that need additional policy enforcement around their models.

    A guardrail framework can validate inputs and outputs, enforce structured formats, and block disallowed actions. This category is most useful as a complementary control, not as proof that retrieved content is safe. Evaluate individual frameworks against the indirect-injection threat model rather than assuming all guardrails detect it effectively.

    • Strengths: Flexible application-level policies and custom enforcement.
    • Limitation: Coverage depends on the framework, detector, configuration, and where the checks run.
    • Starting point:
    • HiddenLayer

    6. HiddenLayer AI Runtime Security

    Best for: Enterprise security teams protecting AI applications and agents across multiple workflows.

    HiddenLayer focuses on runtime visibility, threat detection, and inline enforcement. Its published capabilities address indirect attacks through retrieved content and tool outputs, unsafe agent actions, and sensitive-data exposure.

    • Strengths: Runtime monitoring, incident investigation, and policy enforcement.
    • Check before buying: How its inline controls integrate with your RAG framework, and which attacks are blocked versus only detected.
    • Website:

    Comparison at a glance

    PlatformBest fitPrimary security role
    Lakera GuardMulti-model RAGPrompt-injection detection
    Microsoft Prompt ShieldsAzure-native RAGPrompt and document screening
    Meta LlamaFirewallCustom-built pipelinesProgrammable security checks
    Azure AI SearchEnterprise retrievalAccess control and secure retrieval
    Guardrail frameworksCustom application policiesInput/output enforcement
    HiddenLayerEnterprise AI and agentsRuntime detection and response

    This is a practical shortlist, not a verified performance ranking. Public feature descriptions do not establish which vendor has the highest detection rate against current, adaptive attacks.

    What actually protects a RAG pipeline?

    A prompt-injection detector alone is not enough. The strongest architecture layers security controls at multiple stages.

    1. Document ingestion

    Validate sources, scan for suspicious instructions, track provenance, and quarantine questionable documents.

    2. Retrieval and authorization

    Enforce per-user and per-tenant permissions before returning chunks; preserve source metadata.

    3. Context inspection

    Screen retrieved passages for indirect prompt injection and clearly separate untrusted data from trusted instructions.

    4. Model and tool enforcement

    Constrain permissions, independently authorize every tool call, validate outputs, and require human approval for high-impact actions.

    Architecture guidance based on the OWASP RAG Security Cheat Sheet and Microsoft's defense-in-depth recommendations.

    How I would choose

    • For a cross-cloud enterprise RAG application: Start with Lakera Guard and HiddenLayer; evaluate detection, enforcement, and operational visibility against your actual threat scenarios.
    • For an Azure-first environment: Start with Prompt Shields plus Azure AI Search security controls.
    • For an engineering-led team: Evaluate LlamaFirewall alongside a dedicated detector and custom retrieval authorization.
    • For high-risk agentic RAG: Prioritize independent tool authorization, least privilege, runtime monitoring, and human approval—not just content filtering.

    Before selecting a vendor, run the same adversarial test suite against every finalist. Include hidden instructions in PDFs, HTML and retrieved chunks; obfuscated and multilingual attacks; multi-document injection; attempts to extract secrets; and attempts to trigger unauthorized tool calls. Measure attack success rate, false positives, latency, and whether the platform actually blocks an attack or merely raises an alert. OWASP provides a useful baseline for this evaluation.

    One question that would help narrow the recommendation: Is your RAG pipeline built primarily on Azure, AWS, or a cloud-agnostic stack? That makes a meaningful difference to which platform is the best fit.

    Google AI ModeOct 15, 2026

    1. 1NVIDIA NeMo Guardrails
    2. 2Lakera Guard
    3. 3Promptfoo
    4. 4Microsoft Azure
    5. 5Guardrails AI
    6. 6Google Cloud Platform

    Protecting against indirect prompt injection in Retrieval-Augmented Generation (RAG) pipelines is uniquely challenging because malicious payloads don't come from the user. Instead, they hide inside third-party data sources—like retrieved knowledge-base documents, scraped web pages, or uploaded files—that the LLM treats as trusted context.

    Specialized AI security platforms and guardrail tools address this risk by scanning data specifically at the retrieval boundary (between when text is fetched and when it enters the LLM's context window).

    Top Security Platforms for RAG Indirect Prompt Injection

    • NVIDIA NeMo Guardrails
      • Best For: Programmable, context-aware RAG pipelines and multi-turn dialog flow control.
      • How it helps with RAG: NeMo explicitly implements retrieval rails . These are designed to intercept and inspect retrieved chunks before they are concatenated into the prompt context window, allowing developers to filter out or sanitize poisoned knowledge-base segments programmatically.
      • Link: Explore documentation on NVIDIA NeMo Guardrails.
    • Lakera Guard
      • Best For: High-performance, dedicated runtime detection APIs.
      • How it helps with RAG: Lakera’s Guard API is built to process complex conversation payloads. It allows you to pass system prompts, user input, and—crucially—retrieved documents as separate parameters to accurately identify hidden adversarial instructions without triggering false positives on standard text.
      • Link: Check out the Lakera Guard API.
    • Promptfoo
      • Best For: Pre-deployment automated red-teaming, CI/CD security checks, and evaluation.
      • How it helps with RAG: Before your RAG application ever hits production, Promptfoo can run automated red-teaming simulations to test whether your system instructions can be hijacked by malicious data injected into your document stores or vector databases.
      • Link: Get started via Promptfoo.
    • Azure Prompt Shields / Microsoft AI Content Safety
      • Best For: Enterprise infrastructure built natively inside the Microsoft Azure ecosystem.
      • How it helps with RAG: Azure’s Prompt Shields include native detection models specifically trained to spot indirect prompt injection attacks targeting documents and extensions ingested by enterprise Copilots and custom RAG applications.
      • Link: Review features on Azure AI Content Safety.
    • Google Cloud Model Armor
      • Best For: Vertex AI and Google Cloud-hosted LLM architectures.
      • How it helps with RAG: Model Armor acts as a native security layer that filters prompts and retrieved context blocks for jailbreaks, injection markers, and malicious directives before processing by the primary model.
      • Link: Learn more via Google Cloud Model Armor.
    • Guardrails AI
      • Best For: Open-source schema validation and structured output safety.
      • How it helps with RAG: While primarily focused on output validation and stopping data leakage, it provides extensible validator blocks that can be integrated into data ingestion pipelines to catch structural abnormalities or adversarial formatting in text chunks.
      • Link: Explore the open-source project via Guardrails AI.

    Core Defense Architecture Beyond the Tool

    No single tool completely eliminates indirect prompt injection. A robust RAG security posture should combine the platforms above with architectural best practices:

    1. Strict Context Isolation: Use XML tags, markdown delimiters, or clear system/context separation (e.g., <retrieved_data> wrapping) so the LLM explicitly understands that the retrieved text is data to be summarized, not commands to be followed.
    2. Data Provenance Tracking: Maintain strict tracking on who and what source uploaded a document into your vector database. Never index open, unverified public web content into high-privilege agentic RAG systems without a human-in-the-loop review baseline.

    If you'd like to dive deeper, let me know:

    • Is your RAG pipeline connected to tools/APIs that allow the model to take live actions (agentic RAG)?
    • Are you deploying on cloud-native services (Azure/GCP) or looking for an open-source/self-hosted solution?

    I can help tailor a specific defensive architecture for your stack.

  • Google AI ModeOct 25, 2026

    1. 1Lakera Guard
    2. 2NVIDIA NeMo Guardrails
    3. 3Robust Intelligence
    4. 4Promptfoo
    5. 5ProtectAI LLM Guard
    6. 6NVIDIA Garak

    Addressing indirect prompt injection within Retrieval-Augmented Generation (RAG) workflows requires tools that can intercept and inspect untrusted third-party data retrieved from external knowledge bases, web pages, or document stores before it gets concatenated into the LLM context window.

    The industry splits these solutions into runtime guardrail/gateway platforms (which block injections live) and testing/red-teaming frameworks (which evaluate RAG vulnerability pre-deployment).

    Runtime Security Platforms & Gateways (Live Protection)

    • Lakera Guard : Provides a real-time security API specifically trained to detect both direct and indirect prompt injections. It evaluates untrusted text payloads coming from external inputs or RAG documents to spot adversarial manipulation and semantic override attempts before they reach your primary LLM.
    • Protect AI LLM Guard : An open-source and enterprise toolkit designed to sanitize inputs and secured outputs. For RAG pipelines, it features specific scanners to detect prompt injections, toxic language, and data leakage hidden inside retrieved document chunks.
    • NVIDIA NeMo Guardrails : An open-source toolkit programmable to intercept dialog flows. You can define canonical flows and safety rails that ensure instructions embedded inside retrieved context fragments cannot override core system behavior or force unauthorized tool execution.
    • Robust Intelligence (R.I.) : An enterprise AI security platform that acts as a firewall around LLM deployments. It actively validates both user inputs and retrieved RAG context data to prevent model hijacking, data poisoning side-effects, and unauthorized actions.

    Testing & Automated Red Teaming (Pre-Deployment Validation)

    • Promptfoo : An extensive tool for evaluating and red-teaming LLM applications. Its automated red-teaming module specifically simulates and generates custom attacks targeting RAG systems, testing whether malicious chunks can successfully enact indirect prompt injections or force data leaks.
    • Garak (LLM Vulnerability Scanner) : Often described as the "Nmap for LLMs," this open-source scanner probes RAG architectures and models for vulnerabilities, systematically testing how resilient your pipeline is to injected instructions embedded in knowledge sources.

    If you'd like to narrow this down, tell me:

    • Are you looking for an open-source library or a commercial enterprise SaaS platform?
    • Where is your RAG pipeline hosted (e.g., AWS Bedrock, LangChain/LlamaIndex custom stack, Azure AI)?

    I can help you select the ideal integration pattern for your architecture.

    ChatGPT SearchOct 25, 2026

    1. 1Cisco AI Defense
    2. 2Lakera Guard
    3. 3Palo Alto Networks Prisma AIRS
    4. 4Microsoft Prompt Shields

    Security platforms for indirect prompt injection in RAG workflows

    For Retrieval-Augmented Generation (RAG), I’d prioritize security platforms that inspect retrieved documents and chunks before they enter the LLM’s context, rather than solutions that only filter user prompts or moderate generated responses.

    Indirect prompt injection happens when malicious instructions are embedded in otherwise relevant content — such as a PDF, internal knowledge-base article, web page, or indexed document — and the model mistakenly follows those instructions. In a RAG application, that can lead to data leakage, manipulated answers, or unsafe tool execution. Microsoft’s guidance recommends layered defenses, including prompt-injection detection, isolation of untrusted content, runtime monitoring, and least-privilege access.

    Here are the platforms I would put on a shortlist, prioritizing documented relevance to this specific threat.

    Recommended platforms

    • Cisco AI Defense Integrates with NVIDIA AI Enterprise Software to Secure AI Applications Using NVIDIA NeMo Guardrails - Cisco Blogs

    1. Cisco AI Defense

    (Best RAG-specific starting point)

    Cisco explicitly describes protection against indirect prompt injection in RAG, with runtime detection and blocking before malicious instructions reach the model. It also offers vector database scanning to check connected knowledge bases for compromise.

    Why shortlist it: It addresses both the indexed knowledge layer and runtime model interactions.

    Evaluate: Whether scanning covers your particular vector database, ingestion pipeline, and retrieved chunks at the required granularity.

    Website:


    • Lakera: The AI-Native Security Platform to Accelerate GenAI | Check Point AI Security

    2. Lakera Guard

    (Best focused injection defense)

    Lakera documents checking retrieved content, reference materials, and tool responses before those inputs reach the LLM. Its controls support blocking, redaction, or warning, with configurable policies and audit logging. Lakera is now part of Check Point.

    Why shortlist it: Its documented interception point maps closely to the core RAG risk: malicious instructions arriving through otherwise legitimate retrieved content.

    Evaluate: How it handles chunk-level inspection, long-context inputs, multilingual attacks, and false positives on instruction-like but benign documents.

    Website:


    • Palo Alto Networks announces Prisma AIRS

    3. Palo Alto Networks Prisma AIRS

    A broader enterprise AI security platform with inline AI Gateway guardrails for prompt injection, sensitive-data exposure, and other policy violations. It supports deny, redact, or log-and-allow decisions; deeper inspection is available through its runtime security integrations.

    Why shortlist it: A strong candidate if AI security needs to fit into a wider enterprise security and governance program.

    Evaluate: Confirm that the selected guardrail inspects retrieved passages themselves, not merely the original user prompt and final response.

    Website:


    • The Future of AI Is Responsible—And Azure AI Foundry Is Leading the Way | Microsoft Community Hub

    4. Microsoft Prompt Shields

    Microsoft's option for detecting direct and indirect prompt attacks, particularly relevant to Azure-hosted AI applications. Microsoft's broader guidance also recommends marking and isolating untrusted content, monitoring agent behavior, and enforcing least privilege.

    Why shortlist it: Worth evaluating first if your RAG stack already uses Azure AI services and Microsoft security controls.

    Evaluate: Which protections are available in your specific deployment and model endpoint, and whether they inspect retrieved documents at the point of assembly into the model context.

    Documentation:

    How I would compare them

    CapabilityCisco AI DefenseLakera GuardPrisma AIRSMicrosoft Prompt Shields
    Explicit indirect-injection focusStrongStrongAvailable through runtime guardrailsSupported
    Retrieved-content inspectionDocumented RAG and knowledge-base controlsDocumented for reference and fetched contentValidate exact integrationValidate deployment-specific support
    Vector-store scanningExplicitly documentedNot the primary differentiator in the cited materialCheck selected componentsUse retrieval-layer controls as needed
    Runtime block/redact controlsYesYesYesDepends on integration
    Broader enterprise securityStrongAvailable through Check PointStrongStrong in Microsoft environments

    This is a qualitative shortlist based on public product documentation, not a controlled benchmark. “Available” does not mean every deployment or product tier includes the same capability.

    What matters most in a RAG security evaluation

    The critical question to ask each vendor is:

    Can you detect and block an indirect prompt injection embedded in a retrieved document, after retrieval but before that document is passed to the LLM, and can you demonstrate this in our actual RAG architecture?

    Test the following five scenarios during a proof of concept:

    1. Malicious retrieved chunk: A relevant document contains instructions to ignore system policies and disclose confidential information.
    2. Hidden injection: Instructions are concealed in HTML, PDF text, formatting, or encoded content.
    3. Benign instruction-like text: Legitimate documentation contains phrases such as “ignore previous instructions” as an example, testing false positives.
    4. Multi-document injection: Several individually innocuous chunks combine into a malicious instruction when retrieved together.
    5. Tool-enabled exfiltration: An injected instruction attempts to make an agent send retrieved secrets to an external destination or invoke an unauthorized tool.

    Measure attack success rate, false-positive rate, latency, and whether the platform actually prevents the unsafe action — not just whether it flags the content.

    No single filter is sufficient. Combine content inspection with source trust controls, document-level access permissions, least-privilege tool execution, and output/data-loss controls. This aligns with Microsoft's defense-in-depth guidance.

    My recommendation

    Start with Cisco AI Defense and Lakera Guard for a focused evaluation of indirect prompt injection in RAG. Cisco is particularly compelling if you need knowledge-base scanning as well as runtime protection; Lakera is compelling if you want to inspect untrusted retrieved content directly in the application flow.

    Add Prisma AIRS if enterprise-wide AI governance is a major requirement, or Microsoft Prompt Shields if your application is Azure-centric.

    One detail would help me narrow this down: Is your RAG stack built on Azure AI Search, AWS Bedrock, a self-hosted vector database such as Pinecone or Weaviate, or a custom LangChain/LlamaIndex pipeline? The integration point makes a substantial difference to which platform is the best fit.

Also asked as

  • Can you suggest platforms that specialize in preventing indirect prompt injection within RAG architectures?