Dev.to
7/17/2026

Secure Your TypeScript LLM Pipeline with resk-llm-ts: 11 Threat Detectors in One npm Package
Short summary
resk-llm-ts is an open-source TypeScript library providing 11 independent threat detectors — including prompt injection, PII scanning, exfiltration guards, and toxicity filtering — that sit between your API route and LLM call. It ships as Express/Hono middleware or an OpenAI-compatible wrapper, requires Node.js 18+, and is GPL-3.0 licensed. The pitch is that instruction-based filters are insufficient and structural middleware defenses are needed before requests reach AI providers.
- •11 independent detectors: injection, PII, exfiltration, code, URL safety, toxicity, sensitive topics, language, relevancy, redaction, custom patterns
- •Plugs into Express, Hono, or wraps OpenAI clients directly
- •GPL-3.0 open source, Node.js 18+, no external dependencies beyond TypeScript 5.x
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



