AI Firewall for LLM Applications
An AI firewall is a security layer that inspects every prompt and response between your application and an LLM. FilterPrompt blocks prompt injection, redacts PII, stops jailbreaks, and enforces per-tenant policy with industry-leading detection accuracy.
What is an AI firewall?
An AI firewall is a security layer that sits between an application and a large language model. It inspects every prompt and every response in real time, applies a layered set of detectors and policy rules, and decides whether to allow, sanitize, or block the request before it reaches the model — and again before the response reaches the user. The same primitive that web application firewalls (WAFs) provide for HTTP traffic, an AI firewall provides for LLM traffic.
An AI firewall is distinct from an AI gateway. A gateway routes traffic to providers, manages cost, and enforces quotas. A firewall inspects the content of that traffic for adversarial input, sensitive data, and policy violations. Mature LLM stacks run both — typically as one combined proxy — because routing decisions and security decisions need the same request context.
What an AI firewall protects against
- Direct prompt injection — adversarial instructions typed by the end user
- Indirect prompt injection — payloads embedded in retrieved documents, emails, scraped pages, or tool results that the LLM reads on the user's behalf
- Jailbreaks — DAN-style, role-play, and obfuscated bypass attempts that try to disable system instructions
- PII exposure — leaked emails, SSNs, credit cards, secrets, and internal identifiers in either prompts or responses
- Toxic, harmful, or policy-violating output that fails compliance review
- Tenant abuse — runaway token usage, quota violations, off-allowlist models, credential reuse from blocked IPs
How FilterPrompt's firewall works
Each request passes through a layered pipeline: authentication and tenant resolution, IP allow/blocklist, quota enforcement, pattern rules, structural validators with canary tokens, semantic similarity scoring, ML detectors (Detoxify + XGBoost), and PII pre-filter. Verdicts are aggregated into a single risk score, logged with per-rule attribution, and the proxy then forwards (or blocks) the request to the configured upstream provider. Responses run through the post-filter for PII leakage and policy violations before being returned to the caller.
Provider coverage
FilterPrompt is provider-agnostic and works with OpenAI, Anthropic Claude, Google Gemini, Azure OpenAI, AWS Bedrock, OpenRouter, and any OpenAI-compatible endpoint. Each tenant brings its own provider credentials, which are encrypted at rest and never logged — cost and compliance attribution stays with the tenant.
Latency budget
Median end-to-end firewall overhead is under 100ms, with p95 at 142ms. Structural validators complete in under 1ms. Heavy ML detectors run in parallel and short-circuit on high-confidence verdicts from earlier layers, which is what keeps the median budget tight even with the full stack enabled. See the benchmark methodology page for per-stage latency breakdowns.
