home/roleplay/prompt-injection-defense-en

Prompt Injection Defense.en

GPTClaudeGemini··1,213 copies·updated 2026-07-14
prompt-injection-defense-en.prompt
# Prompt Injection Defense

## 🔴 Hard

### Challenge Description

Prompt injection is an attack technique where attackers craft inputs that cause AI systems to ignore or bypass original instructions and instead execute behaviors desired by the attacker. This security risk is becoming increasingly important in AI applications. This challenge requires you to design a prompt that enables AI to effectively defend against various prompt injection attacks while processing user inputs, while maintaining normal functionality and usability.

### Challenge Goals

Write a prompt that enables AI to:
1. Identify and resist common prompt injection attack methods
2. Provide appropriate responses when detecting possible injections, rather than executing injected instructions
3. Avoid being manipulated into revealing system prompts or security boundaries
4. Maintain designed normal functionality while preserving security
5. Remain resilient against injection attacks of varying complexity and disguise levels

### Requirements

- The prompt must include defense mechanisms to identify and resist injection attempts
- Must defend against multiple attack techniques, including instruction overrides, role-play inducement, and delimiter confusion
- Should refuse execution appropriately when injection is detected, rather than completely stopping service
- Defense mechanisms should not excessively limit the system's normal functionality
- Defenses should apply to multi-language or mixed-text injection attempts

### Prompt Template

when to use it

Community prompt sourced from the open-source GitHub repo erweixin/prompt-challenges (no explicit license). A "Prompt Injection Defense.en" style prompt — adapt the placeholders and specifics to your task. Imported as-is and not independently retested here, so check the output before relying on it.

tags

roleplaycommunitygeneral

source

erweixin/prompt-challenges · no explicit license