r/coolgithubprojects • u/rajrajak99 • 17m ago
[Python] Kavach AI – An offline AST security gate for PRs that scans diffs in 16ms (0% false positives)
https://github.com/rajrajak99/kavach-aiHey everyone,
Whenever our team opened a PR, our legacy security scanner would take 3-5 minutes and flag 40+ trivial warnings (like formatting or style issues) that nobody cared about. Real vulnerabilities (like an unescaped SQL parameter or a hardcoded token) would get lost in the noise.
So I spent the last few months building **Kavach AI** (https://github.com/rajrajak99/kavach-ai) — an open-source, offline AST security gate specifically designed for Python pull requests.
### Key highlights:
- **Sub-16ms Execution:** Operates on git unified diffs in memory using Python's native `ast` module without re-scanning entire codebases.
**0% Stylistic Noise:** It ignores lockfiles, bundles, and stylistic nits. It only flags verified dangerous sinks:
- Raw SQL injections (CWE-89)
- OS command execution (CWE-78)
- Leaked API keys / secrets (CWE-798)
- Resource leaks (unclosed file handles, CWE-775)
- **1-Click Self-Healing Patches:** It outputs native GitHub markdown suggestion blocks so you can fix and merge the security patch right from GitHub.
- **100% Air-Gapped:** Zero code is sent to external cloud APIs or LLMs.
You can drop it into any GitHub Action in 30 seconds:
```yaml
- name: Kavach AI Security Review
uses: rajrajak99/kavach-ai@v1.4.1
with:
fail-on: 'CRITICAL'