Deterministic
Fast rule- and pattern-based detectors run first - regex, checksum-validated PII for 65+ types, signatures, and allow/deny lists. They resolve the clear cases at low cost and latency.
Runtime AI firewall
Guardrails are individual checks. An AI firewall is the enforcement layer that runs them on every request and decides to allow, block, redact, or mask in real time, including mid-stream. ZNYX is both: the firewall and the engine behind it.
Definition
An AI firewall is the inline enforcement layer that inspects every prompt, response, and streamed token and decides allow, block, redact, or mask in real time. It is to LLM traffic what a web application firewall is to HTTP: it sits between your app and the model and stops prompt injection, jailbreaks, data exfiltration, and unsafe output before they cause harm. ZNYX is an open-source, self-hosted AI firewall that enforces all of this inside your boundary.
Defense in depth
Cheap checks run first and most requests never reach the expensive tiers. Escalation is deliberate, budgeted, and audited, and when the engine cannot decide, the gate closes.
Fast rule- and pattern-based detectors run first - regex, checksum-validated PII for 65+ types, signatures, and allow/deny lists. They resolve the clear cases at low cost and latency.
When deterministic checks are uncertain, ML classifiers escalate for nuanced calls - toxicity, sentiment, topic and competitor detection, language ID, and PII NER - scored with precision, recall, F1, and AUROC.
The hardest decisions escalate to an audited LLM-judge layer with K-member consensus and denial-of-wallet budgets - for groundedness, intent, and other context-heavy judgments.
Detector scores are combined against your policy scorecard. If the engine cannot reach a confident verdict, the gate closes rather than passing the request.
Inline inspection
The firewall sits directly on the AI request path and inspects traffic at three moments: before the model sees a prompt, after it returns a response, and continuously while a response streams.
Every prompt is inspected before it reaches the model. The firewall catches prompt injection, jailbreaks, system-prompt leakage attempts, malicious URLs, and PII or secrets so unsafe or sensitive input is blocked, redacted, or masked first.
Responses are inspected before they reach the user or a downstream tool. The firewall checks for toxicity and bias, hallucination and groundedness via NLI, leaked secrets, unsafe code, and policy-violating content, and enforces structured-output and JSON-schema rules.
For real-time SSE streaming, the firewall evaluates tokens as they emit, so a response can be stopped mid-stream the moment it crosses a policy line, instead of waiting for the full completion to finish.
Remediation
Blocking is rarely the right product decision. Each detector maps to the action your policy chooses, per environment, and streaming responses are evaluated as tokens arrive over SSE.
Egress gate
The output gate is the last thing a response passes. It enforces host allowlists, JSON-schema contracts, and data-loss policy on the fully assembled answer as well as on each streamed chunk.
output:
dlp:
enabled: true
pii:
action: mask
types: [email, phone, ssn, credit_card]
secrets:
action: block
hosts:
allowlist: ["*.acme.com", "api.internal"]
schema:
enforce: true
on_fail: re-ask
streaming:
evaluate: per_chunk
Comparison
If you run a WAF in front of your web apps, an AI firewall is the equivalent control for your LLM and agentic apps: same inline placement, different threat model.
| Concern | Web application firewall | AI firewall (ZNYX) |
|---|---|---|
| Protects | HTTP and web application traffic | LLM prompts, responses, streamed tokens, retrieved context, and agent tool calls |
| Inspects | Requests and responses for known web attack patterns | Natural-language intent and content with deterministic, ML, and LLM-judge layers |
| Top threats | SQL injection, XSS, request smuggling | Prompt injection, jailbreaks, data exfiltration, hallucination, excessive agency |
| Actions | Allow or block | Allow, block, redact, mask, re-ask, refrain, or ask a human |
Detectors
Prompt injection
InputIdentify direct and indirect prompt-injection and adversarial instruction chains that try to override your application prompt.
Jailbreak
InputRecognize jailbreak templates, multi-turn escalation, and evasion attempts that try to bypass policy controls.
PII (65+ types)
Input & OutputDetect and redact PII across 65+ types, including checksum-validated regional IDs - in your boundary, never sent to a vendor.
Secrets & exfiltration
Input & OutputCatch leaked API keys, tokens, and credentials, and block data-exfiltration and sensitive-business-data patterns.
Toxicity, bias & sentiment
Input & OutputFlag abusive, hateful, biased, or off-brand content across user input and model output with configurable thresholds.
Topic & competitor control
Input & OutputKeep conversations in bounds and stop responses from referencing competitors or excluded products.
Malicious URL & phishing
Input & OutputBlock phishing links, IP-literal and punycode/homoglyph domains, and other malicious URL patterns.
Insecure code
OutputDetect SQL injection, XSS, command injection, path traversal, and insecure-deserialization patterns in generated code.
Hallucination & groundedness
OutputScore responses for groundedness against provided context using NLI-backed entailment and citation integrity.
System-prompt leakage
OutputCatch responses that echo your system prompt, matched against keyed fingerprints so the prompt itself is never stored.
Agent plans & agency
AgentScore agent plans and live steps for actions beyond the task, gate destructive ones behind a named human, and bound runaway loops before the invoice.
Tool & MCP governance
AgentScan MCP manifests at registration for poisoned descriptions and over-broad permissions, then govern which tools may be called and with what arguments.
Tool-output injection
AgentCatch instructions hidden in what a tool returns, re-inspected before that text re-enters the agent’s context and becomes its next instruction.
Retrieval & memory integrity
AgentInjected chunks, poisoned vectors, cross-tenant retrieval and cache hits, and what an agent persists to memory - checked at the retrieval and write stages.
Structured-output & language
OutputEnforce JSON-schema contracts on outputs and apply allow/block language policies across 35+ languages.
15 shown · 40 shipped in the runtime
See OWASP LLM Top-10 coverage →Coverage
Forty detectors run behind the firewall: prompt injection and jailbreak, PII across 65+ types, secrets and exfiltration, toxicity, bias and sentiment, topic and competitor, malicious URLs and phishing, insecure code, hallucination and groundedness, system-prompt leakage, and multilingual variants. Agentic and MCP stages add retrieval, agent-plan, agent-step, and memory-write evaluation, supply-chain manifest scans, tool-output guards, and excessive-agency checks, mapped to the OWASP LLM Top 10.
See OWASP LLM Top-10 coverageFAQ
What an AI firewall is, how it differs from guardrails, where it runs in your stack, and what it costs you in latency.
Pull the open-source runtime, drop it into your stack, and start enforcing policy in minutes, free, forever. Add the hosted control plane when you want centralized policies, evidence, traces, and team workflows.