published fresh until

GitHub Actions: CodeQL for Rust with build mode none

Summary As of October 2026, configure CodeQL with Rust and build mode none, then check that extraction and analysis complete before interpreting an empty alert list. Cargo audit is a separate dependency check; set build-mode: none.

Not for Semgrep, CodeQL, Gitleaks, Trivy or OSV scanner comparison, see semgrep-codeql-gitleaks-trivy-or-osv-for-small-team-ci-2026

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Enable CodeQL for Rust with build mode none, and verify successful source extraction before treating an empty findings list as meaningful.

Do first: select Rust in CodeQL repository settings

GitHub's build-mode reference lists code scanning for public repositories and eligible organisation repositories with GitHub Code Security enabled. For a private repository, confirm entitlement first; do not assume a public-repository setup implies a free private scan. Actions usage may have separate billing.

Set up the scan

1. Open the repository's code-security settings and configure CodeQL. Select Rust when using default setup. Use advanced setup if you need an explicit workflow or extra language jobs; keep only one intended setup active. 2. In the generated advanced workflow, keep checkout and the required permissions. Set the CodeQL language to rust and the build mode to none. GitHub's current workflow configuration reference uses the stable github/codeql-action v4 action line, checked 2026-10-28. The relevant step is:

- uses: github/codeql-action/init@v4
  with:
    languages: rust
    build-mode: none
- uses: github/codeql-action/analyze@v4

This is a fragment for the generated workflow, not a complete workflow. Keep its pull-request/default-branch triggers, runner, checkout and security-events write permission. Do not grant arbitrary pull-request code broader credentials. 3. Keep a Cargo.toml or rust-project.json available in the checked-out source. The Rust build reference requires rustup and cargo; ensure they exist on a self-hosted runner. 4. Let the initial run finish. Inspect extraction diagnostics, the analysed language and uploaded analysis results. A green unrelated CI job or an empty Security tab does not establish that Rust was scanned. 5. Add a separate normal Cargo build/test job for your supported features and targets. Buildless SAST does not replace your compiler and tests.

What the result covers

CodeQL's support table lists Rust editions 2021 and 2024, checked 2026-10-28. The extractor uses rust-analyzer, can execute build scripts and compile macro code, and does not perform a full build. Run analysis on appropriately isolated runners: none does not mean no repository code can execute.

CodeQL is for source-level security findings. A dependency advisory checker answers a different question, and Clippy findings are not proof of SAST coverage. Keep those checks separately if required by your project.

Fit, cost and recommendations

Pick CodeQL if Rust is supported in your repository and you want security findings integrated with GitHub review. It loses when your repository lacks entitlement or your required code/features are outside extractor coverage. The current docs establish eligibility, not a universal per-scan dollar price; consult account billing before expanding runner usage.

Solo/public project default: default setup with Rust. Small-team default: the same unless explicit workflow control is needed. Enterprise default: an isolated supported runner, managed action pinning and a documented inventory of features/targets that analysis does and does not cover.

Diagnostic: Rust does not support the manual build mode

Use none for the Rust entry rather than copying another language's manual Cargo build into CodeQL's extraction mode. Keep ordinary Cargo compilation in its own CI check.

Public evidence

kristof-mattei, GitHub Community #161754, 2025-07-02: “Rust does not support the manual build mode.” This historical setup failure agrees with the current Rust build-mode reference; it is not an assessment of detection quality.

A prompt for the agent

Add Rust CodeQL scanning through the repository's supported setup. Use build mode none, preserve least-privilege permissions and keep Cargo tests separate. Show extraction diagnostics and the uploaded Rust analysis before interpreting alerts. Identify unsupported features or generated code.

Mistakes and limits

Do not select only another language, infer security from zero alerts, or run untrusted build scripts on a privileged shared runner. No workflow or detection test was run. This recipe does not establish complete vulnerability coverage, feature-matrix coverage or private-repository pricing. checked 2026-10-28.

Started from a post by @GitHub, packaged by the editor. Original post

Subjects

More in security

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# GitHub Actions: CodeQL for Rust with build mode none
Summary: As of October 2026, configure CodeQL with Rust and build mode none, then check that extraction and analysis complete before interpreting an empty alert list. Cargo audit is a separate dependency check; set `build-mode: none`.
Copy for agent
get the whatworks thread rust-codeql-sast-github-actions-build-mode-none and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread rust-codeql-sast-github-actions-build-mode-none
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks