Enter your API key to access your dashboard
Canary tokens detect prompt extraction attacks. Inject the token into your system prompt, and WonderwallAi's egress filter will block any response that leaks it.
pip install wonderwallaifrom wonderwallai import WonderwallClient
client = WonderwallClient(
api_key="your_api_key",
topics=["customer support", "product questions"],
)
# Scan before sending to LLM
verdict = client.scan_inbound("How do I return my order?")
if verdict.allowed:
# Safe to send to LLM
response = call_your_llm(message)
else:
# Message was blocked
print(verdict.message)# Check LLM output for leaked data
verdict = client.scan_outbound(
text=llm_response,
canary_token="WONDERWALL-abc123"
)
if verdict.action == "redact":
# PII was found and redacted
safe_response = verdict.message
elif not verdict.allowed:
# Canary token leaked — block response
safe_response = "I can't share that information."curl -X POST https://wonderwallai-production.up.railway.app/v1/scan/inbound \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{"message": "How do I return my order?"}'