System Prompt Canaries: The Zero False-Positive Detection

These unique, high-entropy strings embedded in an LLM's core system prompt offer near-zero false positives, as legitimate users have no reason to input such random sequences, making any detection a definitive prompt extraction event.

The top 3

  1. How System Prompt Canaries Achieve Zero False Positives: System Prompt Canaries embed a unique, high-entropy, unguessable string within the system prompt, with explicit instructions for the LLM never to output it. Since legitimate users won't type this random string and the model won't hallucinate it, its appearance in output is a confirmed prompt extraction, ensuring near-zero false positives.
  2. Canaries' Value Beyond Detection: The Attack Feedback Loop: Beyond simple detection, System Prompt Canaries provide a critical attack feedback loop, acting as a 'tripwire' that confirms successful prompt injections. If multiple canaries are placed strategically (e.g., in system prompts, tool descriptions, RAG chunks), the specific leaked token can pinpoint exactly which part of the LLM's context was compromised, enabling targeted response actions like blocking output or rotating tokens.
  3. Origin Story: Cybersecurity's First Canary Traps: The concept of digital 'canary tokens' in cybersecurity originates from coal miners using actual canaries to detect invisible, lethal gases. This principle was adapted to create decoy digital assets—like fake credentials or hidden files—that legitimate users would never touch. Any interaction with these decoys signals unauthorized access, a foundational idea now applied to LLMs to detect prompt leakage.

Sources

Open the full topic