llm-app-security
Makes your agent safer when handling AI applications. It validates inputs, controls outputs, and prevents abuse to protect data.
What it does
This tool helps protect AI-powered applications from attacks and misuse. It checks user inputs and controls outputs to prevent the AI from being manipulated or leaking information.
When to use it
- ✓When building a customer service chatbot.
- ✓When integrating AI into a software product.
- ✓When using AI to process sensitive information.
Example of what to ask your AI
“Protect my AI application from attacks.”
Want more? Open the sections below.
How to use
The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.
Skill link
Ready-to-paste message
How it works
It works by checking what the user types to ensure it's not malicious or trying to trick the AI. It also controls what the AI responds with so it doesn't reveal confidential data.
Installation
Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.
In the terminal (Claude Code, Codex, Cursor), in your project folder:
npx skills add sickn33/agentic-awesome-skills --skill llm-app-securityOr download just the file:
curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/llm-app-security/SKILL.md -o SKILL.mdTechnical content (original SKILL.md)
Original text by the author, straight from GitHub.
LLM Application Security
Harden chatbots, RAG pipelines, and AI features embedded in SaaS products against prompt injection, data leakage, abuse, and compliance violations.
OWASP LLM Top 10 -- Risk Map and Mitigations
The OWASP Top 10 for LLM Applications (2025) defines the most critical risks. The table below maps each risk to concrete controls implemented later in this document.
| # | Risk | Key Mitigation | Section |
|---|---|---|---|
| LLM01 | Prompt Injection | Input validation, instruction hierarchy | Input Validation, System Prompt Protection |
| LLM02 | Insecure Output Handling | Output sanitization, PII scrubbing | Output Safety |
| LLM03 | Training Data Poisoning | Document ingestion scanning | Secure RAG Pipeline |
| LLM04 | Model Denial of Service | Per-user token budgets, rate limiting | Rate Limiting |
| LLM05 | Supply Chain Vulnerabilities | Pin model versions, verify checksums | Compliance |
| LLM06 | Sensitive Information Disclosure | PII detection, tenant isolation | Output Safety, Tenant Isolation |
| LLM07 | Insecure Plugin Design | Tool allowlists, parameter validation | System Prompt Protection |
| LLM08 | Excessive Agency | Least-privilege tool scopes | System Prompt Protection |
| LLM09 | Overreliance | Provenance tracking, confidence scores | Secure RAG Pipeline |
| LLM10 | Model Theft | Access controls, API key rotation | Rate Limiting, Compliance |
Input Validation
Every user message must be validated before it reaches the LLM. Validation has three layers: structural checks, injection detection, and content moderation.
Structural Checks (Python)
import re
from dataclasses import dataclass
@dataclass
class InputPolicy:
max_length: int = 4096
max_lines: int = 50
allowed_languages: set = None # None = all
def __post_init__(self):
if self.allowed_languages is None:
self.allowed_languages = {"en"}
def validate_structure(text: str, policy: InputPolicy) -> tuple[bool, str]:
"""Return (is_valid, reason)."""
if not text or not text.strip():
return False, "empty_input"
if len(text) > policy.max_length:
return False, f"exceeds_max_length_{policy.max_length}"
if text.count("\n") > policy.max_lines:
return False, f"exceeds_max_lines_{policy.max_lines}"
# Block null bytes and control characters (except newline/tab)
if re.search(r"[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]", text):
return False, "contains_control_characters"
return True, "ok"
Prompt Injection Detection (Python)
import re
from typing import Optional
# Patterns that signal an attempt to override system instructions
INJECTION_PATTERNS = [
# Direct instruction override
r"(?i)ignore\s+(all\s+)?(previous|prior|above)\s+(instructions?|prompts?|rules?)",
r"(?i)disregard\s+(all\s+)?(previous|prior|above)\s+(instructions?|prompts?)",
# System prompt extraction
r"(?i)(reveal|show|print|output|repeat)\s+(your\s+)?(system\s+prompt|instructions|rules)",
r"(?i)what\s+(are|were)\s+your\s+(initial\s+)?(instructions|rules|prompt)",
# Role override
r"(?i)you\s+are\s+now\s+(a|an|the)\s+",
r"(?i)(act|behave|respond)\s+as\s+(if\s+)?(you\s+)?(are|were)\s+",
# Delimiter injection
r"(?i)<\/?system>",
r"(?i)\[INST\]|\[\/INST\]",
r"(?i)###\s*(system|instruction|human|assistant)",
# Encoding evasion (base64 instructions)
r"(?i)decode\s+(the\s+)?following\s+(base64|hex|rot13)",
]
_compiled = [re.compile(p) for p in INJECTION_PATTERNS]
def detect_injection(text: str) -> Optional[str]:
"""Return the matched pattern name if injection is detected, else None."""
for pattern in _compiled:
match = pattern.search(text)
if match:
return pattern.pattern
return None
Prompt Injection Detection (Node.js)
const INJECTION_PATTERNS = [
/ignore\s+(all\s+)?(previous|prior|above)\s+(instructions?|prompts?|rules?)/i,
/disregard\s+(all\s+)?(previous|prior|above)\s+(instructions?|prompts?)/i,
/(reveal|show|print|output|repeat)\s+(your\s+)?(system\s+prompt|instructions|rules)/i,
/you\s+are\s+now\s+(a|an|the)\s+/i,
/<\/?system>/i,
/\[INST\]|\[\/INST\]/i,
/###\s*(system|instruction|human|assistant)/i,
];
function detectInjection(text) {
for (const pattern of INJECTION_PATTERNS) {
if (pattern.test(text)) {
return { detected: true, pattern: pattern.source };
}
}
…
FAQ
What is 'prompt injection'?
It's when someone tries to give secret commands to the AI, making it ignore its original instructions and act undesirably.
What is 'data leakage'?
It's when the AI accidentally reveals private or confidential information it shouldn't share.
How does the tool protect against this?
It uses rules and checks to identify and block attack attempts before they reach the AI, and also filters the AI's responses.
Details
Original description by the author
Secure LLM-powered applications with input validation, output controls, tenant isolation, and abuse prevention.
Popularity
- GitHub stars
- 48k
- Ranking position
- #3463
- License
- MIT
- Updated
- 10/15/2026
Comments
- …
More skills from this repository
00-andruia-consultant
Helps your agent start or improve AI projects. It analyzes code, suggests tools, and creates action plans in Spanish.
sickn33/agentic-awesome-skills
007
Lets your agent perform security audits and threat modeling. It's useful for protecting projects against attacks and vulnerabilities.
sickn33/agentic-awesome-skills
10-andruia-skill-smith
Helps your agent create or improve AI tools. It defines how tools work, writes documentation, and validates the structure.
sickn33/agentic-awesome-skills
20-andruia-niche-intelligence
Lets your agent create a summary about a specific industry. It's useful for understanding the context, rules, usage patterns, and risks of a project, using reliable sources.
sickn33/agentic-awesome-skills
Similar skills
agent-architecture-audit
Makes your agent check if everything is working correctly. It finds and fixes problems in AI systems, ensuring they perform as expected.
affaan-m/ECC
agent-eval
Helps your agent compare different AI coding tools. It measures which one is faster, cheaper, and more reliable for specific tasks.
affaan-m/ECC
agent-harness-construction
Makes your agent better understand how to perform tasks. It optimizes the tools and instructions the agent uses to increase its chances of success.
affaan-m/ECC