Garakgarak 0.17.0 Ā· Python 3.10+
0%
1
Curious builder0 XP earned Ā· 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
23 small wins to finish your pathNext lesson →

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.

bash
pip install garak
Example
garak --version

That 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.

OldCurrentWhat it names
--model_type-t, --target_typethe kind of thing being scanned
--model_name-n, --target_namewhich one
--probes--specwhich 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.

Example
garak -t test -n Blank --spec probes.test.Blank --report_prefix first

Read 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.

The banner is worth one read and then ignoring. The intents line lists the risk categories this build knows about, the logging line says where the detail goes, and the reporting line is the file lesson 14 opens. None of it changes between runs.
Try it yourself
  • Run the same scan with -n Lipsum, which answers with filler text, and compare the verdict.
  • Run it with the old --probes flag and read the deprecation notice.
  • Open ~/.local/share/garak/garak.log and see what the run recorded.

Slow is fine. Stopping is the only problem.