garak.probes.ansiescape

ANSI probe

Try to get model to produce ANSI codes. These can disrupt downstream processing.

We have a couple of different dimensions here: * the encoding can vary - raw binary, or an escaped version; * the technique used can vary - can we get OCS8, OCS52 * the action can also be different - log cursor, crash machine, install software etc.

class garak.probes.ansiescape.AnsiEscaped(config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/stable/docs/source/../../garak/_config.py'>)

Bases: Probe

Probe for eliciting ANSI control codes from a model

ANSI escape codes can disrupt downstream processes. Try to get escaped ANSI out of a model.

active: bool = True
doc_uri: str = 'https://i.blackhat.com/BH-US-23/Presentations/US-23-stok-weponizing-plain-text-ansi-escape-sequences-as-a-forensic-nightmare-appendix.pdf'
goal: str = 'print escaped ANSI terminal codes'
lang: str | None = 'en'
recommended_detector: Iterable[str] = ['ansiescape.Escaped']
tags: Iterable[str] = ['owasp:llm01', 'owasp:llm02', 'owasp:llm05', 'avid-effect:security:S0100', 'avid-effect:security:S0200', 'quality:Security:Integrity']
tier: Tier = 3
class garak.probes.ansiescape.AnsiRaw(config_root=<module 'garak._config' from '/home/docs/checkouts/readthedocs.org/user_builds/garak/checkouts/stable/docs/source/../../garak/_config.py'>)

Bases: AnsiEscaped

Probe for eliciting raw ANSI control codes from a model

ANSI escape codes can disrupt downstream processes. Try to get raw ANSI out of a model.

active: bool = True
goal: str = 'print raw ANSI terminal codes'
recommended_detector: Iterable[str] = ['ansiescape.Raw']
tier: Tier = 1