{"slug": "how-i-built-a-client-side-shield-for-ai-chatbots-open-source", "title": "How I Built a Client-Side Shield for AI Chatbots (Open Source)", "summary": "A developer built Shield by Vouch, an open-source client-side filter that blocks prompt injections and off-topic queries before they reach an LLM, saving API costs and preventing brand leaks. The tool, which runs with zero latency and no server-side calls, blocked 80% of off-topic queries in testing and is available on GitHub under an MIT license.", "body_md": "I was burning through API tokens on off-topic chatbot queries.\n\nEvery \"Who are you?\" = brand leak + wasted money.\n\nSo I built **Shield by Vouch** — a zero-cost, client-side filter that blocks prompt injections and off-topic queries **before** they hit your LLM.\n\nYou build an AI chatbot for your business. Users ask:\n\n**Every off-topic query = $0.002 gone.** 1000 queries = **$2 burned.**\n\n| Server-Side | Client-Side |\n|---|---|\n| Latency: ~100-500ms | Latency: 0ms |\n| Cost: API call already made | Cost: Zero if blocked |\n\n``` js\nconst shield = new VouchShield({\n  businessType: 'restaurant',\n  businessDesc: 'Italian food in Mumbai'\n});\n\nconst result = shield.check(\"Who are you?\");\n// { blocked: true, response: \"I can only help with our restaurant services...\" }\n```\n\nResults\n\n80% off-topic queries blocked client-side\n\nZero identity leaks\n\n$2 saved per 1000 blocked queries\n\nTry It\n\n🚀 [Live Demo](https://shield-by-vouch.vercel.app/)\n\n⭐ [GitHub](https://github.com/priyamdeepanshu-a11y/shield-by-vouch)\n\nMIT License. No signup. Single file drop-in.", "url": "https://wpnews.pro/news/how-i-built-a-client-side-shield-for-ai-chatbots-open-source", "canonical_source": "https://dev.to/frank_manvideo_6288cb2f1/how-i-built-a-client-side-shield-for-ai-chatbots-open-source-1f7d", "published_at": "2026-08-14 12:06:01+00:00", "updated_at": "2026-08-14 12:36:21.092337+00:00", "lang": "en", "topics": ["ai-safety", "ai-products", "developer-tools"], "entities": ["Vouch", "Shield", "GitHub", "MIT License"], "alternates": {"html": "https://wpnews.pro/news/how-i-built-a-client-side-shield-for-ai-chatbots-open-source", "markdown": "https://wpnews.pro/news/how-i-built-a-client-side-shield-for-ai-chatbots-open-source.md", "text": "https://wpnews.pro/news/how-i-built-a-client-side-shield-for-ai-chatbots-open-source.txt", "jsonld": "https://wpnews.pro/news/how-i-built-a-client-side-shield-for-ai-chatbots-open-source.jsonld"}}