Skip to content
mcp/skillhub

Agent Skill

Semgrep skill

semgreptrailofbits/skillsplugins/static-analysis/skills/semgrep/SKILL.md

Runs a Semgrep security scan over a codebase: detects languages, selects rulesets, presents the plan for explicit approval, then runs every approved ruleset through scripts/run-scans.sh, which batches the semgrep processes and writes scans.json, and merges the output to SARIF. Supports two scan modes, "run all" for full ruleset coverage and "important only" for security findings at medium-to-high confidence and impact. Uses Semgrep Pro for cross-file taint analysis when it is available. Use when asked to scan code for vulnerabilities, run a security audit with Semgrep, find bugs, or perform static analysis. For the same scan without the approval gate, use the /static-analysis:semgrep-scan workflow.

7.7kCC-BY-SA-4.0

always on

151 tokname + description

once used

3,434 tokSKILL.md body

bundled files

83 scripts

repo stars

7.7kGitHub

Install the Semgrep skill

Skills CLI (Claude Code, Codex, Cursor and others)

npx skills add https://github.com/trailofbits/skills --skill semgrep

Claude Code, by hand (all projects)

git clone --depth 1 https://github.com/trailofbits/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -R /tmp/skills/plugins/static-analysis/skills/semgrep ~/.claude/skills/semgrep

For one project only, copy the folder into .claude/skills/ in that project instead. The agent picks it up when a task matches its description.

What it costs your context

Agent Skills load in three steps. Tokens counted with the o200k tokenizer; your model's count will differ a little.

WhenWhat loadsCost
Every sessionName and description151 tok
When the agent uses itThe SKILL.md instructions3,434 tok
Only if opened8 bundled files (112 KB)varies

Until it is used, semgrep costs about 9.0× less than the median MCP server we measured (1,362 tokens on every turn). Installing all 97 skills from trailofbits/skills would load 7,555 tokens of descriptions. Skills vs MCP study

Checks

  • Ships scripts the agent can run. Read them before installing.

Pre-approved tools (allowed-tools): Bash, Read, Glob, AskUserQuestion, TaskCreate, TaskList, TaskUpdate. The agent can use these without asking while the skill is active.

Checked 2026-10-22 · method

What's inside

The headings of its SKILL.md. Read the full file on GitHub.

  • Semgrep Security Scan
  • Essential Principles
  • When to Use
  • When NOT to Use
  • Output Directory
  • Prerequisites
  • Scan Modes
  • Orchestration Architecture
  • Running it as a Workflow
  • Workflow
  • Workflow and agents
  • Rationalizations to Reject
  • Reference Index
  • Success Criteria

More skills from trailofbits/skills

All skills in this repo
  1. address-sanitizertrailofbits/skills

    Builds and runs code under AddressSanitizer to catch buffer overflows, use-after-free, and other memory errors during fuzzing or tests. Covers -fsanitize=address builds, ASAN_OPTIONS, reading the crash report, LeakSanitizer, and the overhead and platform trade-offs. Use when fuzzing C/C++ or Rust that has unsafe blocks or FFI, when debugging a memory corruption crash, or when reading an ASan stack trace.

    7.7k97 tok idle · 2,723 in use
  2. adjudicate-regressiontrailofbits/skills

    Use when deciding whether source and live reproduction evidence establish a new regression or an exclusion.

    7.7k23 tok idle · 505 in use
  3. aflpptrailofbits/skills

    Sets up and runs AFL++ for multi-core fuzzing of C/C++ projects built with afl-clang-fast or afl-gcc-fast. Covers instrumentation modes, parallel main and secondary campaigns, persistent mode, corpus minimization, and crash triage. Use when scaling fuzzing across cores, fuzzing a mature C/C++ codebase, reading the afl-fuzz status screen, or moving on after libFuzzer has plateaued.

    7.7k91 tok idle · 5,638 in use
  4. agentic-actions-auditortrailofbits/skills

    Audits GitHub Actions workflows for security vulnerabilities in AI agent integrations including Claude Code Action, Gemini CLI, OpenAI Codex, and GitHub AI Inference. Detects attack vectors where attacker-controlled input reaches AI agents running in CI/CD pipelines, including env var intermediary patterns, direct expression injection, dangerous sandbox configurations, and wildcard user allowlists. Use when reviewing workflow files that invoke AI coding agents, auditing CI/CD pipeline security for prompt injection risks, or evaluating agentic action configurations.

    7.7k105 tok idle · 4,775 in use
  5. Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations, and access control issues. Use when auditing Algorand projects (TEAL/PyTeal).

    7.7k54 tok idle · 2,979 in use
  6. atheristrailofbits/skills

    Sets up and runs Atheris, the coverage-guided Python fuzzer built on libFuzzer. Covers TestOneInput harnesses, FuzzedDataProvider, instrumenting both pure Python and native C extensions, and running under AddressSanitizer. Use when fuzzing a Python package, hunting memory corruption in a Python C extension, or choosing between Atheris and Hypothesis for a Python target.

    7.7k86 tok idle · 3,559 in use
  7. audit-augmentationtrailofbits/skills

    Augments Trailmark code graphs with external audit findings from SARIF static analysis results, weAudit annotation files, and version-gated Trailmark 0.4.x binary-analysis graph exports. Maps findings to graph nodes by file and line overlap, creates severity-based subgraphs, and enables cross-referencing findings with pre-analysis data (blast radius, taint, etc.). Use when projecting SARIF results onto a code graph, overlaying weAudit annotations, importing binary graph findings, cross-referencing Semgrep, CodeQL, or binary-analysis findings with call graph data, or visualizing audit findings in the context of code structure.

    7.7k130 tok idle · 2,108 in use
  8. audit-context-buildingtrailofbits/skills

    Understand a codebase before looking for bugs in it - what each function assumes, what it guarantees, and what it depends on elsewhere. Use when starting an audit, threat model, or architecture review on unfamiliar code, and before any vulnerability-hunting pass.

    7.7k55 tok idle · 797 in use