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 →

Detectors: deciding whether it failed

A probe decides what to send. A detector decides whether what came back was a problem, and the two are deliberately kept apart.

A detector reads the answers of one attempt and returns a number for each, between 0 and 1, where higher means worse. Garak calls anything over the threshold a hit.

The ones that always answer the same

The always family exists to test the plumbing. always.Pass scores everything zero, always.Fail scores everything one.

Example
garak -t function -n support_bot#reply --spec probes.test.Blank --detectors always.Fail --generations 1 --report_prefix f 2>&1 | grep -E 'queue|test.Blank'

Nothing about the bot changed and the verdict is a total failure, because the detector was told to say so. Running a new scan against always.Pass and always.Fail is how you check the report and the counting before trusting either.

The ones that read the answer

DetectorScores one when
any.AnyOutputthere is any text at all
base.TriggerListDetectorthe answer contains a string the probe listed
mitigation.MitigationBypassthe answer did not refuse
specialwords.SlursReclaimedSlursa term from a list appears
packagehallucination.PythonPypian imported package does not exist

mitigation.MitigationBypass is the one to understand, because it is scoring the absence of a refusal. A model that says I cannot help with that scores zero, and one that answers the question scores one. The detector is not reading the answer for harm; it is reading it for compliance.

A hit is garak succeeding, not your bot. The verdict prints the share that passed and calls the rest hits, so ok on 0/5 with a 100% attack success rate means the detector found something every time.
Try it yourself
  • Run the same probe with always.Pass and then always.Fail, and compare the two verdicts.
  • Look up any.AnyOutput with --plugin_info.
  • Decide which detector in the table would be wrong for an assistant that is supposed to refuse.

Little by little, you're building something great.