prompt-injection-defense

Detect and block prompt injection, jailbreaks, and role hijacking attacks.

2|Updated Feb 22, 2026
One-click install
npx skills add https://github.com/alexyyyander/prompt-injection-defense --skill prompt-injection-defense
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: prompt-injection-defense
Source: https://github.com/alexyyyander/prompt-injection-defense/tree/main/skill
Command: npx skills add https://github.com/alexyyyander/prompt-injection-defense --skill prompt-injection-defense

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive defenses against a wide array of prompt injection and AI manipulation attacks, ensuring your AI agent's integrity and adherence to its core instructions.

Core Features & Use Cases

  • Multi-Category Defense: Protects against instruction overrides, role hijacking, authority impersonation, context escapes, prompt extraction, indirect injection, and more.
  • Universal Compatibility: Works with Claude, GPT, Gemini, Copilot, Mistral, LLaMA, and any LLM.
  • Use Case: Automatically load this skill to prevent users from tricking your AI into revealing sensitive information, executing unintended commands, or deviating from its intended purpose.

Quick Start

Load the prompt injection defense skill by adding its content to your system prompt.

Frequently Asked Questions about prompt-injection-defense

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

FAQPage Schema
How do I prevent prompt injection attacks on my LLM agent?

You can prevent prompt injection attacks by loading defense rules into your AI agent's system prompt. This provides standing instructions to detect and block language-level attacks.

What types of AI manipulation does prompt injection defense protect against?

Prompt injection defense protects against 12 categories of attacks including instruction overrides, role hijacking, authority impersonation, context escapes, prompt extraction, and indirect injection.

Does this prompt injection defense skill require code changes to my agent?

No, this defense requires no code changes to the agent itself. You only need to add the skill's rules and detection heuristics to the system prompt.

Can I use prompt injection defense rules with GPT, Claude, and Gemini models?

Yes, the defense is universally compatible. It works with Claude, GPT, Gemini, Copilot, Mistral, LLaMA, and any LLM platform by modifying the system prompt.

What is the best way to secure an AI agent against jailbreaks and role hijacking?

The best way to secure an AI agent is to implement always-on defense heuristics in the system prompt. This establishes strict boundaries to prevent jailbreaks and role hijacking.

How does indirect prompt injection affect LLM security?

Indirect prompt injection compromises LLM security by tricking the model into executing unintended commands or revealing data through manipulated inputs. Defense heuristics detect these patterns.