semgrep
Skill by trailofbits
Runs a Semgrep security scan over a codebase after showing the planned rulesets for approval. It is for developers and auditors who want static analysis with merged SARIF output.
Install semgrep
Built from the published package, never by AI.
git clone --depth 1 https://github.com/trailofbits/skills /tmp/skills && mkdir -p ~/.claude/skills && cp -r /tmp/skills/plugins/static-analysis/skills/semgrep ~/.claude/skills/semgrepRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/trailofbits/skills /tmp/skills && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/skills/plugins/static-analysis/skills/semgrep ~/.gemini/antigravity-cli/skills/semgrepAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
This skill runs a Semgrep security scan over a codebase. It detects the languages in the target, selects rulesets, and presents the plan for explicit user approval before any scan starts. After approval, it runs scripts/run-scans.sh, which batches the semgrep processes, writes scans.json, and merges the output to SARIF.
It supports two scan modes: "run all" for full ruleset coverage, and "important only" for security findings at medium-to-high confidence and impact. It uses Semgrep Pro for cross-file taint analysis when Pro is available. The source says it is aimed at security audits, vulnerability searches and static analysis, and it notes a workflow version, /static-analysis:semgrep-scan, that skips the approval gate.
Written from the project's SKILL.md and checked against it.
What it can do
- Language detectionDetects the languages in the target codebase before selecting rulesets.
- Approval gatePresents exact rulesets, target, engine and mode and waits for explicit approval before scanning.
- Scan modesOffers a run-all mode for full coverage and an important-only mode for medium-to-high security findings.
- Semgrep Pro checkChecks for Semgrep Pro and uses cross-file taint analysis when it is available.
- SARIF mergeMerges scan output into a single results.sarif file in the output directory.
- Failure reportingRecords rulesets that failed or were skipped in scans.json so partial scans are visible.
What you need
- Semgrep CLI
- Semgrep Pro for cross-file taint analysis (optional)
- uv for the merge script
Try asking
- Scan this codebase for vulnerabilities with Semgrep in important-only mode.
- Run a security audit with Semgrep and show me the plan before scanning.
- Use Semgrep to find bugs in the src folder and merge the results to SARIF.
Good to know
- Semgrep Pro is needed for cross-file data flow tracking; OSS mode cannot track data flow across files.
- The source says the scan waits for explicit approval of the ruleset plan, unlike the workflow command.
- Results from failed or skipped rulesets are listed in scans.json rather than included as complete results.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: plugins/static-analysis/skills/semgrep/SKILL.md, plugins/static-analysis/skills/semgrep/scripts/merge_sarif.py, plugins/static-analysis/skills/semgrep/scripts/run-scans.sh, plugins/static-analysis/skills/semgrep/scripts/test_merge_sarif.py. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
Allowed tools: Bash Read Glob AskUserQuestion TaskCreate TaskList TaskUpdate
-
SKILL.md15 KB -
agents/openai.yaml229 B -
assets/trail-of-bits-mark.svg3 KB -
references/rulesets.md8 KB -
references/scan-modes.md9 KB
Show all 9 files
-
scripts/merge_sarif.py14 KB -
scripts/run-scans.sh34 KB -
scripts/test_merge_sarif.py22 KB -
workflows/scan-workflow.md24 KB
Alternatives to semgrep
All alternatives →Retrieves lab biomarker results and clinician notes from Function Health through its FHIR API. It is for people who want an AI assistant to review their own lab history and notes.
Gives an AI assistant a methodology for finding and exploiting privilege escalation weaknesses on Windows systems during authorized penetration tests. It is for security testers and defenders validating escalation paths.
Guides the assistant through designing, debugging and hardening GitHub Actions CI/CD workflows. It is aimed at teams that run production pipelines on GitHub.
Develops evidence-backed structural security hardening proposals from disclosures, findings, source code, or Codex Security scans. It is for teams that need systemic fixes and architectural tradeoffs.
Claude Security scans code for security issues with Claude Code. It covers whole repositories, branch or pull request diffs, single commits, and existing findings from SARIF files or earlier reports.
Turns vulnerability notes, disclosure reports, PoCs, source code, or Codex Security findings into self-contained vulnerability reports. Built for security researchers who need claims the evidence supports.
Compare with function_health, windows-privilege-escalation or github-actions-advanced
semgrep: common questions
Does this skill send telemetry during scans?
The source says every semgrep command includes --metrics=off to prevent telemetry, and it avoids --config auto for the same reason.
What is the difference between run all and important only?
Run all reports every severity level. Important only pre-filters to WARNING and ERROR and post-filters to security findings with medium or high confidence and impact.
Can the scan modify my code?
The source says the scan is read-only over the target, with no --autofix, and all writes stay inside the output directory.
How do I install semgrep?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is semgrep free?
The code is published under the CC-BY-SA-4.0 licence. The service it connects to may have its own pricing.
Is semgrep safe to use?
It scores 92 of 100. Grades: maintenance A, licence C, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to semgrep?
Similar skills: function_health, windows-privilege-escalation, github-actions-advanced, propose-security-hardening.
