KV-cache steganography blocks prompt exfiltration in gemma-4-12b with zero fine-tuning and 0% secret leakage

namesecurethanpass · reddit · 2026-11-30

A mechanistic approach to prompt-leak defense: because all transformer layers share one KV cache, late-layer induction/copying heads can verbatim-exfiltrate secrets and system prompts. Testing on gemma-4-12b-it with zero fine-tuning, the author shows three KV-cache steganography strategies — alternating caches across layers (breaks induction heads while preserving summaries), a middle-layer zero-knowledge secret vault (correct YES/NO verification, 0% leakage under forced prefill), and syntactic paraphrase interleaving with a misguidance decoy (exact tool calls, decoy returned on extraction attempts). Full walkthrough and reproducible scripts are published via TokenShark.

Original post →

More from Safety

Safety channel →