Getting started
Run Kavach offline in two minutes, then connect Lyzr, Band and a real model.
Kavach attacks and hardens DiwaliMart Support, a tool-using support bot with four mock tools and fake customers. Seven agents share one room: three attack, three defend, one keeps score. Breaches are detected by code from the bot's tool-call log, and a patch is approved only if the exploits stop working and at least 90% of normal customer requests still succeed.
Run it offline
No keys needed. Scripted agents and a scripted target run the whole loop. You need Node 22+, pnpm 10 and uv.
git clone https://github.com/harshbhx/kavach.git && cd kavach
pnpm install
pnpm dev:offline # API :8000, dashboard :5173, this site :3000Open the dashboard at http://localhost:5173 and press Start live run, or pick sample_simulated_run.jsonl and press Replay. The sample is an offline run and is labelled as simulated. You can also watch a recorded run in the browser with no backend: /dashboard?demo=live plays the recorded live run (or the sample, labelled as simulated, until one is recorded).
Run it for real
Connect Lyzr and Band
pnpm bootstrapThe setup wizard asks for your Lyzr API key and user ID, your Band user API key and a model key. It creates the seven Lyzr agents from prompts/agents/, registers the seven Band agents, writes .env and agent_config.yaml (both gitignored) and checks every connection. Run it again with make -C backend check-setup to re-check. Details for each sponsor are in Sponsor integrations.
Check the target is breakable
make -C backend probe # needs >= 50% breach rate on guardrail v1If the target model refuses too much, pick a weaker TARGET_MODEL in .env.
Start a run
pnpm dev # API + target bot + dashboard + sitePress Start live run on the dashboard. Every run is saved to runs/<run_id>.jsonl and can be replayed; the audit report is at runs/<run_id>.report.md.
Record the demo
pnpm demo # keeps recording until a run passes the story check (breached, a patch vetoed, utility held)
pnpm --filter @kavach/web video # films the site and the run: runs/video/kavach-demo.mp4pnpm demo saves runs/demo_run.jsonl and fills the results table in the README.
Repository layout
| Path | What's there |
|---|---|
backend/ | Python API: target bot, scoring, agents, orchestrator, Lyzr and Band clients, setup wizard |
apps/dashboard/ | The live dashboard (Vite, React, shadcn/ui, Magic UI, React Bits, Aceternity) |
apps/web/ | This site: landing page and docs (Next.js + Fumadocs) |
packages/brand/ | The Guardrail K logo and design tokens |
prompts/, data/ | Agent prompts, the target's system prompt, mock data, attack library |
docs/ | The specs these pages are built from |
Where next
A run, step by step
Follow the sample run from the first probe to the report, with the events each step emits.
Guard policy
Every setting the Patcher can change, and what the bot sees when one refuses a call.
Configuration
Every .env setting, the three ways to run, and the commands.
The dashboard
What each panel shows, how to read a slip, and the links that open a recording.
Deploy
The site on Cloudflare, the bot in an Agent37 sandbox, the API anywhere Python runs.
Troubleshooting and FAQ
Fixes for the problems people hit, and why breaches are judged in code.