How ppgamerer/llm_scanner works
This is an OWASP LLM vulnerability-scanning platform: users choose an Ollama target and OWASP categories, the backend selects a compatible scanner, runs it as a background job, normalizes results, and presents a unified report. The graph includes the Garak, Promptfoo, and promptmap2 branches, plus target adapters and report generation. Some relationships are supported by the SOURCE INDEX rather than full excerpts; the Promptfoo parser excerpt also notes its input format has not been verified against a real run.
Main entry points: selector.py Scan Selector · app.py Streamlit UI · promptmap2_runner.py promptmap2 Runner · owasp_mapping.py OWASP Mapping
Components 17
User Experience
- Streamlit UI
ui/app.py
API and Orchestration
- FastAPI
api/main.py - Scan Selector
core/selector.py
Scan Engine
- OWASP Mapping
core/owasp_mapping.py - Target Adapters
core/generators/base.py - Garak Runner
core/runners/garak_runner.py - Promptfoo Runner
core/runners/promptfoo_runner.py - promptmap2 Runner
core/runners/promptmap2_runner.py
Results and Reporting
- Garak Parser
core/parsers/garak_parser.py - Promptfoo Parser
core/parsers/promptfoo_parser.py - promptmap2 Parser
core/parsers/promptmap2_parser.py - Unified Reports
core/report.py
Other components
- Scanner User
- Ollama
- Garak CLI
- Promptfoo CLI
- promptmap2 CLI
Connections 22
- Scanner User → Streamlit UI: selects target
ui/app.py - Streamlit UI → FastAPI: requests scans
ui/app.py - FastAPI → Streamlit UI: returns categories
api/main.py - FastAPI → Scan Selector: dispatches scan
api/main.py - Scan Selector → OWASP Mapping: plans probes
core/selector.py - Scan Selector → Garak Runner: runs scans
core/selector.py - Scan Selector → Promptfoo Runner: runs scans
core/selector.py - Scan Selector → promptmap2 Runner: runs scans
core/selector.py - Garak Runner → Garak CLI: invokes CLI
core/runners/garak_runner.py - Promptfoo Runner → Promptfoo CLI: invokes CLI
core/runners/promptfoo_runner.py - promptmap2 Runner → promptmap2 CLI: invokes CLI
core/runners/promptmap2_runner.py - Garak Runner → Garak Parser: parses output
core/runners/garak_runner.py - Promptfoo Runner → Promptfoo Parser: parses output
core/runners/promptfoo_runner.py - promptmap2 Runner → promptmap2 Parser: parses output
core/runners/promptmap2_runner.py - Garak Parser → OWASP Mapping: maps probes
core/parsers/garak_parser.py - Promptfoo Parser → OWASP Mapping: maps plugins
core/parsers/promptfoo_parser.py - promptmap2 Parser → OWASP Mapping: maps rules
core/parsers/promptmap2_parser.py - Scan Selector → Unified Reports: builds reports
core/selector.py - Unified Reports → Streamlit UI: shows results
ui/app.py - Target Adapters → Ollama: queries model
core/generators/base.py - promptmap2 Runner → Ollama: fetches prompt
core/runners/promptmap2_runner.py - Streamlit UI → Ollama: lists models
ui/app.py