Kavach developer docs
Kavach is a flight recorder for production software. It records what a service does, turns a failure into a file you can replay on a laptop, and checks a fix before it counts.
Start from where you are
- I want to see it work first
curl -fsSL https://www.thekavachlabs.com/install.sh | shQuickstart - A service crashed and I have the .kavach file
kavach replay incident.kavach --bin ./serviceFix an incident - I want my service to record its incidents
go get github.com/kavachlabs/kavach@latestInstrument a service - I'm building a feature and want proof it works
kavach contract init --spec SPEC.md --traffic traffic.kavachBuild a feature - My coding agent should do the fixing
claude mcp add kavach -- kavach mcpUse with AI agents - I run a fleet and need it handled in production
kavach-daemon --run-shadow --service paymentsKavach Enterprise
When a production service crashes, the evidence is usually gone: logs are partial, the input is hard to find, and the state that caused the bug has moved on. Kavach keeps that evidence. It records every input, clock read, random read, external query and output a service makes. When a step fails, it writes a small .kavach file: a fixture that replays the failure byte for byte, with no broker, database or network.
With that file you, or a coding agent, can:
- Reproduce the crash in microseconds, as often as you like.
- Fix it and check the fix with
kavach diff. A fix counts only when the recorded failure is gone and the fix also holds on at least 10 variants of the incident, so a patch that only handles the one recorded event fails. - Keep the fixture as a regression test that runs in CI.
- Build features against a contract: recorded traffic, the steps a feature should change, and invariants from the spec.
Kavach works with services in 12 languages (Go, Python, TypeScript and JavaScript, Rust, Java, C and C++, Ruby, PHP, Elixir, Haskell, OCaml and Julia), and with any other language that speaks its two small protocols.
What Kavach is for#
Kavach fits single-writer, journal-driven services: one process consumes a stream of inputs (queue messages, commands, requests) one at a time and folds them into state. Ledgers, order books, schedulers, workflow engines, stream processors and many queue workers have this shape.
It is not a tool for multi-writer or shared-state services, and it does not record and replay network traffic as "tapes". Kavach re-derives state from inputs; it does not stub dependencies from recorded responses.
How the docs are organised#
- Get started: install Kavach, run the demo, learn the terms.
- Guides: one task each, from instrumenting a service to running Kavach in CI.
- SDKs: the API for each language, and how to integrate a language with no SDK.
- Reference: every CLI command and flag, every verdict, the MCP tools, the
map.jsonschema and the journal format. - Enterprise: the sidecar daemon, Kubernetes operator and self-healing control plane.
Every page is also available as plain markdown: add .md to its URL, or use the link beside each page. The whole set is listed in /llms.txt for AI assistants.
Something wrong or missing on this page? Report it on GitHub, or write to hello@thekavachlabs.com.