ai-prompt-injection-defense
Installation
SKILL.md
Prompt Injection Defense — AI Security Mastery
Mandatory Pre-Flight Context Inspection
Before engineering LLM prompts or processing untrusted user input, you MUST inspect:
- Message Role Isolation → Place user input exclusively in
role: "user"messages; never concatenate user input intorole: "system" - Random Nonce Delimiters → Frame untrusted third-party or user input inside unique XML nonces (
<untrusted_data id="x7f9a2">) to prevent escape attacks - Dual-LLM Architecture for Untrusted Content → Process untrusted web/file content using an unprivileged reader LLM before feeding distilled output to the tool-calling agent
- Tool Call Argument Schema Validation → Validate all arguments emitted by LLM function calls with strict schemas before execution
Activation Boundaries
- Activate when: Building LLM integrations, prompt engineering, agent tool calling pipelines, RAG ingestion, and auditing AI security against prompt injection.
- DO NOT activate when: Writing standard deterministic backend algorithms without LLM inference.