Semgrep CLI vs WMDP
WMDP ranks higher at 62/100 vs Semgrep CLI at 57/100. Capability-level comparison backed by match graph evidence from real search data.
| Feature | Semgrep CLI | WMDP |
|---|---|---|
| Type | CLI Tool | Benchmark |
| UnfragileRank | 57/100 | 62/100 |
| Adoption | 1 | 1 |
| Quality | 1 | 1 |
| Ecosystem | 0 | 0 |
| Match Graph | 0 | 0 |
| Pricing | Free | Free |
| Capabilities | 14 decomposed | 9 decomposed |
| Times Matched | 0 | 0 |
Semgrep CLI Capabilities
Semgrep-core (OCaml engine) performs AST-based pattern matching against user-defined or curated rules to identify security vulnerabilities, code anti-patterns, and compliance violations. The engine parses source code into language-specific abstract syntax trees using tree-sitter and custom parsers, then matches patterns expressed in Semgrep's domain-specific language (YAML-based rule syntax) against the AST structure. This approach enables structural matching rather than regex-based detection, reducing false positives and enabling cross-language consistency.
Unique: Uses tree-sitter-based AST parsing with language-specific custom parsers for 30+ languages, enabling structural pattern matching that understands code semantics (function scope, variable binding, control flow) rather than relying on regex or token-based matching. The hybrid Python-OCaml architecture delegates computationally intensive matching to OCaml while maintaining a flexible Python CLI for workflow orchestration.
vs alternatives: Faster and more accurate than regex-based tools (Grype, Trivy) because it matches against AST structure; more flexible than signature-based scanners because rules can express complex syntactic patterns; lighter-weight than full symbolic execution tools (Coverity, Fortify) while still catching many real vulnerabilities.
Semgrep's taint analysis engine (available in Pro Engine) tracks data flow across function boundaries to detect vulnerability chains where untrusted input reaches a dangerous sink. The system constructs a dataflow graph by analyzing variable assignments, function parameters, return values, and object field mutations across the codebase. It identifies sources (user input, external data), sinks (SQL queries, command execution, file writes), and sanitizers (validation functions) to determine if tainted data can reach dangerous operations without proper sanitization.
Unique: Implements interprocedural taint analysis by constructing a dataflow graph from AST analysis, tracking variable bindings and function call chains to determine if untrusted data can reach dangerous sinks. The Pro Engine reduces false positives by ~25% and increases true positives by ~250% compared to single-function pattern matching by confirming actual reachability rather than just pattern presence.
vs alternatives: More precise than pattern-only matching (which flags all SQL queries regardless of input source) and faster than full symbolic execution tools because it uses lightweight dataflow analysis rather than constraint solving.
Semgrep includes language-specific parsers (built on tree-sitter and custom OCaml implementations) for 30+ programming languages. Each parser converts source code into an AST that the pattern matching engine can analyze. The system implements graceful error handling where parse errors in individual files do not stop the scan; instead, errors are logged and scanning continues on other files. This enables Semgrep to scan heterogeneous codebases with mixed languages and syntax variations without failing on unparseable code.
Unique: Implements language-specific parsers using tree-sitter (for most languages) and custom OCaml implementations (for performance-critical languages), with graceful error handling that allows scanning to continue even if individual files fail to parse. This architecture enables Semgrep to support 30+ languages without requiring language-specific scanning tools.
vs alternatives: More comprehensive language support than language-specific tools (like Pylint for Python or ESLint for JavaScript) because it handles multiple languages in a single tool; more robust than regex-based tools because it parses code into AST structure.
Semgrep includes an MCP server implementation that exposes scanning capabilities to AI models and LLM-based tools. The MCP server allows AI assistants to invoke Semgrep scans, retrieve findings, and analyze code patterns programmatically. This enables integration with AI-powered code review tools, automated remediation assistants, and LLM-based security analysis workflows. The server implements standard MCP protocols for tool invocation and result streaming.
Unique: Implements an MCP server that exposes Semgrep scanning capabilities to AI models and LLM-based tools, enabling integration with AI-powered code review and remediation workflows. The server implements standard MCP protocols for tool invocation, allowing AI assistants to invoke Semgrep scans and analyze findings programmatically.
vs alternatives: Enables AI-assisted code analysis by exposing Semgrep as an MCP tool; more integrated than separate AI and scanning tools because findings are directly available to AI models for reasoning and remediation.
Semgrep's OCaml engine tracks token positions and source locations during AST parsing and pattern matching, enabling precise reporting of finding locations (file, line, column, character offset). The system maintains a mapping between AST nodes and their source positions, allowing findings to be reported with exact character ranges. This enables IDE integration, inline code comments, and precise highlighting in web interfaces. The position tracking is implemented at the parser level and maintained through the entire analysis pipeline.
Unique: Maintains token and position tracking throughout the OCaml analysis pipeline, enabling precise character-level location reporting for findings. This architecture enables IDE integration, inline code highlighting, and automated remediation by providing exact token ranges rather than just line numbers.
vs alternatives: More precise than tools reporting only line numbers because it provides character offsets; enables better IDE integration and automated fixes because exact token ranges are available.
Semgrep provides a YAML-based domain-specific language (DSL) for expressing code patterns that work across multiple programming languages. Rules are defined in YAML with pattern syntax that abstracts away language-specific details (e.g., a pattern for 'function call' works identically in Python, JavaScript, and Go). The pysemgrep CLI parses rule files, validates syntax, and passes compiled rules to semgrep-core for matching. Users can write custom rules targeting their codebase, organization standards, or specific vulnerability patterns without modifying the core engine.
Unique: Provides a language-agnostic YAML-based DSL that abstracts away language-specific syntax details, allowing a single rule to match equivalent patterns across Python, JavaScript, Go, Java, and 25+ other languages. Rules are compiled to an intermediate representation that semgrep-core interprets, enabling rapid rule iteration without recompiling the core engine.
vs alternatives: More accessible than writing custom checkers in OCaml or C++ (as required by Clang Static Analyzer or Coverity) and more expressive than regex-based tools because rules can reference AST structure and semantic relationships.
The `semgrep ci` command integrates Semgrep into CI/CD workflows by scanning code, uploading findings to semgrep.dev, comparing against baseline scans, and enforcing organization-wide policies. The Python CLI (pysemgrep) orchestrates the workflow: it authenticates to Semgrep App using API tokens, fetches organization-specific rules and policies, runs the OCaml scanning engine, and reports results. The system can block CI builds based on policy rules (e.g., 'fail if critical vulnerabilities detected'), automatically triage findings based on organization rules, and track finding status across commits.
Unique: Implements a hybrid local-remote workflow where the OCaml scanning engine runs locally (fast, no data transmission) but policy enforcement and finding triage happen server-side via semgrep.dev API. This architecture enables organizations to enforce policies without exposing source code to the cloud while maintaining centralized policy management. The system tracks finding status across commits, enabling developers to see remediation progress.
vs alternatives: More flexible than GitHub's native code scanning (which only supports GitHub-native rules) because it supports custom rules and cross-language patterns; more integrated than standalone SAST tools because it provides built-in CI/CD orchestration and finding management.
Semgrep supports incremental scanning mode where it compares current scan results against a baseline (previous commit or main branch) to report only new or changed findings. The Python CLI manages baseline storage and comparison logic: it fetches the previous scan's JSON output, compares rule matches by file path and line number, and reports only findings that are new, moved, or changed in severity. This reduces noise in CI/CD by surfacing only actionable changes rather than all findings in the codebase.
Unique: Implements baseline comparison at the Python CLI layer by storing and comparing JSON scan results, enabling incremental reporting without requiring the OCaml engine to maintain state. This design allows flexible baseline sources (local files, semgrep.dev API, git history) while keeping the core scanning engine stateless.
vs alternatives: Simpler than tools requiring full codebase re-analysis (like some SAST tools) because it compares results rather than re-running analysis; more practical than git-diff-based filtering because it handles line number shifts and can detect moved findings.
+6 more capabilities
WMDP Capabilities
Evaluates LLM outputs against curated question sets spanning three distinct hazard domains (biosecurity, cybersecurity, chemical security) using domain-expert-validated benchmarks. The assessment framework maps model responses to risk levels within each domain, enabling quantitative measurement of dangerous capability presence. Responses are scored against rubrics developed by security domain experts to identify whether models can produce actionable harmful information.
Unique: Combines expert-validated questions across three distinct security domains (biosecurity, cybersecurity, chemical) into a unified benchmark framework, rather than treating each domain separately. Uses domain-expert rubrics for scoring rather than automated classifiers, ensuring nuanced assessment of harmful capability presence.
vs alternatives: More comprehensive than single-domain safety benchmarks (e.g., ToxiGen for toxicity) because it measures dangerous knowledge across multiple hazard categories simultaneously, enabling holistic safety evaluation.
Provides standardized evaluation infrastructure to measure the effectiveness of unlearning techniques (methods that remove dangerous capabilities from trained models) by comparing model performance before and after unlearning interventions. The framework isolates the impact of unlearning by holding the benchmark constant while varying the model state, enabling quantitative assessment of whether dangerous knowledge has been successfully suppressed.
Unique: Provides a standardized evaluation harness specifically designed for unlearning research, with built-in comparison logic and side-effect detection. Unlike generic benchmarks, it explicitly measures delta between model states and flags unintended capability loss.
vs alternatives: More rigorous than ad-hoc unlearning evaluation because it enforces consistent benchmark administration, statistical testing, and side-effect measurement across all methods being compared.
Implements a structured scoring framework where model responses to dangerous knowledge questions are evaluated against expert-developed rubrics that assess the degree of hazard (e.g., specificity, actionability, completeness of harmful information). Responses are scored on multi-point scales (typically 0-4 or 0-5) rather than binary pass/fail, capturing nuance in how dangerous a model's output actually is. Rubrics are domain-specific (biosecurity, cybersecurity, chemical) and developed by subject matter experts to ensure validity.
Unique: Uses domain-expert-developed multi-point rubrics rather than automated classifiers or binary labels, enabling nuanced assessment of dangerous knowledge severity. Rubrics are calibrated to distinguish between vague, incomplete, and highly actionable harmful information.
vs alternatives: More interpretable and defensible than black-box classifiers because rubric criteria are explicit and expert-validated; enables stakeholders to understand why a response received a particular score.
Analyzes patterns in how dangerous knowledge correlates across the three benchmark domains (biosecurity, cybersecurity, chemical security), identifying whether models that excel at suppressing one type of hazard tend to suppress others. The analysis uses statistical correlation and clustering techniques to reveal whether dangerous capabilities are independent or coupled in model behavior. This enables understanding of whether unlearning interventions have domain-specific or global effects.
Unique: Explicitly analyzes relationships between dangerous knowledge across domains rather than treating each domain independently. Enables discovery of whether hazards are coupled or independent in model behavior.
vs alternatives: Provides deeper insight than single-domain benchmarks by revealing how safety properties interact across different hazard categories, informing more effective unlearning strategies.
Manages the creation, validation, and versioning of benchmark questions and rubrics through a structured curation pipeline involving domain experts, adversarial testing, and iterative refinement. The pipeline ensures questions are sufficiently difficult to elicit dangerous knowledge without being unrealistic, and rubrics are calibrated through inter-rater agreement studies. Version control enables tracking of benchmark evolution and ensures reproducibility across research papers.
Unique: Implements a formal curation pipeline with expert validation and inter-rater agreement checks, rather than ad-hoc question collection. Versioning enables reproducible research and transparent tracking of benchmark evolution.
vs alternatives: More rigorous than informal benchmarks because it enforces expert review, inter-rater validation, and version control, reducing bias and enabling reproducible comparisons across papers.
Provides a unified interface for evaluating diverse LLM architectures (open-source models, API-based models, fine-tuned variants) by abstracting away implementation differences. The abstraction handles API calls (OpenAI, Anthropic, etc.), local inference (Hugging Face, Ollama), and custom model serving, enabling consistent benchmark administration across heterogeneous model types. This enables fair comparison between models with different deployment modalities.
Unique: Abstracts away differences between API-based, local, and custom-deployed models through a unified interface, enabling fair comparison without reimplementing benchmark logic for each model type.
vs alternatives: More flexible than model-specific benchmarks because it supports any LLM architecture without code changes, reducing friction for researchers evaluating new models.
Implements rigorous statistical testing to determine whether differences in dangerous knowledge scores between models or unlearning methods are statistically significant or due to random variation. Uses techniques like bootstrap confidence intervals, permutation tests, and effect size estimation to quantify uncertainty in benchmark results. This prevents overconfident claims about safety improvements that may not be robust.
Unique: Integrates formal statistical testing into the benchmark evaluation pipeline rather than relying on point estimates, ensuring claims about safety improvements are statistically justified.
vs alternatives: More rigorous than informal comparisons because it quantifies uncertainty and prevents overconfident claims about safety improvements that may not be robust to sampling variation.
Employs adversarial testing techniques to validate that benchmark questions reliably elicit dangerous knowledge and cannot be easily circumvented by prompt engineering. Red-teamers attempt to find questions that fail to elicit dangerous knowledge or rubric edge cases, and the benchmark is iteratively refined based on findings. This ensures the benchmark is robust to adversarial adaptation and captures genuine dangerous capabilities rather than surface-level patterns.
Unique: Incorporates formal red-teaming into the benchmark validation pipeline rather than assuming questions are robust, ensuring the benchmark remains effective against adversarial adaptation.
vs alternatives: More robust than static benchmarks because it actively searches for evasion techniques and iteratively refines questions, reducing the risk that models can circumvent the benchmark through prompt engineering.
+1 more capabilities
Verdict
WMDP scores higher at 62/100 vs Semgrep CLI at 57/100.
Need something different?
Search the match graph →