semgrep /semgrep

Lightweight static analysis for many languages. Find bug variants with patterns that look like source code.

★ 17,694⑂ 1,181👁 118⑃ 8,623● 3,352▤ 352
CLGPL-2.1Created 2019-12-13semgrep.dev
Download: Release v1.185.0Release-1.185.0 ↓1.185.02026-11-10
+7
Daily
17,694
stars
1,181
forks
118
watchers
8,623
prs
3,352
issues
352
releases

README

Code scanning at ludicrous speed.


  
    
  
  
    
  
  
      
  
  
    
  
  
    
  
  
    
  
  
    
  
  
    
  
  
    
  



Semgrep is a fast, open-source, static analysis tool that searches code, finds bugs, and enforces secure guardrails and coding standards. Semgrep supports 30+ languages and can run in an IDE, as a pre-commit check, and as part of CI/CD workflows.

Semgrep is semantic grep for code. While running grep "2" would only match the exact string _2_, Semgrep would match x = 1; y = x + 1 when searching for _2_. Semgrep rules look like the code you already write; no abstract syntax trees, regex wrestling, or painful DSLs.

Note that in security contexts, Semgrep Community Edition will miss many true positives as it can only analyze code within the boundaries of a single function or file. If you want to use Semgrep for security purposes (SAST, SCA, or secrets scanning), the Semgrep AppSec Platform is strongly recommended since it adds the following critical capabilities:

1. Improved core analysis capabilities (cross-file, cross-function, data-flow reachability) that greatly reduce false positives by 25% and increase detected true positives by 250%
2. Contextual post-processing of findings with Semgrep Assistant (AI) to further reduce noise by ~20%.  In addition, Assistant enriches findings with tailored, step-by-step remediation guidance that humans find actionable 80% of the time.
3. Customizable policies and seamless integration into developer workflows, giving security teams granular control over where, when, and how different findings are presented to developers (IDE, PR comment, etc.)

The Semgrep AppSec Platform works out-of-the-box with 20000+ proprietary rules across SAST, SCA, and secrets. Pro rules are written and maintained by the Semgrep security research team and are highly accurate, meaning AppSec teams can feel confident bringing findings directly to developers without slowing them down.

Semgrep analyzes code locally on your computer or in your build environment: by default, code is never uploaded. Get started →.




 Language support

Semgrep Code supports 30+ languages, including:

Apex · Bash · C · C++ · C · Clojure · Dart · Dockerfile · Elixir · HTML · Go · Java · JavaScript · JSX · JSON · Julia · Jsonnet · Kotlin · Lisp · Lua · OCaml · PHP · Python · R · Ruby · Rust · Scala · Scheme · Solidity · Swift · Terraform · TypeScript · TSX · YAML · XML · Generic (ERB, Jinja, etc.)

Semgrep Supply Chain supports 12 languages across 15 package managers, including:

C (NuGet) · Dart (Pub) · Go (Go modules, go mod) · Java (Gradle, Maven) · Javascript/Typescript (npm, Yarn, Yarn 2, Yarn 3, pnpm) · Kotlin (Gradle, Maven) · PHP (Composer) · Python (pip, pip-tool, Pipenv, Poetry) · Ruby (RubyGems) · Rust (Cargo) · Scala (Maven) · Swift (SwiftPM)

For more information, see Supported languages.

 Getting started 🚀

1. From the Semgrep AppSec Platform
2. From the CLI

For new users, we recommend starting with the Sem

Top issues

Discussions

Latest release

Release v1.185.0 v1.185.0 2026-11-10
1.185.0 - 2026-11-10

  Added

- PHP: Improved virtual call resolution for basic trait composition. (CODE-9176)
- Supply Chain: a requirements.txt dependency declared as a version range (litellm=1.10) or with no version (flask) now produces a finding for every advisory whose affected versions overlap the declared range, in both the Python and native resolvers. Such a finding has no single installed version to confirm, so it needs review. A range line next to a pinned copy of the same package produces no finding of its own, since the pinned copy names the installed version. (SC-4243)
- Secrets:

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON