CodeQL Security Scan
trailofbits/skills
Scans a codebase for vulnerabilities with CodeQL's data flow and taint tracking in run-all or important-only modes, including data extensions for project-specific sources and sinks.
Comprehensive guide for setting up and configuring CodeQL code scanning via GitHub Actions workflows and the CodeQL CLI.
$ npx skills add github/awesome-copilot --skill codeql -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install github/awesome-copilot codeql --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/codeql .claude/skills/codeql && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "codeql" agent skill from https://github.com/github/awesome-copilot/tree/main/skills/codeql into .claude/skills/codeql/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "codeql", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/github/awesome-copilot/tree/main/skills/codeqlType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add github/awesome-copilot --skill codeql -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install github/awesome-copilot codeql --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/codeql .agents/skills/codeql && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "codeql" agent skill from https://github.com/github/awesome-copilot/tree/main/skills/codeql into .agents/skills/codeql/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "codeql", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add github/awesome-copilot --skill codeql -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install github/awesome-copilot codeql --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/codeql .cursor/skills/codeql && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "codeql" agent skill from https://github.com/github/awesome-copilot/tree/main/skills/codeql into .cursor/skills/codeql/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "codeql", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/github/awesome-copilot.git --path skills/codeql--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add github/awesome-copilot --skill codeql -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install github/awesome-copilot codeql --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/codeql .gemini/skills/codeql && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "codeql" agent skill from https://github.com/github/awesome-copilot/tree/main/skills/codeql into .gemini/skills/codeql/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "codeql", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install github/awesome-copilot codeqlInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add github/awesome-copilot --skill codeql -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/codeql .github/skills/codeql && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "codeql" agent skill from https://github.com/github/awesome-copilot/tree/main/skills/codeql into .github/skills/codeql/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "codeql", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add github/awesome-copilot --skill codeql -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install github/awesome-copilot codeql --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/github/awesome-copilot.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/codeql .opencode/skills/codeql && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "codeql" agent skill from https://github.com/github/awesome-copilot/tree/main/skills/codeql into .opencode/skills/codeql/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "codeql", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
codeqlComprehensive guide for setting up and configuring CodeQL code scanning via GitHub Actions workflows and the CodeQL CLI.
Codeql is an agent skill from github/awesome-copilot, published by the product's own GitHub organization. Comprehensive guide for setting up and configuring CodeQL code scanning via GitHub Actions workflows and the CodeQL CLI. This skill should be used when users need help with code scanning configuration, CodeQL workflow files, CodeQL CLI commands, SARIF output, security analysis setup, or troubleshooting CodeQL analysis.
Its SKILL.md is about 3.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 7 other files, including reference files (for example `references/alert-management.md`, `references/cli-commands.md` and `references/compiled-languages.md`).
It sits in Security, covering Static analysis and SAST and CI/CD. It works with GitHub Actions, GitHub, C++ and JavaScript. The repository describes itself as: Community-contributed instructions, agents, skills, and configurations to help you make the most of GitHub Copilot. The licence is MIT.
11 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 3a68501. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are yaml and bash).
From the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
github.comFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
GITHUB_TOKENFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Codeql loads about 3.4k tokens when it runs, and up to ~16k if it reads all its reference files. Until then it costs about 82 tokens; SKILL.md has 1,162 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from github/awesome-copilot at commit 3a68501, republished under its MIT licence (© github). 1,162 words, ~3,355 tokens.
.claude/skills/codeql/SKILL.md (or your agent's skills folder). This skill also uses 6 other files; get the full folder from GitHub.This skill provides procedural guidance for configuring and running CodeQL code scanning — both through GitHub Actions workflows and the standalone CodeQL CLI.
Use this skill when the request involves:
codeql.yml GitHub Actions workflowcodeql database create, database analyze, github upload-results)CodeQL supports the following language identifiers:
| Language | Identifier | Alternatives |
|---|---|---|
| C/C++ | c-cpp | c, cpp |
| C# | csharp | — |
| Go | go | — |
| Java/Kotlin | java-kotlin | java, kotlin |
| JavaScript/TypeScript | javascript-typescript | javascript, typescript |
| Python | python | — |
| Ruby | ruby | — |
| Rust | rust | — |
| Swift | swift | — |
| GitHub Actions | actions | — |
Alternative identifiers are equivalent to the standard identifier (e.g.,
javascriptdoes not exclude TypeScript analysis).
none build mode for most languages..github/workflows/codeql.yml file for full control over triggers, build modes, query suites, and matrix strategies.To switch from default to advanced: disable default setup first, then commit the workflow file.
Define when scanning runs:
on:
push:
branches: [main, protected]
pull_request:
branches: [main]
schedule:
- cron: '30 6 * * 1' # Weekly Monday 6:30 UTCpush — scans on every push to specified branches; results appear in Security tabpull_request — scans PR merge commits; results appear as PR check annotationsschedule — periodic scans of the default branch (cron must exist on default branch)merge_group — add if repository uses merge queuesTo skip scans for documentation-only PRs:
on:
pull_request:
paths-ignore:
- '**/*.md'
- '**/*.txt'
paths-ignorecontrols whether the workflow runs, not which files are analyzed.
Set least-privilege permissions:
permissions:
security-events: write # Required to upload SARIF results
contents: read # Required to checkout code
actions: read # Required for private repos using codeql-actionUse a matrix strategy to analyze each language in parallel:
jobs:
analyze:
name: Analyze (${{ matrix.language }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- language: javascript-typescript
build-mode: none
- language: python
build-mode: noneFor compiled languages, set the appropriate build-mode:
none — no build required (supported for C/C++, C#, Java, Rust)autobuild — automatic build detectionmanual — custom build commands (advanced setup only)For detailed per-language autobuild behavior and runner requirements, search
references/compiled-languages.md.
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Initialize CodeQL
uses: github/codeql-action/init@v4
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
dependency-caching: true
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4
with:
category: "/language:${{ matrix.language }}"Query suite options:
security-extended — default security queries plus additional coveragesecurity-and-quality — security plus code quality queriespacks: input (e.g., codeql/javascript-queries:AlertSuppression.ql)Dependency caching: Set dependency-caching: true on the init action to cache restored dependencies across runs.
Analysis category: Use category to distinguish SARIF results in monorepos (e.g., per-language, per-component).
For monorepos with multiple components, use the category parameter to separate SARIF results:
category: "/language:${{ matrix.language }}/component:frontend"To restrict analysis to specific directories, use a CodeQL configuration file (.github/codeql/codeql-config.yml):
paths:
- apps/
- services/
paths-ignore:
- node_modules/
- '**/test/**'Reference it in the workflow:
- uses: github/codeql-action/init@v4
with:
config-file: .github/codeql/codeql-config.ymlIf autobuild fails or custom build commands are needed:
- language: c-cpp
build-mode: manualThen add explicit build steps between init and analyze:
- if: matrix.build-mode == 'manual'
name: Build
run: |
make bootstrap
make releaseDownload the CodeQL bundle (includes CLI + precompiled queries):
# Download from https://github.com/github/codeql-action/releases
# Extract and add to PATH
export PATH="$HOME/codeql:$PATH"
# Verify installation
codeql resolve packs
codeql resolve languagesAlways use the CodeQL bundle, not a standalone CLI download. The bundle ensures query compatibility and provides precompiled queries for better performance.
# Single language
codeql database create codeql-db \
--language=javascript-typescript \
--source-root=src
# Multiple languages (cluster mode)
codeql database create codeql-dbs \
--db-cluster \
--language=java,python \
--command=./build.sh \
--source-root=srcFor compiled languages, provide the build command via --command.
codeql database analyze codeql-db \
javascript-code-scanning.qls \
--format=sarif-latest \
--sarif-category=javascript \
--output=results.sarifCommon query suites: <language>-code-scanning.qls, <language>-security-extended.qls, <language>-security-and-quality.qls.
codeql github upload-results \
--repository=owner/repo \
--ref=refs/heads/main \
--commit=<commit-sha> \
--sarif=results.sarifRequires GITHUB_TOKEN environment variable with security-events: write permission.
To avoid repeated JVM initialization when running multiple commands:
codeql execute cli-serverFor detailed CLI command reference, search
references/cli-commands.md.
Alerts have two severity dimensions:
Error, Warning, NoteCritical, High, Medium, Low (derived from CVSS scores; takes display precedence)GitHub Copilot Autofix generates fix suggestions for CodeQL alerts in pull requests automatically — no Copilot subscription required. Review suggestions carefully before committing.
error/critical/high severity alertsFor detailed alert management guidance, search
references/alert-management.md.
- uses: github/codeql-action/init@v4
with:
packs: |
my-org/my-security-queries@1.0.0
codeql/javascript-queries:AlertSuppression.qlUse the CodeQL CLI to create and publish packs:
# Initialize a new pack
codeql pack init my-org/my-queries
# Install dependencies
codeql pack install
# Publish to GitHub Container Registry
codeql pack publishFor advanced query and path configuration, create .github/codeql/codeql-config.yml:
paths:
- apps/
- services/
paths-ignore:
- '**/test/**'
- node_modules/
queries:
- uses: security-extended
packs:
javascript-typescript:
- my-org/my-custom-queriesWorkflow logs include key metrics:
To enable detailed diagnostics:
--verbosity=progress++ and --logdir=codeql-logs| Problem | Solution |
|---|---|
| Workflow not triggering | Verify on: triggers match event; check paths/branches filters; ensure workflow exists on target branch |
Resource not accessible error | Add security-events: write and contents: read permissions |
| Autobuild failure | Switch to build-mode: manual and add explicit build commands |
| No source code seen | Verify --source-root, build command, and language identifier |
| C# compiler failure | Check for /p:EmitCompilerGeneratedFiles=true conflicts with .sqlproj or legacy projects |
| Fewer lines scanned than expected | Switch from none to autobuild/manual; verify build compiles all source |
| Kotlin in no-build mode | Disable and re-enable default setup to switch to autobuild |
| Cache miss every run | Verify dependency-caching: true on init action |
| Out of disk/memory | Use larger runners; reduce analysis scope via paths config; use build-mode: none |
| SARIF upload fails | Ensure token has security-events: write; check 10 MB file size limit |
| SARIF results exceed limits | Split across multiple uploads with different --sarif-category; reduce query scope |
| Two CodeQL workflows | Disable default setup if using advanced setup, or remove old workflow file |
| Slow analysis | Enable dependency caching; use --threads=0; reduce query suite scope |
For comprehensive troubleshooting with detailed solutions, search
references/troubleshooting.md.
| Codebase Size | RAM | CPU |
|---|---|---|
| Small (<100K LOC) | 8 GB+ | 2 cores |
| Medium (100K–1M LOC) | 16 GB+ | 4–8 cores |
| Large (>1M LOC) | 64 GB+ | 8 cores |
All sizes: SSD with ≥14 GB free disk space.
Pin CodeQL actions to a specific major version:
uses: github/codeql-action/init@v4 # Recommended
uses: github/codeql-action/autobuild@v4
uses: github/codeql-action/analyze@v4For maximum security, pin to a full commit SHA instead of a version tag.
For detailed documentation, load the following reference files as needed:
references/workflow-configuration.md — Full workflow trigger, runner, and configuration optionstrigger, schedule, paths-ignore, db-location, model packs, alert severity, merge protection, concurrency, config filereferences/cli-commands.md — Complete CodeQL CLI command referencedatabase create, database analyze, upload-results, resolve packs, cli-server, installation, CI integrationreferences/sarif-output.md — SARIF v2.1.0 object model, upload limits, and third-party supportsarifLog, result, location, region, codeFlow, fingerprint, suppression, upload limits, third-party, precision, security-severityreferences/compiled-languages.md — Build modes and autobuild behavior per languageC/C++, C#, Java, Go, Rust, Swift, autobuild, build-mode, hardware, dependency cachingreferences/troubleshooting.md — Comprehensive error diagnosis and resolutionno source code, out of disk, out of memory, 403, C# compiler, analysis too long, fewer lines, Kotlin, extraction errors, debug logging, SARIF upload, SARIF limitsreferences/alert-management.md — Alert severity, triage, Copilot Autofix, and dismissalseverity, security severity, CVSS, Copilot Autofix, dismiss, triage, PR alerts, data flow, merge protection, REST API© github, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 6 other files (references) in skills/codeql of github/awesome-copilot.
Open the folder on GitHubat commit 3a68501
Codeql next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Codeql this skillgithub/awesome-copilot | 40k | — | ~3.4k | Automated safety check: Pass | MIT | |
| CodeQL Security Scantrailofbits/skills | 7.4k | — | ~4.6k | Automated safety check: Notes | CC-BY-SA-4.0 | |
| Agentic GitHub Actions Auditortrailofbits/skills | 7.4k | 1 repos | ~5.4k | Automated safety check: Notes | CC-BY-SA-4.0 | |
| Constant-Time Analysistrailofbits/skills | 7.4k | — | ~3.3k | Automated safety check: Notes | CC-BY-SA-4.0 | |
| Integrating Sast Into GitHub Actions Pipelinemukul975/Anthropic-Cybersecurity-Skills | 34k | — | ~3.1k | Automated safety check: Pass | Apache-2.0 | |
| ReviewdogAgentSecOps/SecOpsAgentKit | 219 | — | ~3k | Automated safety check: Pass | Custom licence |
trailofbits/skills
Scans a codebase for vulnerabilities with CodeQL's data flow and taint tracking in run-all or important-only modes, including data extensions for project-specific sources and sinks.
trailofbits/skills
Statically audits GitHub Actions workflows that run AI coding agents, tracing attacker-controlled input to agent prompts and flagging unsafe sandbox, trigger and allowlist settings.
trailofbits/skills
Compiles cryptographic code and inspects the assembly or bytecode for variable-time instructions, then triages which flagged operations actually touch secrets.
mukul975/Anthropic-Cybersecurity-Skills
Integrates CodeQL and Semgrep SAST scanning into GitHub Actions, covering scans on pull requests/pushes, rule tuning to cut false positives, SARIF upload to GitHub Advanced Security, and…
AgentSecOps/SecOpsAgentKit
Automated code review and security linting integration for CI/CD pipelines using reviewdog.
QwenLM/qwen-code
Answers questions about code structure, history, bugs and PR risk using a CodeScope knowledge graph and semantic index built from the repository.
github/awesome-copilot
Maps an unfamiliar codebase into seven evidence-backed documents in docs/codebase/, using a scan script and templates, for onboarding or architecture write-ups.
github/awesome-copilot
Designs Azure infrastructure from a natural-language description, or diagrams an existing resource group, then refines the design through conversation and deploys it with Bicep.
github/awesome-copilot
Builds a warm, browser-based daily focus board the user updates by talking to their agent, with Eisenhower priorities, a brain-dump box and kind not-today carryover.
github/awesome-copilot
Generates, edits and validates draw.io files with correct mxGraph XML, covering flowcharts, architecture, sequence, ER and UML class diagrams.
github/awesome-copilot
Finds, vets and assembles the smallest compatible set of agent skills for a multi-step goal, with local index search, safety checks and staged installation.
github/awesome-copilot
Turns one contested decision into a validated JSON map of supporting, contradicting, qualifying and missing evidence, with exact source locations.
Categories
Comprehensive guide for setting up and configuring CodeQL code scanning via GitHub Actions workflows and the CodeQL CLI. Codeql is an agent skill from github/awesome-copilot, published by the product's own GitHub organization. Comprehensive guide for setting up and configuring CodeQL code scanning via GitHub Actions workflows and the CodeQL CLI.
Codeql fits situations like: tasks that involve Static analysis and SAST; tasks that involve CI/CD.
Run `npx skills add github/awesome-copilot --skill codeql -a claude-code`. Or copy the skill folder (skills/codeql in github/awesome-copilot) into .claude/skills/codeql in your project. Claude Code loads it when a task matches its description.
Run `npx skills add github/awesome-copilot --skill codeql -a codex`. Or copy the skill folder (skills/codeql in github/awesome-copilot) into .agents/skills/codeql in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add github/awesome-copilot --skill codeql -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/codeql, .gemini/skills/codeql, .github/skills/codeql and .opencode/skills/codeql in your project.
Going by SKILL.md and its folder, Codeql needs credentials named GITHUB_TOKEN. Our summary lists: Python 3; A credential in GITHUB_TOKEN.
SKILL.md names 1 domain. In commands or code: github.com; the agent is likely to contact it when it follows the instructions. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Codeql is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.4k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 13k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Codeql: CodeQL Security Scan (trailofbits/skills, 7.4k stars), Agentic GitHub Actions Auditor (trailofbits/skills, 7.4k stars), Constant-Time Analysis (trailofbits/skills, 7.4k stars) and Integrating Sast Into GitHub Actions Pipeline (mukul975/Anthropic-Cybersecurity-Skills, 34k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
github (a GitHub organization, an official publisher) maintains it in github/awesome-copilot, which has 39,759 GitHub stars. The repository holds 438 skills in this directory. The repository was last updated on October 7, 2026.
Source: github/awesome-copilot on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.