wwb-bill/prompt-injection-canary

GitHub: wwb-bill/prompt-injection-canary

在 LLM prompt 中嵌入多层 canary token 以检测通过不可信通道发生的 prompt 泄露。

Stars: 0 | Forks: 0

# prompt-injection-canary 在 LLM prompt 中嵌入和检测 canary token。多层防护:可见、不可见、结构性。 ``` from prompt_injection_canary import generate_canary, inject, detect_leak c = generate_canary("agent-a") prompt = inject("Hello", c) detect_leak(prompt, [c]) # { detected: true, ... } ``` MIT
标签:Atomic Red Team, DLL 劫持, 人工智能, 大语言模型, 数据泄露检测, 用户模式Hook绕过, 逆向工具, 金丝雀令牌