Semgrep
$ semgrep Official Low Risksemgrep runs syntax-aware static security and bug-pattern rules across 30+ languages. Agents can invoke semgrep scan --json --metrics=off --quiet with local YAML rules or OSS registry packs and preview autofixes safely with --dryrun.
brew install semgrep Running semgrep scan --json locally inside the repo delivers full SAST findings directly with no MCP wrapper required.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --json, --sarif, --quiet, --metrics=off, --dryrun, and --error exit codes.
- Native
--json,--dryrun, and--metrics=offflags
Read-only by default unless --autofix (without --dryrun) is passed; --metrics=off disables usage telemetry.
- Telemetry opt-out via
--metrics=off; read-only default scan
Easy via brew or pip install semgrep on macOS and Linux (Windows requires WSL2).
- macOS and Linux native support; no native Windows binary
Bridges custom grep patterns and full SAST taint analysis with readable YAML rules.
- 30+ languages with YAML rule authoring and
--autofix
Backed by Semgrep Inc. (semgrep/semgrep) with strong OSS and AppSec adoption.
- Active vendor-backed repository
Thorough docs at semgrep.dev/docs/ covering CLI flags, rule syntax, and JSON schema.
- Comprehensive official documentation
Security, Auth & Guardrails
Optional SEMGREP_APP_TOKEN or ~/.semgrep/settings.yml for Semgrep Cloud; OSS local/registry rules run without login.
OSS CLI engine is free (LGPL-2.1); Semgrep Pro cross-file rules require a commercial license.
# Semgrep Agent Rules - Always pass `--json --metrics=off --quiet` for structured findings without telemetry or spinner noise. - Preview `--autofix` with `--dryrun` first; use local rule files (`--config ./rules.yaml`) in air-gapped environments.
Agent-Ready Command Recipes
Safe Read-Only Queries
semgrep scan --config p/default --json --metrics=off --quiet .
Scans the repository for common security vulnerabilities and emits structured JSON.
semgrep scan --config ./rules.yaml --autofix --dryrun --json .
Shows proposed fix replacements in JSON without writing to source files.
Controlled Writes & Previews
semgrep scan --config ./rules.yaml --autofix --metrics=off .
Writes automated rule fixes in-place after dry-run verification.
Strengths for Agents
- + Rich
--jsonSAST output across 30+ languages with--metrics=offtelemetry control. - + Supports safe
--autofix --dryrunpreviews before mutating files.
Caveats & Pitfalls
- !
--config autoorp/...packs fetch rules over HTTPS and send anonymized metrics unless--metrics=offand local YAML configs are used. - ! Native Windows is not supported without WSL.