garak.generators.guardrails

This is a generator for warpping a NeMo Guardrails configuration. Using this garak generator enables security testing of a Guardrails config.

The guardrails generator expects a path to a valid Guardrails configuration to be passed as its name. For example,

garak -m guardrails -n sample_abc/config

This generator requires installation of the guardrails Python package.

When invoked, garak sends prompts in series to the Guardrails setup using rails.generate, and waits for a response. The generator does not support parallisation, so it’s recommended to run smaller probes, or set generations to a low value, in order to reduce garak run time.

NeMo Guardrails generator.

class garak.generators.guardrails.NeMoGuardrails(name='', config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/latest/docs/source/../../garak/_config.py'>)

Bases: Generator

Generator wrapper for NeMo Guardrails.

generator_family_name = 'Guardrails'
supports_multiple_generations = False