.png&w=256&q=75)
1
1
Looking for experience!

The project is a monorepo with two parts: a publishable core NPM library (sanitaize) and a Next.js 16 demo app (sanitaize). The core library exposes a singleton sanitaize object that developers configure with an application policy, risk tolerance (low/medium/high), and an OpenAI-compatible API key. It provides two methods — judgeInput() to analyze user prompts before they reach an LLM, and judgeOutput() to scan LLM responses before they reach the user. Under the hood, a carefully crafted system prompt instructs a judge LLM (e.g., GPT-4) to detect threats like prompt injection, jailbreaks, social engineering, PII leakage, data exfiltration, and harmful content, returning structured JSON with a risk score (0–1), confidence, verdict (allow/block), attack types, and reasoning. The system is fail-closed: any error or timeout defaults to blocking. Risk thresholds are configurable — low tolerance blocks at >0.3, medium at >0.6, high at >0.8. The demo app is a dark-themed Next.js site using Tailwind CSS 4 and the Geist font. The UI has three components: a Logo with cyan-accented branding, a PromptInput with an auto-resizing textarea and animated loading state, and a ResultDisplay that renders results as a 4-step visual timeline — (1) input received, (2) AI analysis with color-coded risk/confidence progress bars and threat tags, (3) final verdict as a large green/red banner with expected output guidelines, and (4) simulated model output showing either a block message or an allow confirmation. A raw JSON toggle lets users inspect the full response. The API key is kept server-side via a Next.js Server Action, and the library is provider-agnostic, working with any OpenAI-compatible endpoint.
7 Feb 2026