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.

The top 3

  1. High-Entropy, Unguessable Token Design: System Prompt Canaries utilize unique, random, high-entropy strings that legitimate users are statistically unlikely to ever input, ensuring that any appearance in output unequivocally signals an attack.
  2. Strategic System Prompt Embedding: These canaries are hidden within the LLM's system prompt or other trusted context, often with explicit instructions for the model to never echo them, placing them in a context only accessible during a malicious prompt injection attempt.
  3. Exact Match Output Monitoring: Detection relies on a simple, efficient post-processing scan of the LLM's output for an exact, byte-for-byte match of the unique canary token, guaranteeing that only its direct leakage triggers an alert.

Sources

Open the full topic