Canari enhances the security of LLM and RAG applications by injecting synthetic decoy tokens into LLM contexts. It detects prompt injection attacks in real time with zero false positives, alerting users immediately if a breach occurs. Protect your applications with this innovative approach to identify vulnerabilities before they can be exploited.
Canari is an advanced security solution specifically designed for Large Language Models (LLM) and Retrieval-Augmented Generation (RAG) applications, addressing the critical issue of prompt injection vulnerabilities—ranked as the top threat in the OSWAP LLM Top 10. By leveraging the concept of honeypot tokens, Canari proactively safeguards sensitive information against exploitation.
import canari
honey = canari.init(alert_webhook="https://example.com/canari")
canaries = honey.generate(n_tokens=3, token_types=["api_key", "email", "credit_card"])
system_prompt = honey.inject_system_prompt(
"You are a helpful assistant.",
canaries=canaries,
)
response = "Internal key: sk_test_CANARI_abcd1234"
alerts = honey.scan_output(response, context={"conversation_id": "conv-1"})
print(len(alerts))
Canari brings a robust approach to securing LLM applications by enhancing monitoring capabilities with industry-proven techniques from traditional cybersecurity practices. For further details, including advanced features and integration guides, refer to the documentation.
No comments yet.
Sign in to be the first to comment.