LLM Security

LLM security is the practice of protecting applications that use Large Language Models against attacks that target the model itself: prompt injection, system prompt leakage, data leakage of sensitive information into outputs, and unsafe tool or code generation. Unlike traditional application security, the attack surface includes the model's own probabilistic output — which is why filtering at generation time, not only at input time, matters.

This hub covers the full stack of LLM security concerns and links every deep-dive guide. RESK maintains open-source defenses for each layer: resk-llm for input-time detection, resk-logits for token-level output filtering, and ReskSafety as the deployable firewall that ties them together — try the live demo.

The LLM Threat Model

Every LLM application shares the same four exposure points. A sound LLM security posture addresses all of them, not just the input prompt:

1. Input — adversarial prompts

Prompt injection, jailbreaks, and encoding tricks that override system instructions. See our prompt injection guide for attack taxonomy and prevention.

2. Context — data and memory

Retrieved documents, conversation history, and tool outputs can carry hidden instructions (in-context injection) or leak sensitive data into the context window. Context leakage and system prompt extraction fall in this layer.

3. Output — what the model generates

Dangerous content, PII, toxic language, or unauthorized tool calls. Prompt filters cannot catch these: they act before generation. Output security requires token-level enforcement — see shadow-ban output filtering.

4. Actions — tools and integrations

When the model can call tools, send emails, or query databases, security becomes an authorization problem. Covered in our AI agent security hub.

LLM Security Best Practices

The complete best-practices guide covers implementation details, and the implementation checklist sequences every phase from inventory to red teaming. The pillars:

Data Leakage and Privacy

LLMs can regurgitate PII, credentials, or confidential context from their prompt. Privacy-preserving LLM security combines data classification before prompts reach the model, masking of sensitive fields in outputs, and strict data-protection policies for anything that enters the context window — regulations like GDPR apply to data processed by LLMs just as they do to any other processing. The data protection for AI guide covers the pipeline controls; the enterprise AI security hub details governance and compliance mapping.

Open-Source LLM Security Stack

RESK's tools cover each layer of the model above, and they are all open source:

resk-llm — input-time detection (Python)

Prompt-injection detection, banned-phrase filtering, PII and URL protection for OpenAI-compatible APIs. Project page · Production implementation guide

resk-llm-ts — TypeScript / Node / Bun

The same defenses for JavaScript applications, zero runtime dependencies. TypeScript AI security guide

resk-logits + reskSecure — output enforcement

GPU-accelerated logits processor that implements shadow-banning, plus a policy-driven per-user firewall. resk-logits · reskSecure

ReskSafety — the deployable firewall

An OpenAI-compatible, self-hosted LLM firewall with RBAC, editable policies, multi-provider routing, and an admin console. Read the LLM firewall hub or try the live demo.

Explore the RESK Security Hubs

Running LLMs in production? Deploy the full pipeline — input scanning, RBAC, token-level output filtering, and audit logs — in one Docker command.

Try the Live Demo Browse the Open-Source Stack