Opengrep: a Semgrep fork that kept the rules and changed the licence
🔎 Static code analysis engine to find security issues in code.
At a glance
- What is it?
- A static analysis engine forked from Semgrep and relicensed under LGPL 2.1, aimed at teams whose rules would otherwise stop working upstream. What is worth checking is the release naming, the taint work, and the language coverage that Semgrep does not have.
- Who is it for?
- Opengrep is a reasonable choice for a team already running Semgrep rules that does not want a commercial dependency, since the rule format and the standard outputs are the same. Two things to verify before you migrate.
- Can I use it commercially?
- Yes, with conditions. LGPL-2.1 is a weak copyleft licence: you can use it inside commercial and closed-source software, but if you distribute changes to its own files, you must publish those changes under the same licence.
- Is it still maintained?
- Yes. The repository received new commits within the last day.
- What is it written in?
- Mainly OCaml, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 24, 2026, and from our analysis. They are not legal advice.
Star history
- opengrep/opengrep3,389 ★ · +281
| Repository | 2026-09-24 | 2026-11-24 |
|---|---|---|
| opengrep/opengrep | 3.1k | 3.4k |
281 Stars in the last 61 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
A fork with two release lines running at once
The project describes itself as a fork of Semgrep under the LGPL 2.1 licence, created when Semgrep moved critical features behind a commercial licence, and the stated position is that advanced static analysis should stay open. Distribution is a self-contained binary compiled from OCaml, and releases are signed with Cosign. The versioning is where the care is needed, because the three most recent tags sit on two different lines. There is v1.30.0 on 2026-09-07 and v1.30.1-candidate on 2026-09-21 on the stable line, and v2.0.0-nopython-interfile.alpha.3 on 2026-09-11 on the next one. The alpha name says the 2.0 work is the interfile taint analysis, which is exactly the feature the fork advertises. The repository is not archived, its default branch is main, and the most recent push is dated 2026-10-03.
Your existing rules keep working unchanged
The four stated advantages are compatibility, standard output, governance, and duration. Compatibility is the one that decides migration: existing rules and rulesets work unchanged, so nothing has to be rewritten. Output is JSON and SARIF for integration, which is the same contract upstream consumers already parse. Governance is described as contributions accepted on merit rather than commercial interest, and the durability claim is a commitment to open source under LGPL 2.1. The fork kept more than its name: the repository root still carries semgrep.yml and semgrep.jsonnet alongside a .semgrepignore, the log file environment variable is accepted under either name, and the usual governance files are present, with CHANGELOG.md, CONTRIBUTING.md, CODE_OF_CONDUCT.md, SECURITY.md, and a COPYRIGHT file beside LICENSE. A separate OPENGREP.md holds the full list of improvements since the fork.
Taint analysis is the headline feature
The improvement the project leads with is interfile-free taint tracking, enabled by a flag rather than by default: the capability is named superior taint analysis under --taint-intrafile, and the four parts of it are specific. Constructor and field assignment tracking follows a value into the fields of an object it was built with. Inter-method taint flow carries a tainted argument through a call rather than stopping at the boundary. Higher-order function support is claimed across 12 languages, which is what makes a taint source inside a callback reachable. Collection method tainting covers map, filter, and reduce, so a tainted element in a list stays tracked when the list is transformed. Two wiki pages back this up, one on intrafile tainting and one on higher-order functions, and the interfile part is what the 2.0 alpha tag is named for, which is the clearest signal about what is still missing.
Language coverage is where the fork diverges
The language list is the concrete difference, and it is stated by comparison with upstream editions. Visual Basic is supported and is described as unavailable in Semgrep CE or Pro. Apex and Elixir are supported and were not in Semgrep CE. Three existing languages are improved rather than added: Clojure gains tainting support, PHP moves to 8.4, and C# moves to 14, with separate wiki pages for C# 12, 13, and 14, for PHP 7.1 through 8.4, and for Visual Basic. The full list is longer than the advertised number of thirty plus: Apex, Bash, C, C++, C#, Clojure, Crystal, Dart, Dockerfile, Elixir, Go, HTML, Java, JavaScript, JSON, Jsonnet, JSX, Julia, Kotlin, Lisp, Lua, OCaml, PHP, Python, R, Ruby, Rust, Scala, Scheme, Solidity, Swift, Terraform, TSX, TypeScript, Visual Basic, XML, and YAML, plus a Generic mode that covers templating languages such as ERB and Jinja.
The install script is piped from main, and its example version is old
Installation is a one-liner on each platform, which is convenient and worth reading twice.
curl -fsSL https://raw.githubusercontent.com/opengrep/opengrep/main/install.sh | bashCloning the repository and running ./install.sh does the same thing without the pipe, and the Windows path uses PowerShell with irm piped into iex. The versioned PowerShell form passes a release tag explicitly, and the example in the documentation passes v1.16.0, which is many minor versions behind the current 1.30 line and the 2.0 alpha. Manual installs take the binaries from the releases page instead, with one platform note: the Windows package holds opengrep.exe and the DLLs it needs, and they have to stay together in the directory you install them to. The repository also ships INSTALL.md for building from source.
A scan only reads files git already tracks
The getting-started output states its own scope in a line that is easy to skim past: the scan reports itself as scanning one file, only git-tracked, with one code rule. Untracked files are therefore invisible to a scan unless they are added, which is a real behaviour difference from a linter that walks the working tree. The rule in the example is a YAML document with an id, a pattern of $VAR.unwrap(), a message, a language list, and a severity, and the run is a single command.
❯ opengrep scan -f rules code/rustThe printed result carries the rule id, the message, and the source line, followed by a summary line stating how many rules ran on how many files. Machine-readable output goes through a separate flag.
❯ opengrep scan --sarif-output=sarif.json -f rules codeThe SARIF document reports version 2.1.0 and, in each result, a fingerprint under matchBasedId/v1, which is what lets a finding be tracked across runs instead of being reported as new every time.
Logging and colour have documented edge cases
Two small behaviours are specified precisely enough to be useful. For logging, setting OPENGREP_LOG_FILE, or the older SEMGREP_LOG_FILE, to a path copies what the tool prints on stderr at the same level, which means warnings and errors by default and more with --verbose or --debug. The file is truncated on every run and its directory is created for you, and nothing is written at all when the variable is unset. The failure case is defined too: a path that cannot be written produces a warning and the run continues without the copy, so a bad log path never blocks a scan. Colour follows the usual convention with one addition. Output is coloured when stderr is a terminal, NO_COLOR turns it off, and --force-color turns it on regardless, which matters in CI where stderr is a pipe.
Building from source starts with make install-deps
The Makefile documents its own prerequisites at length, which is the clearest sign that the build is a real toolchain rather than a script. For OCaml it expects ocamlc and ocamlopt, currently at version 5.5.0, plus dune and opam. For the C side it expects gcc, ld, and pkgconfig, along with libraries including PCRE and gmp. On top of that come make, git, docker, and bash, and the intended sequence is make install-deps to fetch the OPAM packages the engine needs and then make all to compile. Portability is a stated goal across Linux distributions, macOS on both architectures, and Windows under WSL or Cygwin, with Cygwin detected by uname so that a .exe suffix is appended to built binaries. The rest of the tree supports that: a flake.nix with a lock file for Nix, an .envrc for direnv, .pre-commit-hooks.yaml so other repositories can consume the hooks, a TCB directory, and separate test, tests, tools, perf, and stats directories.
Editorial conclusion
Opengrep is a reasonable choice for a team already running Semgrep rules that does not want a commercial dependency, since the rule format and the standard outputs are the same. Two things to verify before you migrate. Decide which release line you are on, because a 1.30 release candidate and a 2.0 alpha are both recent and the alpha is named after the interfile taint work. And keep in mind that a scan reads only git-tracked files, so anything uncommitted is invisible to the engine until it is added.
Frequently asked questions
What is Opengrep?
A static code analysis engine, written in OCaml and distributed as self-contained signed binaries, forked from Semgrep and released under the LGPL 2.1 licence. It is backed by a consortium of application security organisations and describes itself as the most advanced open source SAST engine.
How do I install Opengrep?
On Linux or macOS, curl -fsSL the install.sh from the repository's main branch and pipe it to bash, or run ./install.sh from a clone. On Windows PowerShell, pipe irm to iex, optionally with a -Version argument, and keep opengrep.exe with its DLLs in the same directory.
Do my Semgrep rules work with Opengrep?
Yes. Compatibility with Semgrep rules is one of the stated key advantages, and existing rules and rulesets work unchanged. Output is JSON and SARIF, and the repository still ships semgrep.yml, semgrep.jsonnet, and a .semgrepignore.
Which languages does Opengrep support that Semgrep does not?
Visual Basic is supported and is described as unavailable in Semgrep CE or Pro, while Apex and Elixir are supported and were not in Semgrep CE. Clojure gains tainting support, PHP goes to 8.4, and C# goes to 14, alongside thirty-plus other languages and a Generic mode for templates such as ERB and Jinja.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/opengrep-opengrep)Star history chart for your README
[](https://hysenlabs.com/projects/opengrep-opengrep)Was this useful?