File contents prompt-injection-defense
Validation Checklist
[CRITICAL] Missing Input Sanitization
User input passed directly to LLM without sanitization.
Fix: Add input validation: await detector.detect(userInput)
[CRITICAL] RAG Content Without Sanitization
Retrieved content passed to LLM without sanitization.
Fix: Sanitize retrieved documents before including in context
[MEDIUM] Verbose Injection Detection Error
Error messages reveal injection detection details to attacker.
Fix: Return generic error: 'Request could not be processed'
[MEDIUM] Single Layer Injection Defense
Single pattern-based injection check. Easily bypassed.
Fix: Implement multi-layer defense with semantic analysis and output monitoring
[MEDIUM] Missing Output Behavior Monitoring
LLM output used without behavior monitoring.
Fix: Monitor output for signs of successful injection
[CRITICAL] Tool Calls Without Validation
Tool calls executed without validation.
Fix: Validate tool calls against allowed list and check arguments
[HIGH] System Prompt Exposure Risk
System prompt may be extractable via prompt injection.
Fix: Mark system prompt as sensitive, monitor for leakage
[MEDIUM] No Multi-Turn Context Analysis
Messages added without multi-turn injection analysis.
Fix: Analyze full conversation context, not just latest message
[HIGH] External Content Without Isolation
External content added to context without isolation markers.
Fix: Wrap external content with clear boundaries and untrusted labels
[MEDIUM] No Encoded Injection Detection
Injection detection doesn't check for encoded payloads.
Fix: Add checks for Base64, URL encoding, Unicode homoglyphs
[CRITICAL] Unlimited Tool Access
LLM has access to all tools without restriction.
Fix: Limit tools to minimum required for task
1 --- 2 name: prompt-injection-defense 3 description: prompt-injection-defense 4 --- 5 6 # prompt-injection-defense 7 8 ## Validation Checklist 9 10 - [CRITICAL] **Missing Input Sanitization** 11 - User input passed directly to LLM without sanitization. 12 - Fix: Add input validation: await detector.detect(userInput) 13 - [CRITICAL] **RAG Content Without Sanitization** 14 - Retrieved content passed to LLM without sanitization. 15 - Fix: Sanitize retrieved documents before including in context 16 - [MEDIUM] **Verbose Injection Detection Error** 17 - Error messages reveal injection detection details to attacker. 18 - Fix: Return generic error: 'Request could not be processed' 19 - [MEDIUM] **Single Layer Injection Defense** 20 - Single pattern-based injection check. Easily bypassed. 21 - Fix: Implement multi-layer defense with semantic analysis and output monitoring 22 - [MEDIUM] **Missing Output Behavior Monitoring** 23 - LLM output used without behavior monitoring. 24 - Fix: Monitor output for signs of successful injection 25 - [CRITICAL] **Tool Calls Without Validation** 26 - Tool calls executed without validation. 27 - Fix: Validate tool calls against allowed list and check arguments 28 - [HIGH] **System Prompt Exposure Risk** 29 - System prompt may be extractable via prompt injection. 30 - Fix: Mark system prompt as sensitive, monitor for leakage 31 - [MEDIUM] **No Multi-Turn Context Analysis** 32 - Messages added without multi-turn injection analysis. 33 - Fix: Analyze full conversation context, not just latest message 34 - [HIGH] **External Content Without Isolation** 35 - External content added to context without isolation markers. 36 - Fix: Wrap external content with clear boundaries and untrusted labels 37 - [MEDIUM] **No Encoded Injection Detection** 38 - Injection detection doesn't check for encoded payloads. 39 - Fix: Add checks for Base64, URL encoding, Unicode homoglyphs 40 - [CRITICAL] **Unlimited Tool Access** 41 - LLM has access to all tools without restriction. 42 - Fix: Limit tools to minimum required for task
ismael-joffroy-chandoutis/claude-skills-public/tree/main/prompt-injection-defense commit c0b9488056
Frequently asked questions How do I install the Prompt Injection Defense skill? Run npx skillmds@latest add ismael-joffroy-chandoutis/prompt-injection-defense in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
What does the Prompt Injection Defense skill do? prompt-injection-defense It is listed under AI & ML on SkillMD.
Is Prompt Injection Defense safe to use? This skill has not completed SkillMD's automated safety review yet. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
Which AI agents work with Prompt Injection Defense? This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Is Prompt Injection Defense free to use? Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
Who published Prompt Injection Defense? ismael-joffroy-chandoutis (@ismael-joffroy-chandoutis) published this skill. Their other Agent Skills are listed on their SkillMD profile.