cd /news/ai-safety/secure-your-typescript-llm-pipeline-… · home topics ai-safety article
[ARTICLE · art-63281] src=dev.to ↗ pub= topic=ai-safety verified=true sentiment=↑ positive

Secure Your TypeScript LLM Pipeline with resk-llm-ts: 11 Threat Detectors in One npm Package

RESK Security has released resk-llm-ts, an open-source TypeScript library that provides 11 independent threat detectors to secure LLM endpoints against prompt injections, jailbreak attempts, PII leaks, and system prompt exfiltration. The library operates as middleware between API routes and LLM calls, blocking malicious content before it reaches the AI provider. It supports Express and Hono frameworks, includes an OpenAI-compatible wrapper, and requires Node.js 18+ with no external dependencies beyond TypeScript 5.x.

read2 min views1 publishedJul 17, 2026

Links:

If you expose an LLM endpoint in your TypeScript backend, every user request is a potential attack vector. Prompt injections, jailbreak attempts, PII leaks, and exfiltration of system prompts all happen through the same text input you pass to your model.

Instruction-based filters like "ignore previous instructions" do not work. Models follow user instructions by design. You need a structural defense at the middleware layer — before the request reaches your AI provider.

resk-llm-ts is an open source TypeScript library that sits between your API route and your LLM call. It inspects every input with 11 independent threat detectors and blocks malicious content before your model ever sees it.

Here is a minimal Express example:

import express from 'express';
import { createInjectionDetector } from 'resk-llm-ts';

const app = express();
app.use(express.json());

const injectionCheck = createInjectionDetector();

app.post('/chat', async (req, res) => {
  const result = await injectionCheck.analyze(req.body.message);

  if (result.flagged) {
    return res.status(400).json({
      error: 'Content blocked',
      reason: result.categories.join(', ')
    });
  }

  // Safe to call your LLM
  const reply = await callOpenAI(req.body.message);
  res.json({ reply });
});

Each detector is an independent module you can enable or disable:

resk-llm-ts plugs into your framework of choice:

// Express middleware
import { protectLLMEndpoint } from 'resk-llm-ts/express';
app.use('/api/chat', protectLLMEndpoint());

// Hono middleware
import { llmSecurity } from 'resk-llm-ts/hono';
app.use('/api/chat', llmSecurity());

// OpenAI-compatible wrapper
import { SecurityWrapper } from 'resk-llm-ts';
const secureOpenAI = new SecurityWrapper(openai);
const response = await secureOpenAI.chat.completions.create({ ... });
npm install resk-llm-ts

Requires Node.js 18+. No external dependencies beyond TypeScript 5.x.

70% of organizations lack AI governance according to PwC. Most rely on brittle prompt engineering as their only defense. resk-llm-ts gives you structural security at the gateway — before a single token reaches your LLM provider.

The library is GPL-3.0 open source, built and maintained by RESK Security.

Check it out, star the repo, and let me know what you think in the comments. What threat patterns do you see most in your AI applications?

👉 npm install resk-llm-ts

👉 https://github.com/Resk-Security/resk-llm-ts

👉 https://resk.fr

── more in #ai-safety 4 stories · sorted by recency
── more on @resk security 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/secure-your-typescri…] indexed:0 read:2min 2026-07-17 ·