Skip to content
Vol. 1 · Ed. 2026
CyberGlossary
Entry № 617

LLM Firewall

What is LLM Firewall?

LLM FirewallA security control that sits between users and a large language model to inspect prompts, retrieved context, and outputs in real time, blocking or rewriting traffic that violates policy.


An LLM firewall — also marketed as an AI firewall or LLM gateway — applies inspection, classification, and policy enforcement to traffic flowing in and out of LLM endpoints. Typical capabilities include prompt-injection and jailbreak detection, PII and secret redaction, content moderation, schema and tool-call validation, rate limiting per identity, RAG egress control, and detailed audit logs. Products and open-source projects in this space include LLM Guard, Prompt Shield, Lakera Guard, and vendor offerings from Cloudflare, F5, Palo Alto, and the major hyperscalers. LLM firewalls complement but do not replace guardrails inside the model, secure RAG design, identity-aware access control, and MLSecOps practices. They are most effective in defence-in-depth architectures where they enforce organisation-specific policy on top of vendor safety.

Examples

  1. 01

    A gateway that blocks prompts containing customer credit-card numbers before they reach the LLM API.

  2. 02

    An LLM firewall that strips a known prompt-injection signature from a document before it is added to a RAG context.

Frequently asked questions

What is LLM Firewall?

A security control that sits between users and a large language model to inspect prompts, retrieved context, and outputs in real time, blocking or rewriting traffic that violates policy. It belongs to the AI & ML Security category of cybersecurity.

What does LLM Firewall mean?

A security control that sits between users and a large language model to inspect prompts, retrieved context, and outputs in real time, blocking or rewriting traffic that violates policy.

How does LLM Firewall work?

An LLM firewall — also marketed as an AI firewall or LLM gateway — applies inspection, classification, and policy enforcement to traffic flowing in and out of LLM endpoints. Typical capabilities include prompt-injection and jailbreak detection, PII and secret redaction, content moderation, schema and tool-call validation, rate limiting per identity, RAG egress control, and detailed audit logs. Products and open-source projects in this space include LLM Guard, Prompt Shield, Lakera Guard, and vendor offerings from Cloudflare, F5, Palo Alto, and the major hyperscalers. LLM firewalls complement but do not replace guardrails inside the model, secure RAG design, identity-aware access control, and MLSecOps practices. They are most effective in defence-in-depth architectures where they enforce organisation-specific policy on top of vendor safety.

How do you defend against LLM Firewall?

Defences for LLM Firewall typically combine technical controls and operational practices, as detailed in the full definition above.

What are other names for LLM Firewall?

Common alternative names include: AI firewall, LLM gateway.

Related terms