SuperAPIAI Directory

semgrep

github.com · AI security

Semgrep is a fast, open-source static analysis tool that supports more than 30 programming languages for searching code, finding defects, and enforcing security guards and coding standards. Its rules are written in a way similar to source code, with no need to handle abstract syntax trees or complex regular expressions. Semgrep can run in IDEs, pre-commit checks, and CI/CD workflows, and by default analyzes code locally without uploading code. The Community Edition is suitable for ad-hoc use cases with a higher tolerance for false positives; for security purposes (SAST, SCA, or secrets scanning), the official recommendation is to use the Semgrep AppSec Platform, which provides enhanced capabilities such as cross-file/cross-function analysis, AI-assisted triage, and remediation guidance.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

Semgrep is a lightweight, open-source static analysis tool designed to scan code, find defects, and enforce security guards and coding standards at extremely high speed. It supports more than 30 languages, including Python, Java, JavaScript, Go, C, C++, Ruby, Rust, TypeScript, PHP, and more, and can run in IDEs, pre-commit checks, and CI/CD workflows.

Key capabilities:

  • Semantic code search: Semgrep rules are written similarly to everyday code, with no need to handle abstract syntax trees, complex regular expressions, or a dedicated DSL. For example, when searching for 2 , grep only matches the string 2, whereas Semgrep can match x = 1; y = x + 1 and other semantically equivalent code.
  • Multi-language support: Semgrep Code supports more than 30 languages; Semgrep Supply Chain supports 12 languages and 15 package managers to detect reachable vulnerabilities in third-party libraries.
  • Local analysis: By default, code is analyzed on the local computer or in the build environment, and code is not uploaded.
  • Community rule repository: The Semgrep Registry provides more than 2,000 community-driven rules covering security, correctness, and dependency vulnerabilities.
  • Ecosystem tools: These include Semgrep Playground (write and share rules online), Semgrep MCP Server (lets AI coding assistants run Semgrep scans directly, integrating with Cursor, VS Code, Windsurf, Claude Desktop, and more), Hooks (automatically trigger scans while coding), and plugins for Claude Code and Cursor.

How to use:

  • It is recommended to start with the Semgrep AppSec Platform, which provides a visual interface, demo projects, result triage and exploration workflows, and simplifies CI/CD setup.
  • You can also use the CLI: install via pipx, uv, Homebrew, or pip, or run it with Docker. After installation, run semgrep login to log in (optional), then run semgrep ci in the project root to scan source code and dependencies. You can also use -e to write queries interactively, for example semgrep -e '$X == $X' --lang=py path/to/src to check for comparisons in Python where the left and right sides are the same.

Use cases:

  • Developers perform code checks in the IDE or at the pre-commit stage.
  • Scan pull requests in CI/CD and report only the issues introduced by that request.
  • Ad-hoc analysis for security audits, penetration testing, and other scenarios with a higher tolerance for false positives.
  • Use the Semgrep AppSec Platform for organization-level SAST, SCA, and secrets scanning, and leverage the AI assistant (Semgrep Assistant) to assist with triage and remediation.

Limitations and notes:

  • In security scenarios, the Community Edition may miss many true positives because it can only analyze code within the boundaries of a single function or file. For security purposes, the official recommendation is strongly to use the Semgrep AppSec Platform, which provides cross-file, cross-function, and data-flow reachability analysis, reducing false positives by 25% and increasing true positive detection by 250%; Semgrep Assistant can further reduce noise by about 20% and provide step-by-step remediation guidance.
  • Using remote Registry configurations (such as --config=p/ci) reports anonymous rule metrics to semgrep.dev; when using local configuration files, metrics are sent only after the user logs in. This can be disabled via --metrics=off Disabled.
  • Semgrep is licensed under LGPL-2.1 and is developed and commercially supported by Semgrep, Inc.
  • Regarding details such as specific fees, pricing, and differences between platform versions, the official materials do not provide complete information; it is recommended to consult the official website.
Up/Down to navigate · Enter to open · ESC to closeBrowse all tools