codeql
An agent skill by trailofbits, from trailofbits/skills. Tags: analysis, codeql, security, static-analysis.
What it does
Scans a codebase for security vulnerabilities using CodeQL's interprocedural data flow and taint tracking analysis. Triggers on "run codeql", "codeql scan", "build codeql database", "SAST scan", "taint analysis", "dataflow analysis", or "find vulnerabilities in this repo". Covers Python, JavaScript/TypeScript, Go, Java/Kotlin, C/C++, C#, Ruby, and Swift. Supports "run all" (security-and-quality + security-experimental) and "important only" (high-precision) scan modes, and creates data extension models for project-specific sources and sinks. For fast single-file pattern matching, or when no build is available for a compiled language, use the semgrep skill; to parse SARIF that already exists rather than produce it, use the sarif-parsing skill.
Install
With the skills CLI, which installs into Claude Code, Codex, Cursor and other agents:
npx skills add trailofbits/skills --skill codeql
Or copy the skill folder into Claude Code's skills directory by hand (~/.claude/skills for every project, or .claude/skills inside one):
git clone --depth 1 https://github.com/trailofbits/skills
cp -r skills/plugins/static-analysis/skills/codeql ~/.claude/skills/codeql
Safety box score
Grade D, elevated risk: 44 of 100 risk points, rated 2026-10-20. The grade rates what the skill and its scripts can reach on the machine of whoever installs it, across eight categories from shell execution to secrets access. How the score works.
This skill runs CodeQL database builds and security analyses on a local repository, including project build commands, package installs, and optional toolchain/OS setup. The main risks are arbitrary code execution during extraction, network-backed dependency installation, and cleanup steps that can delete build/database directories or modify the user's toolchain.
| Category | Level | Why |
|---|---|---|
| Code & shell execution | 3 (high) | High: it runs CodeQL and project build commands directly (`run_logged codeql database create "$DB_NAME" --language="$CODEQL_LANG" --command="$BUILD_CMD" --overwrite`) and also installs dependencies (`run_logged pip install -e .`, `npm install`), so it can execute arbitrary repo code. |
| Network access | 2 (moderate) | Moderate: the docs call for fetching external dependencies and packs (`codeql pack download ...`, `go mod download`, `mvn dependency:resolve`, `cargo fetch`, `brew install ...`), so the skill can make outbound network requests. |
| Filesystem reach | 2 (moderate) | Moderate: it writes all analysis artifacts under `$OUTPUT_DIR`, but also deletes and overwrites local paths (`rm -rf "$DB_NAME"`, `rm -rf build CMakeCache.txt CMakeFiles`, and copying extensions into CodeQL cache under `.codeql/libraries/.../ext`). |
| Secrets & credentials | 0 (none) | Nothing in the supplied files reads keychains, browser sessions, `.env` files, passwords, or credential stores; the only auth mention is a generic private-registry prompt. |
| Privilege & persistence | 3 (high) | High: it includes system/toolchain changes such as `brew install llvm make`, `softwareupdate --install-rosetta --agree-to-license`, and package-manager installs, which can change the user's machine outside the repo. |
| Instruction hijack surface | 0 (none) | I did not find instructions to ignore safeguards, follow remote content, hide behavior, or override system/developer rules; the prompts are about database selection and scan mode. |
| Irreversible actions | 0 (none) | The skill analyzes code and reports results, but it does not publish, deploy, send messages, pay, book, or delete remote resources. |
| Transparency | 1 (low) | Low: the runtime workflow entrypoint `workflows/codeql-build.js` is referenced by tests (`scripts/test_script_flags.py`) but is not included in the supplied files, so the full behavior is not directly reviewable. |
Before installing
- Read `references/macos-arm64e-workaround.md` and decide whether you are okay with `brew install llvm make` or Rosetta changes.
- Check `references/build-fixes.md` for `rm -rf "$DB_NAME"` and build-cache cleanup before letting it run.
- Confirm you want the skill to execute project build commands and dependency installs (`codeql database create --command=...`, `pip install`, `npm install`).
- Locate `workflows/codeql-build.js` in the actual install if you want the full runtime entrypoint audited; it is referenced by tests but not supplied here.
Rated 2026-10-20 by an automated review of 32 files from the skill's repository.
Source
- Repository
- trailofbits/skills (all skills from this repository)
- Path
- plugins/static-analysis/skills/codeql/SKILL.md
- Branch
- main
- Collection
- static-analysis
- Updated
- 2026-09-19
Related skills
- semgrep — Runs a Semgrep security scan over a codebase: detects languages, selects rulesets, presents the plan for explicit approval.
- algorand-vulnerability-scanner — Scans Algorand smart contracts for 11 common vulnerabilities including rekeying attacks, unchecked transaction fees, missing field validations.
- audit-augmentation — Augments Trailmark code graphs with external audit findings from SARIF static analysis results, weAudit annotation files.
- audit-context-building — Understand a codebase before looking for bugs in it - what each function assumes, what it guarantees, and what it depends on elsewhere.
- audit-prep-assistant — Prepares codebases for security review using Trail of Bits' checklist.
- burpsuite-project-parser — Searches and explores Burp Suite project files (.burp) from the command line. Use when searching response headers or bodies with regex patterns.