WonderwallAi is an AI firewall SDK that blocks prompt injection, data leaks, and off-topic abuse. Runs locally with zero external API calls.
Each layer catches different threat categories. Most attacks never make it past Layer 1.
Cosine similarity against your allowed topics using lightweight embeddings. No API call. Catches 90% of off-topic abuse.
LLM binary classifier detects sophisticated injection. Only runs on messages that pass the semantic router.
Catches leaked API keys, PII, and canary tokens in LLM responses. Redacts sensitive data automatically.
Validates uploads by magic bytes and strips EXIF metadata. Prevents GPS and camera data from leaking.
from wonderwallai import Wonderwall from wonderwallai.patterns.topics import ECOMMERCE_TOPICS wall = Wonderwall(topics=ECOMMERCE_TOPICS) # Scan user input before it reaches your LLM verdict = await wall.scan_inbound("How do I return this?") if not verdict.allowed: return verdict.message # User-friendly rejection # Scan LLM output before it reaches the user verdict = await wall.scan_outbound(llm_response, canary_token) response = verdict.message # Cleaned text (API keys/PII redacted)
WonderwallAi was designed for developers who want control, speed, and privacy.
| WonderwallAi | Lakera Guard | Guardrails AI | LLM Guard | |
|---|---|---|---|---|
| Latency | <2ms (local) | 50-200ms | Varies | Varies |
| Data privacy | Never leaves your server | Sent to third-party API | Self-hosted possible | Self-hosted |
| Integration effort | 3 lines of code | API key + HTTP calls | Wrap entire pipeline | Complex config |
| Topic enforcement | Built-in semantic router | No | Via validators | No |
| Canary tokens | Built-in | No | No | No |
| Offline capable | Yes (fast path) | No | Partial | Partial |
| Open source | MIT | Proprietary | Apache 2.0 | MIT |
| Pricing | Free SDK + API from $0/mo | Pay per request | Free (self-host) | Free (self-host) |
Drop WonderwallAi into any Python application. Three deployment options, any LLM provider.
from fastapi import FastAPI from wonderwallai import Wonderwall app = FastAPI() wall = Wonderwall(topics=["Order tracking", "Returns", "Product info"]) @app.post("/chat") async def chat(message: str): verdict = await wall.scan_inbound(message) if not verdict.allowed: return {"error": verdict.message} response = await call_your_llm(message) clean = await wall.scan_outbound(response) return {"response": clean.message}
import asyncio from flask import Flask, request, jsonify from wonderwallai import Wonderwall app = Flask(__name__) wall = Wonderwall(topics=["Customer support", "Billing"]) @app.route("/chat", methods=["POST"]) def chat(): message = request.json["message"] verdict = asyncio.run(wall.scan_inbound(message)) if not verdict.allowed: return jsonify(error=verdict.message), 403 response = call_your_llm(message) return jsonify(response=response)
from langchain.chains import ConversationChain from wonderwallai import Wonderwall wall = Wonderwall( topics=["Product questions", "Pricing"], sentinel_api_key="gsk_...", ) async def safe_chain_run(user_input: str, chain: ConversationChain): # Guard the input verdict = await wall.scan_inbound(user_input) if not verdict.allowed: return verdict.message # Run the chain result = chain.run(user_input) # Guard the output clean = await wall.scan_outbound(result) return clean.message
# Use the hosted API — no SDK installation needed curl -X POST https://wonderwallai-production.up.railway.app/v1/scan/inbound \ -H "Authorization: Bearer ww_live_abc123..." \ -H "Content-Type: application/json" \ -d '{"message": "How do I track my order?"}' # Response: # {"allowed": true, "action": "allow", "scores": {"semantic": 0.52}}
WonderwallAi is LLM-agnostic, framework-agnostic, and deploys anywhere Python runs.
Early adopters and builders who use WonderwallAi in production.
"We integrated WonderwallAi into our customer service bot in under an hour. The semantic router alone caught 90% of the jailbreak attempts we were seeing."
"The canary token system is brilliant. Zero false positives, and we caught a system prompt extraction attempt on day one. Exactly what we needed."
"We switched from a hosted API scanner to WonderwallAi and dropped our scan latency from 150ms to under 2ms. Plus our user data never leaves our infra."
Open-source SDK is free forever. Hosted API scales with you.
Need more? Enterprise plans with unlimited scans, custom rate limits, and SLA guarantees.
Everything you need to know about WonderwallAi.
Get started in under 5 minutes. Free forever for the SDK. No credit card required for the hosted API free tier.