惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 叶小钗
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Microsoft Security Blog
Microsoft Security Blog
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
美团技术团队
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
aimingoo的专栏
aimingoo的专栏
腾讯CDC
WordPress大学
WordPress大学
Apple Machine Learning Research
Apple Machine Learning Research
F
Fortinet All Blogs
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
小众软件
小众软件
Engineering at Meta
Engineering at Meta
博客园_首页
B
Blog RSS Feed
D
Docker
M
MIT News - Artificial intelligence
爱范儿
爱范儿
I
InfoQ

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
OpenGuard AI
Suyash Sriva · 2026-05-21 · via DEV Community

This is a submission for the Gemma 4 Challenge: Build with Gemma 4

What I Built

OpenGuard is a developer-centric, self-hosted static code analysis (SCA) platform designed to act as an open-source alternative to tools like SonarQube. Built with OpenGrep (a Semgrep fork), FastAPI, PostgreSQL, and React, it enables developers to scan codebases, compute real-time project security health scores, track issues across historical scans, and manage remediation efforts via a native Jira-style Kanban board.

To bridge the gap between finding a vulnerability and fixing it, OpenGuard features an AI-driven remediation pipeline. With a single click on any code vulnerability, OpenGuard packages the entire target file, localizes the error coordinates, and calls a local Gemma 4 instance to generate high-fidelity, contextual explanations and beautified drop-in code fixes.

Demo

Our platform features a highly responsive, premium dashboard engineered with an editorial design aesthetic. The UI utilizes a warm parchment background, bold ink-black typography, and serif-led headings for a state-of-the-art experience:

  • Interactive Project Dashboard: A clean visual split of issues by severity level (Critical, High, Medium, Low) featuring semantic color-coding. The dashboard includes a dynamic, natively animated SVG Security Health Gauge and an interactive historical trend chart with hover-activated data tooltips.
  • Kanban Board: A Jira-like ticket board allowing developers to transition issues between Backlog, Todo, In Progress, and Done. Each issue card features visual tags showing its historical persistence, severity badges, and details.
  • AI Fix Interface: An interactive code viewer inside the ticket details that displays the native explanation alongside a pre-formatted, syntax-highlighted code block containing the recommended fix.
  • End-User Packaging: The entire infrastructure is packaged into a seamless, single-command Docker Compose environment with an easy-to-install Python CLI (openguard scan) for scanning local repositories.

OpenGuard Real Demo : https://youtu.be/i0CUZcxYty4?si=lJJSpj3mKlDkedHb

  1. Application Dashboard
    Application Dashboard

  2. Workspace
    Workspace

  3. Project overview
    Project overview

  4. List of issues in the scan.
    List of issues

  5. AI suggest explanation & fix
    AI suggest explanation & fix

Code

The complete source code for OpenGuard is open-source and available on GitHub:

How I Used Gemma 4

OpenGuard leverages the local inference capabilities of Gemma 4 (gemma4:e4b) served via Ollama.

Why Gemma 4?

Vulnerabilities are rarely self-contained; they require systemic understanding of the surrounding code. We chose the Gemma 4 9B parameter model because of its excellent performance in coding tasks and its ability to process large instruction sets locally.

Implementation Details:

  1. Large Context Processing (128K Tokens): In order to provide accurate fixes without hallucinating, we supply Gemma 4 with the entire source file (up to a 128K context limit) rather than just the isolated line of code. This allows the model to understand local variables, imports, and architectural patterns.
  2. Structured JSON Output: To build a reliable API, we configured the Ollama request with the format constraint json and structured the prompt to guarantee responses matching:
   {
     "explanation": "Brief context on why this is a vulnerability.",
     "code_fix": "The fully corrected file or function block."
   }

Enter fullscreen mode Exit fullscreen mode

This ensures that the frontend can parse the response natively and present the suggested fix in a beautiful, copyable code block without raw markdown delimiters (`) bleeding into the UI.

  1. Optimized Development Loop: The AI responses are cached in the PostgreSQL database so that recurring views are instant, with a --force flag implemented to let developers request a fresh generation when needed.

Gemma 4 provides the speed of local developer workflows with the intelligence of a security expert, making local static analysis interactive and highly actionable.


Reach Out

Built by Suyash Srivastava. If you have any feedback, questions, or are interested in collaborating on OpenGuard or similar AI-driven developer tooling, I'd love to hear from you!

📧 Contact me at: suyashmtech+openanlyzer@gmail.com