Three Pre-Response Defenses Against Prompt Attacks

Before the LLM generates a response, Rebuff employs three distinct pre-response checks: heuristic rule-based matching, an LLM-based classifier for prompt analysis, and vector similarity search against known attack embeddings to identify malicious input.

The top 3

  1. Top 3 Pre-Response Prompt Defense Pillars: Effective pre-response defenses against prompt attacks typically rely on a layered approach combining system prompt hardening, input validation/sanitization, and the use of dedicated moderation or 'sentinel' LLMs. These three methods work in concert to protect against a wide range of injection techniques.
  2. System Prompt Hardening: The Foundational Layer: Crafting clear, specific, and often repeated instructions within the system prompt is the first and most critical defense. This includes using structured delimiters to separate instructions from user input and placing key rules at the beginning and end of the prompt to leverage the LLM's attention to context.
  3. Sentinel LLMs: The AI Bouncer for Prompts: Employing a separate, specialized LLM or moderation model, often called a 'sentinel' or 'guard' LLM, acts as an AI-powered filter. This model analyzes incoming prompts for malicious intent and can achieve high F1-scores (e.g., Sentinel model at 0.980 F1-score) in detecting injections before the main LLM processes them.

Sources

Open the full topic