Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 2 min read

Why We Built an Offline AST Security Gate That Reviews PRs in 16ms

Every developer has experienced SAST alert fatigue. You open a pull request with 30 lines of business logic, and the security scanner spits out 45 warnings: "Missing function docstring" "Variable name too short" "Line

Why We Built an Offline AST Security Gate That Reviews PRs in 16ms

Every developer has experienced SAST alert fatigue.

You open a pull request with 30 lines of business logic, and the security scanner spits out 45 warnings:

  • "Missing function docstring"
  • "Variable name too short"
  • "Line exceeds 88 characters"
  • "Potential vulnerability in unused test mock"

Developers quickly learn to ignore these alerts. And then, a real SQL injection or hardcoded Stripe secret slips into main because the real danger was buried under 400 lines of noise.

That is why we built Kavach AI.

GitHub logo rajrajak99 / kavach-ai

πŸ›‘οΈ Autonomous sub-16ms AST security gate with 0% false positives & 1-click surgical auto-patching for PRs

Kavach AI Logo

πŸ›‘οΈ Kavach AI

Autonomous High-Precision Code Armor & 1-Click Surgical Patcher

GitHub Stars Release: v1.4.1 CI Status Tests: 128/128 Passing License: PolyForm Noncommercial Python: 3.9+ False Positives: 0.0% AST Speed: Sub-16ms Compliance: SOC 2 Ready Web Console

Kavach 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.

⚑ Core Philosophy: Zero-Noise Precision

Most static code scanners overwhelm developers with hundreds of stylistic warnings (missing docstrings, trailing whitespace). Developers end up ignoring them.

Kavach AI operates on a strict zero-noise policy:

  1. Ignores Noise: Lockfiles (package-lock.json, poetry.lock), minified bundles, images, and formatting diffs are discarded automatically.
  2. Flags Real Hazards Only:
    • πŸ›‘οΈ Hardcoded Credentials & Tokens (CWE-798): AWS keys, GitHub PATs, OpenAI/Stripe secret keys in Python and JavaScript.
    • πŸ›‘οΈ Raw SQL Injections (CWE-89): Raw string interpolation inside queries.
    • πŸ›‘οΈβ€¦

πŸ›‘οΈ The Philosophy: 0% False Positives or Nothing

We set 3 strict engineering constraints:

  1. Sub-16ms Execution: Must run instantly inside your GitHub runner without external API latency.
  2. 0% Noise Policy: Only deterministic AST matches for critical hazards (CWE-89 SQLi, CWE-798 Secret Leaks, CWE-78 Command Injections). If it's not a verified vulnerability, we don't flag it.
  3. 1-Click Self-Healing: Instead of telling developers "Go fix this yourself", Kavach generates native GitHub commit suggestions that team leads can merge in 1 click right from the PR review UI.

⚑ Benchmark: 105,000 Lines of Code in 46 Seconds

We ran Kavach AI against an enterprise codebase of 105,024 lines of Python across 100 modules:

  • Scan Duration: 46.7 seconds
  • Throughput: 2,249 LOC / second
  • Peak RAM: 6.50 MB
  • False Positives: 0.0%

πŸš€ 30-Second Setup in GitHub Actions

You don't need an account, an API key, or a credit card. Just drop this into .github/workflows/kavach.yml:


yaml
name: Kavach AI Security Review
on: [pull_request]

permissions:
  contents: read
  pull-requests: write

jobs:
  kavach:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: rajrajak99/[email protected]
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}S
πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.