{"slug": "show-hn-kavach-ai-sub-16ms-ast-security-gate-with-0-false-positives", "title": "Show HN: Kavach AI – Sub-16ms AST security gate with 0% false positives", "summary": "Kavach AI v1.4.1, an offline in-memory AST-based security scanner, was posted to Show HN claiming a 0.0% false positive rate and 46.7-second scans of a 105,024-line Python codebase across 100 enterprise modules, with 6.50 MB peak engine RAM and 2,249 lines of code scanned per second. The tool flags CWE-798 hardcoded credentials, CWE-89 SQL injection, CWE-78 command injection, CWE-369 and CWE-95 runtime exceptions, and CWE-775 resource leaks, then emits native GitHub ```suggestion blocks for one-click patches and fails CI on critical findings. Kavach AI reports zero cloud dependency, running in the customer's GitHub runner, VPC or workstation, and positions itself as a SOC 2 and ISO 27001 compliance enabler.", "body_md": "**Autonomous High-Precision Code Armor & 1-Click Surgical Patcher**\n\nKavach AI is an autonomous, high-speed static security inspector and surgical code repair engine. Operating like an impenetrable armor across your **GitHub Pull Requests (CI/CD)**, local CLI, VS Code editor, and Web Console, it eliminates critical security hazards (CWE-89 SQLi, CWE-798 Secret Leaks, CWE-120 Buffer Overflows) and generates **1-click ready-to-merge patches** with zero-regression self-healing verification.\n\nMost static code scanners overwhelm developers with hundreds of stylistic warnings (missing docstrings, trailing whitespace). Developers end up ignoring them.\n\nKavach AI operates on a **strict zero-noise policy**:\n\n1. **Ignores Noise:** Lockfiles (`package-lock.json` ,`poetry.lock` ), minified bundles, images, and formatting diffs are discarded automatically.\n2. **Flags Real Hazards Only:**  - 🛡️ **Hardcoded Credentials & Tokens (CWE-798):** AWS keys, GitHub PATs, OpenAI/Stripe secret keys in Python and JavaScript.\n  - 🛡️ **Raw SQL Injections (CWE-89):** Raw string interpolation inside queries.\n  - 🛡️ **Arbitrary OS Command Injection (CWE-78):** Untrusted shell inputs via`os.system` /`child_process.exec` .\n  - 🔴 **Fatal Runtime Exceptions (CWE-369, CWE-95):** ZeroDivisionError crashes, dynamic`eval()` execution.\n  - ⚡ **Resource Descriptors Leaks (CWE-775):** Unmanaged`open()` handles missing`with` context managers.\n3. 🛡️ \n4. **Generates Instant Patches:** Kavach AI outputs native GitHub markdown```` ``` suggestion ```` blocks that team leads can merge in 1 click right inside the GitHub UI.\n\nFor high-growth startups and enterprise teams, **code privacy is non-negotiable**:\n\n- **100% Offline & In-Memory AST Engine:** Zero code, snippets, or metadata are ever uploaded to any 3rd party cloud or LLM vendor.\n- **Air-Gapped & Self-Hosted Ready:** Runs inside your own GitHub runner, VPC, or local developer workstation.\n- **SOC 2 & ISO 27001 Compliance Enabler:** Guarantees deterministic static checks before code reaches production branches without third-party data processing agreements (DPAs).\n\nTested on an enterprise codebase consisting of **105,024 lines of Python code** across 100 enterprise modules:\n\n| Metric | Kavach AI (v1.4.1) | Traditional Scanners (Bandit / Flake8) | Cloud SAST (Snyk / SonarQube) | \n|---|---|---|---|\n| **Scan Duration (105k LOC)** | **46.7 seconds** | 12.4 seconds | 3+ minutes (cloud queue) | \n| **Throughput** | **2,249 LOC / second** | ~8,000 LOC/sec (Regex only) | Cloud-limited | \n| **Peak Engine RAM** | **6.50 MB** | 45 MB | Cloud infrastructure | \n| **False Positive Rate** | **0.0% (Zero Noise)** | 28% – 35% false alarms | 15% – 25% | \n| **1-Click Auto-Remediation** | **YES (Surgical AST Patches)** | NO (Only error logs) | NO (Manual dev work) | \n| **Cloud Dependency** | **ZERO (100% Offline)** | Local | Mandatory Cloud Upload | \n\nAdd Kavach AI to any GitHub repository in **30 seconds** by creating `.github/workflows/kavach.yml`:\n\n```\nname: Kavach AI Security Review\n\non:\n  pull_request:\n    branches: [ main, master, dev ]\n  push:\n    branches: [ main, master ]\n\npermissions:\n  contents: read\n  pull-requests: write\n  issues: write\n\njobs:\n  kavach-ci:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout Code\n        uses: actions/checkout@v4\n        with:\n          fetch-depth: 0\n\n      - name: Set up Python 3.11\n        uses: actions/setup-python@v5\n        with:\n          python-version: '3.11'\n\n      - name: Kavach AI PR Reviewer\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        run: |\n          python ci_bot.py --fail-on CRITICAL\n```\n\n1. **Inspects Changeset in < 0.05s** without external network latency.\n2. **Posts an Official PR Review Comment** with exact line numbers and 1-click GitHub commit suggestions.\n3. **Populates the GitHub Step Summary** with executive metrics and CWE classifications.\n4. **Fails the CI status check** to block merging if Critical vulnerabilities are detected.\n\n```\n                  ┌───────────────────────────────┐\n                  │   Incoming Git Pull Request   │\n                  │   (git diff main...feature)   │\n                  └───────────────┬───────────────┘\n                                  │\n                                  ▼\n                  ┌───────────────────────────────┐\n                  │    DiffParser (Zero-Noise)    │\n                  │   - Filters lockfiles/assets  │\n                  │   - Extracts modified hunks   │\n                  └───────────────┬───────────────┘\n                                  │\n                                  ▼\n                  ┌───────────────────────────────┐\n                  │       Surgical Analyzer       │\n                  │   - Python & JS/TS Parsers    │\n                  │   - CWE-798 Credential Leaks  │\n                  │   - CWE-89 SQL Injections     │\n                  │   - CWE-78 Command Injections │\n                  │   - CWE-775 Descriptor Leaks  │\n                  └───────────────┬───────────────┘\n                                  │\n                                  ▼\n                  ┌───────────────────────────────┐\n                  │     1-Click Patch Engine      │\n                  │   - GitHub suggestion blocks  │\n                  │   - PR Commenter Bot (CI/CD)  │\n                  │   - Standalone .patch export  │\n                  └───────────────────────────────┘\n```\n\nClone the repository and install requirements:\n\n```\ngit clone https://github.com/rajrajak99/kavach-ai.git\ncd kavach-ai\npip install -r requirements.txt\n# Scan a directory and generate unified .patch\npython cli.py ./my-project --patch kavach.patch\n\n# Apply patch directly via git\ngit apply kavach.patch\nstreamlit run app.py\n```\n\nOpen `http://localhost:8502` in your browser.\n\n```\npytest -o pythonpath=. tests/\nkavach-ai/\n├── action.yml                  # GitHub Action specification (Composite)\n├── ci_bot.py                   # Automated CI/CD PR Reviewer & Commenter\n├── cli.py                      # Standalone high-speed Terminal CLI scanner\n├── app.py                      # Luxury Raycast/Linear Dark review workstation\n├── core/\n│   ├── __init__.py\n│   ├── diff_parser.py          # Unified Git diff & hunk pre-filtering\n│   ├── surgical_analyzer.py    # Zero-noise CWE & bug detection engine\n│   └── patch_validator.py      # Syntax and indentation patch validator\n├── samples/\n│   ├── __init__.py\n│   └── vulnerable_samples.py   # Multi-language test scenarios (Python + Node.js)\n├── tests/\n│   ├── __init__.py\n│   └── test_autopatch.py       # Comprehensive pytest test suite (4/4 passing)\n├── .github/\n│   └── workflows/\n│       └── kavach.yml          # Production CI workflow configuration\n├── .streamlit/\n│   └── config.toml             # Raycast/Linear Obsidian theme configuration\n├── requirements.txt            # Minimal production dependencies\n├── LICENSE                     # PolyForm Noncommercial 1.0.0\n└── README.md                   # Technical documentation\n```\n\n| CWE ID | Vulnerability Class | Language | Severity | Kavach AI Remediation | \n|---|---|---|---|---|\n| **CWE-798** | Hardcoded Credentials & Tokens | Python / JS | Critical | Moves secrets to environment variables | \n| **CWE-89** | SQL Injection (Raw formatting) | Python / JS | Critical | Converts to parameterized queries | \n| **CWE-78** | OS Command Injection | Python / JS | High | Converts string interpolation to discrete arrays | \n| **CWE-95** | Arbitrary Code Execution ( `eval` ) | JavaScript | Critical | Replaces with strict JSON parser | \n| **CWE-775** | Unmanaged Resource Descriptor | Python | Medium | Enforces `with open(...)` context manager | \n| **CWE-369** | Unchecked Zero Division | Python | High | Inserts defensive conditional guard | \n\nKavach AI is licensed under the **[PolyForm Noncommercial License 1.0.0](https://github.com/rajrajak99/kavach-ai/blob/main/LICENSE)**.\n\n- **Free for Community** : Free forever for individuals, students, open-source projects, and noncommercial research.\n- **Commercial Restrictions** : Commercial deployment, SaaS hosting, or commercial redistribution is strictly prohibited without a commercial license.\n- **Enterprise & Commercial Licensing** : For commercial use or organization subscriptions, contact**Raja Rajak** (`rajabhaiyarajak2008@gmail.com` ).\n\nCopyright (c) 2026 **[Raja Rajak (@rajrajak99)](https://github.com/rajrajak99)**. All rights reserved.", "url": "https://wpnews.pro/news/show-hn-kavach-ai-sub-16ms-ast-security-gate-with-0-false-positives", "canonical_source": "https://github.com/rajrajak99/kavach-ai", "published_at": "2026-11-23 05:23:53+00:00", "updated_at": "2026-11-23 05:44:36.413549+00:00", "lang": "en", "topics": ["ai-tools", "developer-tools", "ai-safety", "artificial-intelligence"], "entities": ["Kavach AI", "GitHub", "Bandit", "Flake8", "Snyk", "SonarQube", "Visual Studio Code", "OpenAI"], "also_reported_by": [], "takeaway": "Kavach AI v1.4.1 scans 105,024 lines of Python in 46.7 seconds at 6.50 MB peak RAM with a claimed 0.0% false positive rate, and installs via a .github/workflows/kavach.yml file that runs ci_bot.py --fail-on CRITICAL to block merges on critical CWEs.", "recommendation": null, "alternates": {"html": "https://wpnews.pro/news/show-hn-kavach-ai-sub-16ms-ast-security-gate-with-0-false-positives", "markdown": "https://wpnews.pro/news/show-hn-kavach-ai-sub-16ms-ast-security-gate-with-0-false-positives.md", "text": "https://wpnews.pro/news/show-hn-kavach-ai-sub-16ms-ast-security-gate-with-0-false-positives.txt", "jsonld": "https://wpnews.pro/news/show-hn-kavach-ai-sub-16ms-ast-security-gate-with-0-false-positives.jsonld"}}