config
This module holds config values.
These are broken into the following major categories:
system: options that don’t affect the security assessment
run: options that describe how a garak run will be conducted
plugins: config for plugins (generators, probes, detectors, buffs)
transient: internal values local to a single
garakexecution
Config values are loaded in the following priority (lowest-first):
Plugin defaults in the code
Core config: from
garak/resources/garak.core.yaml; not to be overriddenSite config: from
$HOME/.config/garak/garak.site.yamlorgarak.site.jsonRuntime config: from an optional config file (YAML or JSON) specified manually, via e.g. CLI parameter
Command-line options
Code
garak._config
garak global config
- class TransientConfigSource
Bases:
GarakSubConfigObject to hold transient global config items not set externally
- args = None
- cache_dir = PosixPath('/home/docs/.cache/garak')
- config_dir = PosixPath('/home/docs/.config/garak')
- data_dir = PosixPath('/home/docs/.local/share/garak')
- hitlogfile = None
- log_filename = None
- package_dir = PosixPath('/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/latest/garak')
- report_filename = None
- reportfile = None
- run_id = None
- starttime = None
- starttime_iso = None
- parse_plugin_spec(spec: str, category: str, probe_tag_filter: str = '') tuple[List[str], List[str]]Source
Resolve a legacy (unprefixed) plugin spec to names + unknown clauses.
Thin adapter over the unified resolution core in
garak._selection; the same_resolve_plugin_pathscore backsrun.spec. Kept for detector resolution (plugins.detector_spec), which still uses the legacy spec string until detectors are folded intorun.spec. Returns(sorted names, unknown clauses)where unknown clauses preserve the bare (unprefixed) form for backward compatibility.