# How I Built a Client-Side Shield for AI Chatbots (Open Source)

> Source: <https://dev.to/frank_manvideo_6288cb2f1/how-i-built-a-client-side-shield-for-ai-chatbots-open-source-1f7d>
> Published: 2026-08-14 12:06:01+00:00

I was burning through API tokens on off-topic chatbot queries.

Every "Who are you?" = brand leak + wasted money.

So I built **Shield by Vouch** — a zero-cost, client-side filter that blocks prompt injections and off-topic queries **before** they hit your LLM.

You build an AI chatbot for your business. Users ask:

**Every off-topic query = $0.002 gone.** 1000 queries = **$2 burned.**

| Server-Side | Client-Side |
|---|---|
| Latency: ~100-500ms | Latency: 0ms |
| Cost: API call already made | Cost: Zero if blocked |

``` js
const shield = new VouchShield({
  businessType: 'restaurant',
  businessDesc: 'Italian food in Mumbai'
});

const result = shield.check("Who are you?");
// { blocked: true, response: "I can only help with our restaurant services..." }
```

Results

80% off-topic queries blocked client-side

Zero identity leaks

$2 saved per 1000 blocked queries

Try It

🚀 [Live Demo](https://shield-by-vouch.vercel.app/)

⭐ [GitHub](https://github.com/priyamdeepanshu-a11y/shield-by-vouch)

MIT License. No signup. Single file drop-in.
