Semantic security verification CLI for scanner alerts and AI-written code
Project description
Sarix
Security CLI for scanner alerts, code review, and CI reports.
Sarix started as a direct code scanner. Now the main lane is stronger: take alerts from Semgrep, CodeQL, or another SARIF tool, open the matching source files, collect evidence, and decide what deserves attention.
It still scans files and folders directly. The bigger value is verification: less noise, clearer proof, and reports that can go back into CI.
What It Is Now
Sarix has three useful paths:
- guided terminal UI for people who do not want to remember commands
- direct scan for one file, a folder, or a git diff
- SARIF verify for scanner alerts that need real source context
The verify path is the important one.
Scanners are good at breadth. They find suspicious lines fast. Sarix checks what is behind the alert:
- where the input comes from
- which sink or trust boundary it reaches
- what guard is missing
- why the verdict is exploitable, likely exploitable, uncertain, or dismissed
- what fix would actually reduce risk
No evidence, no confident verdict.
Quick Start
Guided UI:
pip install sarix
sarix
From the repo:
python -m sarix
Pick a path in the menu:
- scan a file
- scan a folder
- review a git diff
- verify a SARIF file
- build a proof bundle
- run judge and skeptic mode
Direct commands still work:
sarix security src/app.py
sarix scan src --task security --output sarif > sarix.sarif
sarix diff --task security
Local model:
ollama serve
sarix security src/app.py --provider ollama
Verify Scanner Alerts
Run your scanner first:
semgrep scan --config auto --sarif > semgrep.sarif
Then let Sarix import the alert and attach local source context:
sarix verify semgrep.sarif --source . --output markdown
Useful verify modes:
sarix verify semgrep.sarif --source . --preview-context
sarix verify semgrep.sarif --source . --fail-on likely_exploitable
sarix verify semgrep.sarif --source . --judge --skeptic --profile auto --provider openai
sarix verify semgrep.sarif --source . --artifact-dir .sarix-proof
Plain import mode is conservative. It keeps scanner alerts as uncertain.
Judge mode can promote, downgrade, or dismiss alerts. Skeptic mode checks
serious verdicts again before CI has to trust them.
Typical summary:
Blocked: 0 exploitable issue(s)
Likely exploitable: 0
Needs review: 42
Dismissed: 0
Try the local fixture:
sarix verify examples/semgrep-verify/semgrep.sarif \
--source examples/semgrep-verify/project \
--output markdown
Framework fixtures are in examples/framework-profiles.
Evidence Format
Sarix uses structured verdicts:
exploitablelikely_exploitableuncertainprobably_false_positivenot_exploitable
Example:
### CS-AUTH-001: Tenant isolation bypass
- Verdict: `exploitable`
- Severity: `high`
- Confidence: `high`
- Exploitability: `91/100`
- Location: `api/projects.py:88`
- CWE: `CWE-862`
#### Evidence
- Source: `request.path_params["org_id"]`
- Sink: `Project.query.filter_by(org_id=org_id)`
- Missing guard: no membership check before project lookup
#### Evidence path
1. `api/projects.py:82` - route accepts org_id from the request path
2. `api/projects.py:88` - query trusts org_id before checking membership
Commands
Core:
sarixsarix uisarix security <file>sarix scan <dir> --task securitysarix diff --task securitysarix verify <scanner.sarif> --source .sarix benchmark
Secondary:
sarix review <file>sarix bugs <file>sarix docs <file>sarix explain <file>sarix refactor <file>
Providers
- OpenAI:
OPENAI_API_KEY - Anthropic:
ANTHROPIC_API_KEY - Google Vertex AI:
GOOGLE_CLOUD_PROJECTand ADC - Ollama: local
ollama serve - OpenAI-compatible: custom label from
sarix config
OpenAI-compatible presets include OpenRouter, Groq, Together AI, Mistral, xAI, Fireworks, DeepSeek, Perplexity, Cerebras, Cohere, and Azure AI Foundry.
Output
sarix security app.py --output markdown
sarix security app.py --output json
sarix security app.py --output sarif > sarix.sarif
sarix verify semgrep.sarif --source . --output sarif > verified.sarif
SARIF can be uploaded to GitHub code scanning.
Privacy
Sarix does not need a hosted account or repo connection.
- Ollama keeps analysis local.
- BYOK providers use your own key.
- Project config cannot set
api_key,base_url, ordefault_provider. - Project config discovery is restricted to
$HOME. - Large files can be compressed into code maps before prompting.
Cloud providers still receive the selected code context. Use Ollama when code must stay on the machine.
Benchmarks
The built-in benchmark is a smoke test: 10 vulnerable Python cases and 2 clean false-positive traps. It is useful for checking provider behavior and prompt drift. It is not a public claim that Sarix is better than another scanner.
sarix benchmark --models gpt-5.4 llama3
sarix benchmark --json > benchmark-results.json
Public benchmark claims need the exact cases, commands, expected verdicts, raw results, model, provider, and run date.
GitHub Action
Verify scanner SARIF:
- run: |
python -m pip install semgrep
semgrep scan --config auto --sarif --output semgrep.sarif
- uses: AvixoSec/sarix@v0.3.1
with:
mode: verify
path: .
sarif-input: semgrep.sarif
output: sarif
fail-on: exploitable
judge: "true"
skeptic: "true"
profile: auto
Direct scan:
- uses: AvixoSec/sarix@v0.3.1
with:
provider: openai
api-key: ${{ secrets.OPENAI_API_KEY }}
task: security
path: .
output: sarif
Development
git clone https://github.com/AvixoSec/sarix.git
cd sarix
pip install -e ".[dev]"
pytest tests -v
ruff check .
License
MIT. See LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sarix-0.4.0.tar.gz.
File metadata
- Download URL: sarix-0.4.0.tar.gz
- Upload date:
- Size: 71.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30624913a87616a4b9958512e8c3a04724e3d6c3a97a330ce55bab145ad6172f
|
|
| MD5 |
869beeed74eeb4de58e1a550546c0ca6
|
|
| BLAKE2b-256 |
3d5fc0f6271d8878ea132c909ebdeb96d8a6d7e8fb8b0dc8ecf218750a314e33
|
Provenance
The following attestation bundles were made for sarix-0.4.0.tar.gz:
Publisher:
publish.yml on AvixoSec/sarix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sarix-0.4.0.tar.gz -
Subject digest:
30624913a87616a4b9958512e8c3a04724e3d6c3a97a330ce55bab145ad6172f - Sigstore transparency entry: 1429377410
- Sigstore integration time:
-
Permalink:
AvixoSec/sarix@fd9817c9110e01e586b43646b800aa22697875fa -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/AvixoSec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fd9817c9110e01e586b43646b800aa22697875fa -
Trigger Event:
release
-
Statement type:
File details
Details for the file sarix-0.4.0-py3-none-any.whl.
File metadata
- Download URL: sarix-0.4.0-py3-none-any.whl
- Upload date:
- Size: 69.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
450bd5ff4a6e521736d8a713dd763208fde254346e137cdef6c0547c3922328b
|
|
| MD5 |
59ec6a9269a50566c3daf229ae0a099b
|
|
| BLAKE2b-256 |
febe75b255377f409942888eeb40508ac4ca477d2b8d783f8e523a5294da7f8e
|
Provenance
The following attestation bundles were made for sarix-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on AvixoSec/sarix
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sarix-0.4.0-py3-none-any.whl -
Subject digest:
450bd5ff4a6e521736d8a713dd763208fde254346e137cdef6c0547c3922328b - Sigstore transparency entry: 1429377414
- Sigstore integration time:
-
Permalink:
AvixoSec/sarix@fd9817c9110e01e586b43646b800aa22697875fa -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/AvixoSec
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@fd9817c9110e01e586b43646b800aa22697875fa -
Trigger Event:
release
-
Statement type: