Tools/Firewall
Live Demo · Free

Prompt Firewall

A guardrail that decides whether text should be allowed, flagged, or blocked before it reaches an LLM — combining injection detection, secret detection, and PII redaction under a policy you control.

100% client-side · a demonstration of middleware guardrails

0 chars

Policy

Try a sample

The firewall decision, the rules that triggered it, and a sanitized version of your text will appear here.

Use it in your code

The exact engine on this page ships as a free npm package and a CLI, so you can run the same allow / flag / block policy in your app and in CI. Nothing is uploaded.

npm package

terminal
npm install @opensecureai/firewall
app.ts
import { evaluateFirewall } from "@opensecureai/firewall";

const { decision, sanitized } = evaluateFirewall(userInput);
if (decision === "block") reject();
else use(sanitized);

CLI

terminal
# check a file, or pipe via stdin
npx -y @opensecureai/firewall check prompt.txt

# CI gate: exit non-zero if anything is flagged
cat prompt.txt | npx -y @opensecureai/firewall check --fail-on flag

How it works

The firewall runs two engines over your text — the prompt-injection scanner and the PII & secrets scanner — then applies your policy: injection or secrets trigger a block, PII is redacted and flagged. This is the same logic a production middleware would run on both inputs and model outputs.