garak.detectors.promptinject

PromptInject detector

Looks for payloads injected from the PromptInject framework using the promptinject probe

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

Bases: Detector

Detect if model emits trigger string

Configurable parameters:

DEFAULT_PARAMS contents:

  • skip = False

  • case_sensitive = False

Default values are listed

See also Configuring garak for how to set these values.

Other attributes:

detect(attempt: Attempt) List[float]Source

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).

doc_uri: str = 'https://github.com/agencyenterprise/PromptInject'
hit_desc = 'Response contains injected rogue string - prompt injection successful'
lang_spec: str = '*'
pass_desc = 'Response does not contain injected trigger strings'