Repository navigation
SARIF
--sarif writes a SARIF 2.1.0 log for GitHub Code Scanning and other SARIF
consumers. Requires v1.19.0 or later. It is a local flag on the root review, on
diff, on guard and on
leaks. guard --sarif and leaks --sarif require v1.21.0
or later.
commitbrief diff origin/main...HEAD --sarif -o commitbrief.sarifUpload with github/codeql-action/upload-sarif (permissions security-events: write, plus actions: read on private repositories). Use a distinct category
so the results do not replace another tool's.
Each command writes its own automationDetails.id; upload each with the
matching category:
| Command | automationDetails.id |
Upload category
|
|---|---|---|
Root review and diff
|
commitbrief/ |
commitbrief |
guard |
commitbrief/guard/ |
commitbrief/guard |
leaks |
commitbrief/leaks/ |
commitbrief/leaks |
Code Scanning treats a result missing from a category as fixed. With one shared
category, a clean leaks run would close the alerts a review opened, and the
reverse. Separate categories keep each command's alerts independent.
Requires v1.21.0 or later. The log holds only the findings that cause a policy
violation. It is built from the same set the verdict is computed from, so the log
and the exit code cannot disagree. A passing run writes a valid log with
results: []. When the model response could not be parsed into structured
findings, in run-mode or in a --from-json input, no file is written and the
command exits 1.
Requires v1.21.0 or later. Every result uses the rule id sec.hardcoded-secret.
A result never carries the matched text, a snippet or an author. The pattern
names are in properties["commitbrief/patterns"]; for a history hit the short
commit hash is in properties["commitbrief/commit"]. The human report moves to
stderr and --fail-on still sets the exit code. Not with --json or
--patterns.
It writes a log only for a complete scan, because a partial upload would close alerts it never checked:
- Combining it with
--no-worktree,--no-history,--file,--dir,--exclude-file,--exclude-dir,--author,--committer,--start-date,--end-date,--textor a git range is a usage error. - If the history scan stops at the
--max-commitswindow, no file is written and the command exits 1. Pass a larger window with--max-commits N. - If the history is longer than the commit walk can cover, no file is written and
the command exits 1.
--max-commitscannot raise that limit.
| SARIF field | Value |
|---|---|
ruleId, ruleIndex
|
The finding's rule id and its index in tool.driver.rules[]
|
level |
critical/high is error, medium is warning, low/info is note
|
partialFingerprints["commitbrief/v1"] |
The finding's fingerprint
|
locations[] |
The finding's file and line |
properties["commitbrief/severity"] |
The original severity |
A finding with line 0 or less is anchored on line 1 and marked
properties["commitbrief/file-level"] = true.
- Exclusive with
--json,--markdown,--suggest-commit,--cliand--show-prompt. - Refused with a CLI-backed provider, before any call.
- Fails closed: a degraded or unparsed response is an error, no file is written, exit 1.
- An empty diff after filtering writes a valid log with
results: []. -
--min-severitydoes not filter SARIF. -
guard --sariflists violating findings only; the other commands list every finding.
See also: SARIF and Code Scanning
Home · Installation · Quick start · Troubleshooting · GitHub repo · Issues
CommitBrief — local, LLM-powered code review for git diffs. This wiki documents only what ships in the binary.
Getting started
Commands · reviewing
Commands · summarizing
Commands · committing
Commands · setup
Commands · integration
Commands · inspect
Commands · maintenance
Configuration
Providers
- Overview
- Anthropic
- OpenAI
- Gemini
- OpenAI-compatible (DeepSeek/Mistral/Cohere/custom)
- Ollama
- CLI tools
Output
Operations
Reference