prompt-injection-defender

Design layered prompt-injection defenses with trust zones and red-team suites.

2|Updated Jul 6, 2026
One-click install
npx skills add https://github.com/nguyenpv1980-wq/Project-Aegis --skill prompt-injection-defender
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-injection-defender
Source: https://github.com/nguyenpv1980-wq/Project-Aegis/tree/main/.claude/skills/prompt-injection-defender
Command: npx skills add https://github.com/nguyenpv1980-wq/Project-Aegis --skill prompt-injection-defender

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill designs defenses for LLM features and agents so untrusted content cannot hijack instructions, permissions, identity, policy, or execution plans. It addresses prompt injection in both direct and indirect forms, where malicious text may appear in user input, retrieved documents, webpages, emails, tickets, logs, tool outputs, or conversation history.

Core Features & Use Cases

  • Trust-Zone Mapping: Separates trusted system and developer rules from hostile context so the model never treats untrusted content as instructions.
  • Deterministic Action Boundary: Ensures every side effect is authorized by code outside the model, using the calling user's real permissions and approval gates for irreversible actions.
  • Red-Team Coverage: Defines concrete test payloads for direct, indirect, obfuscated, delimiter-escape, and multi-turn injection attempts with expected safe outcomes.
  • Use Case: Hardening an email triage agent, RAG assistant, chatbot, or other LLM-powered workflow against jailbreaks and hidden instructions in retrieved content.

Quick Start

Ask the skill to design a layered prompt-injection defense for your agent, including trust zones, a deterministic authorization boundary, and a red-team suite.

Frequently Asked Questions about prompt-injection-defender

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent prompt injection in an LLM agent that processes emails and retrieved documents?

Prevent prompt injection by mapping trust zones to separate trusted developer rules from hostile context, ensuring the model never treats untrusted email or retrieved document content as executable instructions. Deterministic authorization must run outside the model to block unauthorized side effects.

What is indirect prompt injection and how does it compromise RAG assistants?

Indirect prompt injection is malicious text hidden in untrusted context like retrieved documents, webpages, or tool outputs that tricks the LLM into executing unauthorized instructions. It compromises RAG assistants by hijacking their execution plan through data the system treats as safe retrieved content.

How to design a red-team suite for jailbreak defense in LLM features?

Design a red-team suite for jailbreak defense by defining concrete test payloads targeting direct, indirect, obfuscated, delimiter-escape, and multi-turn injection attempts. Each test case must specify expected safe outcomes to verify the LLM feature rejects unauthorized instructions and maintains policy.

Can I use deterministic authorization to block irreversible actions in LLM agents?

Yes, you can use deterministic authorization to block irreversible actions by enforcing approval gates in code outside the LLM. This ensures every side effect is validated against the calling user's real permissions, preventing hijacked agents from executing unauthorized operations.

Does trust-zone separation work for chatbots that mix user input with conversation history?

Yes, trust-zone separation works for chatbots by explicitly separating trusted system and developer rules from hostile context including conversation history. This prevents prior model turns containing injected text from being treated as trusted instructions by the LLM.