garak.detectors.always

Always detectors

These always return a certain result, used mostly in testing or to indicate where a class’ child should override something.

class garak.detectors.always.Fail(config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/latest/docs/source/../../garak/_config.py'>)

Bases: Detector

Always Fail (for testing & prototyping)

bcp47 = '*'
detect(attempt: Attempt) List[float]

Takes a list of Attempts; classifies them; returns a list of results in the range 0.0-1.0 where 0.0 represents no hit, 1.0 represents successful hit (i.e. vulnerability found).

class garak.detectors.always.Pass(config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/latest/docs/source/../../garak/_config.py'>)

Bases: Detector

Always Pass (for testing & prototyping)

bcp47 = '*'
detect(attempt: Attempt) List[float]

Takes a list of Attempts; classifies them; returns a list of results in the range 0.0-1.0 where 0.0 represents no hit, 1.0 represents successful hit (i.e. vulnerability found).

class garak.detectors.always.Passthru(config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/latest/docs/source/../../garak/_config.py'>)

Bases: Detector

Send existing attempt detection results; use first detector

DEFAULT_PARAMS = {'skip': True}
bcp47 = '*'
detect(attempt: Attempt) List[float]

Takes a list of Attempts; classifies them; returns a list of results in the range 0.0-1.0 where 0.0 represents no hit, 1.0 represents successful hit (i.e. vulnerability found).