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:

  1. Message Role Isolation → Place user input exclusively in role: "user" messages; never concatenate user input into role: "system"
  2. Random Nonce Delimiters → Frame untrusted third-party or user input inside unique XML nonces (<untrusted_data id="x7f9a2">) to prevent escape attacks
  3. 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
  4. 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.

2026 AI Prompt Injection & Sandboxing Invariants

Installs
3
GitHub Stars
7
First Seen
Apr 26, 2026