{"slug": "resk-llm-ts-open-source-typescript-security-toolkit-for-llm-applications", "title": "resk-llm-ts: Open Source TypeScript Security Toolkit for LLM Applications", "summary": "Resk Security has released resk-llm-ts, an open-source TypeScript security toolkit for LLM applications. The toolkit includes 11 threat detectors for prompt injection, jailbreak, PII leaks, and data exfiltration, and can be used as Express or Hono middleware or as an OpenAI-compatible wrapper.", "body_md": "Links:\n\nIf you are building LLM-powered applications in Node.js or TypeScript, you have probably thought about security. Prompt injection, jailbreak attempts, PII leaks, and data exfiltration are real threats that traditional input sanitization does not catch at the LLM layer.\n\nMost security toolkits are Python-only. TypeScript developers deserve the same protection.\n\nresk-llm-ts is an open source TypeScript security toolkit with 11 threat detectors. It works as Express middleware, Hono middleware, or as an OpenAI-compatible wrapper.\n\n```\nnpm install resk-llm-ts\njs\nimport { LLMSecurity } from \"resk-llm-ts\";\n\nconst security = new LLMSecurity({\n  enabledDetectors: [\"injection\", \"jailbreak\", \"pii\", \"exfiltration\"],\n  mode: \"block\", // or \"log\"\n});\n\n// Use as middleware with Express\napp.post(\"/api/chat\", security.middleware(), async (req, res) => {\n  // req.body has been scanned - threats are blocked or logged\n  const response = await openai.chat.completions.create({\n    model: \"gpt-4\",\n    messages: req.body.messages,\n  });\n  res.json(response);\n});\n```\n\nOr use the OpenAI-compatible wrapper:\n\n``` js\nimport { SecureOpenAI } from \"resk-llm-ts\";\n\nconst client = new SecureOpenAI({\n  apiKey: process.env.OPENAI_API_KEY,\n  detectors: [\"injection\", \"jailbreak\"],\n});\n\nconst response = await client.chat.completions.create({\n  model: \"gpt-4\",\n  messages: [{ role: \"user\", content: userInput }],\n});\n```\n\n| Detector | Purpose |\n|---|---|\n| injection | Prompt injection detection |\n| jailbreak | Jailbreak pattern recognition |\n| pii | PII and sensitive data scanning |\n| exfiltration | Data exfiltration prevention |\n| code-injection | Code injection detection |\n| toxic-content | Toxic content filtering |\n| political | Political content detection |\n| adversarial | Adversarial suffix detection |\n| encoded-payload | Base64/hex encoded threat detection |\n| role-play | Role-play manipulation detection |\n| system-prompt | System prompt leak prevention |\n\nSecurity for LLM applications should not be an afterthought. Add it as middleware and ship with confidence.\n\nCheck it out on GitHub: [https://github.com/Resk-Security/resk-llm-ts](https://github.com/Resk-Security/resk-llm-ts)\n\nInstall: [https://npmjs.com/package/resk-llm-ts](https://npmjs.com/package/resk-llm-ts)\n\nLearn more: [https://resk.fr](https://resk.fr)", "url": "https://wpnews.pro/news/resk-llm-ts-open-source-typescript-security-toolkit-for-llm-applications", "canonical_source": "https://dev.to/resk/resk-llm-ts-open-source-typescript-security-toolkit-for-llm-applications-h3j", "published_at": "2026-07-10 07:01:46+00:00", "updated_at": "2026-07-10 07:13:16.461995+00:00", "lang": "en", "topics": ["large-language-models", "ai-safety", "developer-tools"], "entities": ["Resk Security", "resk-llm-ts", "OpenAI"], "alternates": {"html": "https://wpnews.pro/news/resk-llm-ts-open-source-typescript-security-toolkit-for-llm-applications", "markdown": "https://wpnews.pro/news/resk-llm-ts-open-source-typescript-security-toolkit-for-llm-applications.md", "text": "https://wpnews.pro/news/resk-llm-ts-open-source-typescript-security-toolkit-for-llm-applications.txt", "jsonld": "https://wpnews.pro/news/resk-llm-ts-open-source-typescript-security-toolkit-for-llm-applications.jsonld"}}