Skip to content

Semgrep Rule from Example

Show a bad code example and get a static analysis rule that finds it everywhere.

Intermediate12h1 person17/20 fit
TL;DR

Build Semgrep Rule from Example for security engineers in ~12h with 1 person. Stack: Semgrep + LLM + Node.js.

Why it wins: Security leverage with a quick demo.

Build flow

01 · Problem
Writing static analysis rules requires niche expertise.
02 · Solution
Generate a rule from bad and good examples, test it against both and scan the repo for other instances.
03 · Build
  1. 1Collect examples
  2. 2Generate rule
  3. 3Test
  4. 4Scan repo
04 · Demo
Give one SQL injection example and find three more.

MVP checklist

  • Example input
  • Rule generation
  • Test cases
  • Repo scan

Tech stack

TechRole
SemgrepPattern-based code scanning
LLMLanguage model
Node.jsBackend runtime

Reference repos

Open-source projects you can build on. Links checked 2026-10-31.

Related ideas

More Devtools
  • Generate missing unit tests for the code changed in a PR

    Intermediate16h1–2
    LLMNode.jsVitest
    17/20
  • Score each PR for risk so reviewers focus where it matters

    Intermediate16h1–2
    GitHub APINode.jsLLM
    18/20
  • Catch quality drops when prompts or models change

    Intermediate14h1–2
    Node.jsLLMGitHub Actions
    17/20