FilterPrompt — AI Firewall logo

How FilterPrompt Works — Layered LLM Defense

FilterPrompt sits in front of your LLM provider as an OpenAI-compatible proxy. Every prompt and response passes through a layered pipeline of detectors before being forwarded.

Request lifecycle

  1. Auth — x-firewall-key header resolves the tenant
  2. IP check — global + tenant-scoped allow/blocklist
  3. Quota check — rate limits and monthly caps
  4. Pre-filter — pattern rules, ML detectors, structural validators, PII redaction
  5. Upstream call — OpenAI / Anthropic / Gemini / Azure with tenant credentials
  6. Post-filter — response inspected for PII leakage and policy violations
  7. Audit log — verdict, rules, latency, and cost recorded per request

Layered detection

Cheap detectors run first and short-circuit on high-confidence verdicts. Heavy ML detectors run in parallel only when earlier layers were inconclusive. This keeps median latency under 100ms even with the full stack enabled.

Verdicts and audit

Each request produces a structured verdict — risk score, triggered rules, matched spans, action taken, and a stable log id. The audit table is queryable by tenant for incident response.

Related