How aliafana/llm-scanner works
LLM-Scanner is a source-code vulnerability scanner: a user supplies a project, deterministic Joern analysis discovers candidate flows, and the scanner slices evidence for optional advisory-grounded LLM judging before producing findings and SARIF. Its major branches are discovery, judgment, retrieval, and reporting. The README documents the overall workflow; sampled source confirms several calls, but unsampled modules and pipeline sections limit certainty about some internal connections.
Main entry points: main.py Scan Orchestrator · rag.py Advisory Retrieval · llm.py LLM Judge · joern.py Joern Wrapper
Components 13
Deterministic Discovery
- Scan Orchestrator
scanner/main.py - Joern Wrapper
scanner/joern.py - Taint Queries
queries/scan.sc - Flow Slicer
scanner/slicer.py
Candidate Judgment
- LLM Judge
scanner/llm.py - API Backoff
scanner/retry.py
Advisory Retrieval
- Advisory Retrieval
scanner/rag.py - Advisory Corpus
corpus/advisories.jsonl - pgvector Store
Finding Reports
- SARIF Reporter
scanner/sarif.py - Findings and SARIF
Other components
- Scanner User
- Hosted Model APIs
Connections 14
- Scanner User → Scan Orchestrator: starts scan
README.md - Scan Orchestrator → Joern Wrapper: builds graph
README.md - Joern Wrapper → Taint Queries: runs queries
scanner/joern.py - Scan Orchestrator → Flow Slicer: slices flows
README.md - Scan Orchestrator → Advisory Retrieval: retrieves context
scanner/main.py - Scan Orchestrator → LLM Judge: judges candidates
scanner/main.py - LLM Judge → API Backoff: uses backoff
scanner/llm.py - LLM Judge → Hosted Model APIs: requests verdict
scanner/llm.py - Advisory Retrieval → pgvector Store: retrieves matches
README.md - Advisory Retrieval → Advisory Corpus: grounds judgments
README.md - Advisory Retrieval → API Backoff: uses backoff
scanner/retry.py - Scan Orchestrator → SARIF Reporter: formats findings
README.md - SARIF Reporter → Findings and SARIF: emits SARIF
README.md - Scan Orchestrator → Findings and SARIF: writes findings
README.md