What is an LLM firewall?

An LLM firewall is a layer between users and a large language model (LLM) that inspects every prompt and response and stops the ones that break a policy. It is another name for input and output guardrails.

How it works

An LLM firewall runs as a proxy in front of the model, or as an API the app calls around each model call.

  • Prompts are checked before they reach the model, for prompt injection, jailbreaks, personal data and unsafe requests.
  • Responses are checked before they reach the user, for leaked data, unsafe content and fabricated facts.

A message that breaks a policy is blocked, rewritten or flagged. See input and output guardrails.

Limits of the analogy

Like a network firewall, it sits in the path of all traffic and applies rules the operator sets from outside the system it protects. The likeness ends there:

  • No fixed fields. A network firewall matches addresses, ports and protocols exactly. A prompt is free text, so the verdict is a judgment of meaning by a guard model, with false positives and misses.
  • No single perimeter. Instructions also arrive in retrieved documents and tool results, and an agent's actions leave as tool calls, not as replies. A layer that reads only the chat misses both, so agents need checks on tool calls too.

With White Circle

Control sits between your model and your users, analyzes every input and output in real time, and checks tool calls before they run.

Train your own models

Post-train any Hugging Face model with Halo. Up to 4× faster than TRL