Design a defense system against prompt injection attacks. ## Application Context {{application_context}} ## User Input Sources {{input_sources}} ## Risk Tolerance {{risk_tolerance}} Implement layered defenses: **Layer 1: Input Sanitization** - Pattern matching for known attacks - Unicode normalization - Special character handling **Layer 2: Prompt Structure** - Input/instruction separation - Privileged context isolation - Output format constraints **Layer 3: Output Validation** - Response anomaly detection - Sensitive data leakage prevention - Action verification **Layer 4: Monitoring** - Attack attempt logging - Behavioral anomaly detection - Incident response triggers Provide: - Implementation code for each layer - Testing methodology - False positive management
Prompt Injection Defense System
Design a multi-layer prompt injection defense system with input sanitization, prompt structure hardening, output validation, and attack monitoring.
82 copies0 forks
Share this prompt:
Details
Category
CodingUse Cases
Security hardeningPrompt injection defenseInput validation
Works Best With
claude-sonnet-4-20250514gpt-4o
Created Updated Shared