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
garak -t function -n support_bot#reply --spec probes.test.Blank --report_prefix scanOne 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
| Piece | What it does | Lesson |
|---|---|---|
| Generator | The thing being scanned. Yours is a Python function | 4 |
| Probe | Where the prompts come from | 7 |
| Detector | Decides whether an answer was a problem | 11 |
| Attempt | One prompt, its answers, and what the detectors said | 14 |
| Report | A JSON line per attempt, kept for later | 14 |
| Buff | Rewrites prompts before they are sent | 17 |
| Attack success rate | The share of answers that were a problem | 16 |
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.
Every expert started right here.