Top 3 Canary Token Designs for LLM Prompt Attacks

Effective canary tokens for LLM prompt injection defense are typically unique, high-entropy strings or phrases embedded in system prompts or context windows. The top designs include cryptographic random tokens, unique marker strings, or specific keywords that are unlikely to appear in legitimate output, signaling a prompt leakage if detected.

The top 3

  1. Top Passive Canary: High-Entropy String Detection: The most common canary token design involves embedding a unique, high-entropy string within the LLM's context, like the system prompt or retrieved documents. Detection occurs if this string is unexpectedly leaked in the model's output, indicating a prompt extraction or data leakage event.
  2. Top Active Canary: Sentinel Instruction Verification: This design actively instructs the LLM to append a specific, secret token to every response, which is then removed before user delivery. A missing token in the output signals a successful prompt injection that overrode the model's core instructions, indicating compromised behavior.
  3. Top Covert Canary: Steganographic Embedding: Advanced canary tokens utilize steganographic techniques, such as zero-width Unicode characters or homoglyph substitution, to invisibly embed tokens within LLM system prompts. This design allows for machine-recoverable detection of prompt leaks even when content is copied, paraphrased, or exposed through side channels.

Sources

Open the full topic