llm-security

Implements security controls for LLM prompts, RAG pipelines, MCP servers, and agentic workflows.

Updated Sep 2, 2026
One-click install
npx skills add https://github.com/nbiish/tts-mcp --skill llm-security-nbiish
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: llm-security
Source: https://github.com/nbiish/tts-mcp/tree/main/.agents/skills/llm-security
Command: npx skills add https://github.com/nbiish/tts-mcp --skill llm-security-nbiish

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? LLM-powered applications face unique threats like prompt injection, RAG poisoning, MCP tool rug-pulls, and rogue agent behavior that traditional application security does not cover. This Skill provides domain knowledge and production code patterns to defend probabilistic AI components against these attacks. ## Core Features & Use Cases - Prompt Injection Defense: Input sanitization, XML tag isolation, canary tokens for leak detection, and output monitoring aligned with OWASP LLM01. - RAG & Context Security: PII redaction with Presidio, embedding anomaly detection, and HMAC-signed context provenance verification. - MCP Hardening: Server allowlisting, manifest hash pinning, OAuth 2.1 token guidance, and validation middleware against tool poisoning and rug-pull attacks. - Agentic Defenses: WASM sandboxed execution, circuit breakers, human approval gates, kill switches, and append-only audit ledgers mapped to the OWASP Agentic Top 10. - Use Case: When building an agent that calls MCP tools and retrieves documents via RAG, apply this Skill to validate every tool call with Pydantic/Zod schemas, sign retrieved context, and gate destructive actions behind human approval. ## Quick Start Review my agent's tool-calling and RAG pipeline code and apply the prompt injection and MCP security controls from this Skill.

Frequently Asked Questions about llm-security

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I defend against prompt injection attacks?▼

Prompt injection defense uses layered controls: sanitize user input with regex filters for injection patterns, isolate instructions from data using XML tags, and validate LLM output for leaked credentials or system prompt content. No single layer is sufficient, so combine input, output, and structural defenses.

How do I secure MCP servers against tool poisoning?▼

MCP security requires allowlisting approved servers, pinning tool manifest hashes, and validating every tool call against strict schemas. Sign tool descriptions and alert on drift after first approval to prevent rug-pull attacks, and never auto-approve MCP tool calls.

How do I redact PII from RAG context before sending to an LLM?▼

Use the Presidio analyzer and anonymizer libraries to detect and redact PII from retrieved documents before inserting them into the LLM context. Attach provenance metadata including source, sensitivity level, and hash to every retrieved chunk.

Does this Skill work with both Python and TypeScript projects?▼

Yes, the Skill provides parallel implementations in Python using Pydantic and in TypeScript using Zod for input validation, tool call schemas, and MCP middleware. Patterns like HMAC signing, circuit breakers, and approval gates are shown in both languages.

What is the OWASP Agentic Top 10 and how is it addressed?▼

The OWASP Agentic Top 10 (ASI 2026) catalogs risks like unexpected code execution, memory poisoning, and rogue agents. The Skill maps each risk to a concrete defense: WASM sandboxing, cryptographic memory signatures, mTLS inter-agent channels, circuit breakers, and kill switches.

When should human approval be required for agent actions?▼

Human approval is required for state-changing, destructive, or irreversible actions such as deletions, financial transactions, and production changes. The Skill classifies tool risk levels and rejects high-risk actions that lack a rollback plan or fall below a confidence threshold.