Install garak and scan something
Garak is a Python package and a command. The install brings the probes and detectors with it, so the first scan needs nothing else.
pip install garakgarak --versionThat version matters more than usual here. Garak's command line changed recently, and most tutorials you will find still use the old flags, which is the next thing to know.
The flags that changed
The tool used to take --model_type, --model_name and --probes. All three still work and all three print a deprecation notice. The current spellings are -t for the target type, -n for its name, and --spec for what to run.
| Old | Current | What it names |
|---|---|---|
| --model_type | -t, --target_type | the kind of thing being scanned |
| --model_name | -n, --target_name | which one |
| --probes | --spec | which probes to run |
Scanning with nothing installed
Garak ships generators that need no key at all, which is how a first scan can happen before any decision about models. test.Blank answers every prompt with an empty string.
garak -t test -n Blank --spec probes.test.Blank --report_prefix firstRead the last three lines. A probe ran, a detector scored it, and the run wrote a report. The verdict says the detector found nothing in every one of the five answers, which is correct: the generator answered nothing at all.
- Run the same scan with
-n Lipsum, which answers with filler text, and compare the verdict. - Run it with the old
--probesflag and read the deprecation notice. - Open
~/.local/share/garak/garak.logand see what the run recorded.
Slow is fine. Stopping is the only problem.