Deterministic Prompt Injection Detection Library Without ML Dependencies
As LLM agents proliferate, prompt injection detection is critical but current solutions require ML models, API calls, or GPU inference. A developer on HN built a Go library using deterministic normalization (10 stages) that detects injections via pattern matching after normalizing evasion techniques like homoglyphs, leet speak, and zero-width characters. Zero regex, zero API calls, single dependency. The ClamAV model for prompt security.
The ClamAV analogy is exactly right. The scan loop is trivial. The value is the definition database. Invest in building the largest, most actively maintained prompt injection signature database and release it as a community resource. The library itself is the distribution mechanism for the signatures. Port to Rust and TypeScript for maximum adoption. The business model is enterprise signature feeds with faster update cycles.
landscape (4 existing solutions)
Prompt injection detection splits into ML-based solutions (accurate but heavy, requiring GPU or API calls) and pattern-based solutions (fast but brittle regex). The deterministic normalization approach is a third path: normalize evasion techniques to canonical form, then match against a community-maintained signature database. This gives ClamAV-like deployability (embed anywhere, no ML dependencies) with expanding coverage via definition updates.