Skip to content
Skillpedia
Agents48k · #3463

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

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/llm-app-security/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/llm-app-security/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
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-security

Or 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.md
Technical 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.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#3463
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills