Foundation Layer: Input Sanitization & Keyword Filters
The initial defense against prompt attacks involves preprocessing user input with techniques like regex checks, keyword blacklists, and third-party moderation APIs to identify and block known malicious patterns before they reach the LLM.
The top 3
- Top 3 Input Sanitization Methods for LLMs: Effective input sanitization techniques for Large Language Models include pattern matching with regular expressions (Regex) to identify malicious structures, character and encoding normalization to prevent obfuscation, and length/complexity constraints to deter lengthy injection attempts.
- Evolution of Keyword Filters in Prompt Defense: Keyword filtering has evolved from simple blacklists blocking phrases like 'ignore previous instructions' to more sophisticated input classifiers and semantic analysis. Early filters were easily bypassed by encoding and role-playing, leading to the development of models specifically trained to detect injection attempts.
- Top 3 Bypass Tactics for Basic Prompt Defenses: Attackers bypass foundational defenses using obfuscation techniques like character substitution (homoglyphs), spelling variations, and encoding (Base64). They also employ token smuggling, breaking sensitive words into fragments that evade string-matching filters, and multi-step prompt crafting to incrementally guide the LLM to malicious outputs.
Sources
Open the full topic