Krait
AI-assisted security verification for Solidity smart contracts. Not a scanner — a structured methodology with 101 heuristics, 26 analysis modules, and 8 kill gates. In its last measured version (v8) it reported 10 true positives and 0 false positives on a 5-contest blind batch of past Code4rena contests, while finding 15.2% of the known High/Medium issues (how this was measured). Runs inside Claude Code. Free.
At a Glance
| |
|---|
| Current version | v8.2 (kill-gate parity, Impact Premise, rescan + per-contract recall phases) |
| Measured baseline | v8 — five contests (numbers 46–50 in the historical registry). v8.1/v8.2 are not yet re-measured (why) |
| Detection angles | 16 per function (4 lenses × 4 mindsets) |
| Heuristics | 43 original + 58 extended (from open-source community) |
| Analysis modules | 15 deep-dive module files + 26 inline modules (A-X) |
| Audit-trail rules | R8 / R10 / R11 / R12 / R15 / R16 — exercised per finding (v8.1) |
| Domain primers | 7 (DEX, Lending, Staking, GameFi, Bridges, Proxies, Wallets) |
| Kill gates | 8 automatic + Impact Premise + 10 FP patterns (identical on both surfaces, parity-tested) |
| Shadow audits | v8: 10 TPs / 0 FPs, 15.2% recall on 5 contests. All 50 contests, v1–v8 pooled: ≈49% precision |
| Full methodology | METHODOLOGY.md — every technique, publicly documented |
Two Local Surfaces, One Web Platform
This repo ships two Claude Code surfaces. They answer different questions, and you can run either or both.
| Audit pipeline (/krait) | Checklist plugin (/krait:scan) |
|---|
| Question it answers | "What bugs are in this code?" | "Am I ready for an audit?" |
| Method | Multi-phase adversarial reasoning from first principles | 845 curated checks across 39 DeFi verticals |
| Output | Exploit traces with file:line, severity, suggested fix | Per-check verdicts, importable assessment JSON |
| Bar | Zero false positives — 8 kill gates try to disprove every finding | Coverage — every applicable check gets a verdict |
| Lives in | .claude/, src/ | checklist/ |
| Install | ./scripts/install.sh | /plugin marketplace add ZealynxSecurity/krait |
Use the checklist to find out where you stand before an audit; use the audit pipeline to find the actual bugs.
Web platform (krait.zealynx.io) — AI-assisted security verification with per-check prompt generation, auto-parsed verdicts, shareable reports, and PDF export. Both local surfaces produce output you can upload to it. Also free.
┌─────────────────────────────────────────────────────────────────────────┐
│ /krait (local) krait.zealynx.io (web) │
│ ───────────── ──────────────────── │
│ Run audit in Claude Code 845+ checks across 39 DeFi types │
│ 4-phase pipeline "Verify with AI" per check │
│ Findings with exploit traces ├─ Generates tailored prompt │
│ .audit/krait-findings.json ├─ Run in any IDE AI │
│ │ ├─ Paste response back │
│ └──► Upload to dashboard └─ Auto-detect verdict + files │
│ Shareable reports Shareable reports + PDF export │
│ Track over time Combined readiness score │
└─────────────────────────────────────────────────────────────────────────┘
Built by Zealynx Security — 30+ DeFi protocol audits.
What Krait Does
Krait is a structured audit methodology encoded as Claude Code skills. When you run /krait on a Solidity project, it executes a 4-phase pipeline:
- Recon — maps the architecture, extracts the AST, scores every file by risk, selects protocol-specific detection primers
- Detection — analyzes each high-risk function from 16 angles (4 technical lenses x 4 independent mindsets), with consensus scoring across passes
- Rescan — a second broad pass told exactly what pass 1 found, so its attention goes to the gaps. Skips itself if pass 1 found nothing above Informational
- Per-contract — one agent per inheritance cluster at maximum depth, countering the dilution that makes a whole-codebase agent skim everything after the two most interesting files
- State Analysis — finds coupled state pairs and mutation patterns that per-function scanning misses
- Verification — 8 kill gates try to disprove every finding, and the Impact Premise gate demands a harm statement (WHO loses WHAT) before any trace. Only findings with a concrete exploit trace survive