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 →

What you are going to build

Garak is a scanner. You point it at something that answers prompts, it sends a few hundred of them, and it tells you which answers were a problem. This course scans one support assistant, and every lesson runs on your machine with no API key.

You already test what your assistant does when a customer asks a normal question. A scanner asks the other questions: the confusing ones, the ones with instructions hidden in them, the ones designed to make it say something it should not.

Point garak only at systems you are allowed to test. That means your own application, in your own environment, with the people responsible for it aware that it is happening. This course scans a Python function you wrote, which is the safest possible target.

A scan, working

Example
garak -t function -n support_bot#reply --spec probes.test.Blank --report_prefix scan

One probe, five prompts, and a verdict with a number on it. The bot under test is an ordinary Python function, which is the point: garak scans whatever answers, and it does not care whether a model is involved.

What the pieces are called

PieceWhat it doesLesson
GeneratorThe thing being scanned. Yours is a Python function4
ProbeWhere the prompts come from7
DetectorDecides whether an answer was a problem11
AttemptOne prompt, its answers, and what the detectors said14
ReportA JSON line per attempt, kept for later14
BuffRewrites prompts before they are sent17
Attack success rateThe share of answers that were a problem16
Where the course goes
the targetthe promptsthe verdictthe evidencegarak

What you need

  • Python 3.10 or newer, and pip install garak.
  • No key and no account. Every scan here runs against your own code.
  • A terminal.
Try it yourself
  • Read the table and pick the row you most want to understand.
  • Write down one thing your own assistant must never say. That is a detector, in lesson 13.
Back toAll frameworks

Every expert started right here.