How hiteshsai01/garak works
garak is a command-line red-team scanner for LLM-backed systems. A user selects a target generator and vulnerability probes; the runtime loads plugins, runs probe attempts against the target, evaluates responses with detectors, and records results for later analysis. Its separate garak-report frontend presents report summaries and charts. The map includes documented plugin families and reporting capabilities, but detailed connections among unsampled implementations are omitted unless supported by the README or source index.
Main entry points: command.py Run coordinator · cli.py CLI commands · Report.tsx Report views · _config.py Run configuration
Components 20
Scan orchestration
- CLI commands
garak/cli.py - Run configuration
garak/_config.py - Plugin selection
garak/_selection.py - Plugin loader
garak/_plugins.py - Run coordinator
garak/command.py - Attempt records
garak/attempt.py
Assessment plugins
- Probe families
garak/probes - Detector families
garak/detectors - Harnesses
garak/harnesses - Intent service
garak/services/intentservice.py
Target execution
- Target generators
garak/generators - Language providers
garak/services/langservice.py
Results and analysis
- Report output
garak/report.py - Report analysis
garak/analyze
Report interface
- Report application
garak-report/src/App.tsx - Report views
garak-report/src/pages/Report.tsx - Charts and summaries
garak-report/src/components
Other components
- CLI user
- LLM target
- Scan report
Connections 19
- CLI user → CLI commands: selects scan
README.md - CLI commands → Run configuration: loads options
garak/cli.py - CLI commands → Plugin loader: lists plugins
garak/cli.py - CLI commands → Run coordinator: starts run
garak/cli.py - Run configuration → Plugin selection: builds selection
garak/_config.py - Run coordinator → Plugin loader: loads plugins
garak/command.py - Run coordinator → Probe families: invokes probes
garak/command.py - Run coordinator → Harnesses: dispatches run
garak/command.py - Run coordinator → Intent service: requests intent data
garak/command.py - Probe families → Attempt records: creates attempts
garak/probes/base.py - Run coordinator → Target generators: selects target
garak/command.py - Target generators → LLM target: queries
README.md - Run coordinator → Detector families: selects detectors
README.md - Run coordinator → Report analysis: runs digest
garak/command.py - Run coordinator → Report output: writes results
README.md - Report analysis → Scan report: reads run logs
README.md - Scan report → Report views: provides report
- Report application → Report views: renders
garak-report/src/App.tsx - Report views → Charts and summaries: presents summaries