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 garak execution

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 overridden

  • Site config: from $HOME/.config/garak/garak.site.yaml or garak.site.json

  • Runtime 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 BuffManagerSource

Bases: object

class to store instantiated buffs

buffs = []
class GarakSubConfigSource

Bases: object

class TransientConfigSource

Bases: GarakSubConfig

Object 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/docs/source/../../garak')
report_filename = None
reportfile = None
run_id = None
starttime = None
starttime_iso = None
get_http_lib_agents()Source
load_base_config() NoneSource
load_config(site_config_filename='garak.site.yaml', run_config_filename=None) NoneSource
nested_dict()Source
parse_plugin_spec(spec: str, category: str, probe_tag_filter: str = '') tuple[List[str], List[str]]Source
set_all_http_lib_agents(agent_string)Source
set_http_lib_agents(agent_strings: dict)Source