Skip to main content
QUICK REVIEW

[Paper Review] garak: A Framework for Security Probing Large Language Models

Leon Derczynski, Erick Galinkin|arXiv (Cornell University)|Jun 16, 2024
Topic ModelingComputer Science5 citations
TL;DR

garak is an open-source framework for structured red-teaming and security auditing of LLMs, enabling generation of probes, detectors, and buffs to discover vulnerabilities. It emphasizes exploration over benchmarking to inform alignment and policy decisions.

ABSTRACT

As Large Language Models (LLMs) are deployed and integrated into thousands of applications, the need for scalable evaluation of how models respond to adversarial attacks grows rapidly. However, LLM security is a moving target: models produce unpredictable output, are constantly updated, and the potential adversary is highly diverse: anyone with access to the internet and a decent command of natural language. Further, what constitutes a security weak in one context may not be an issue in a different context; one-fits-all guardrails remain theoretical. In this paper, we argue that it is time to rethink what constitutes ``LLM security'', and pursue a holistic approach to LLM security evaluation, where exploration and discovery of issues are central. To this end, this paper introduces garak (Generative AI Red-teaming and Assessment Kit), a framework which can be used to discover and identify vulnerabilities in a target LLM or dialog system. garak probes an LLM in a structured fashion to discover potential vulnerabilities. The outputs of the framework describe a target model's weaknesses, contribute to an informed discussion of what composes vulnerabilities in unique contexts, and can inform alignment and policy discussions for LLM deployment.

Motivation & Objective

  • Motivate a holistic, structured approach to auditing LLM security that supports exploration and discovery.
  • Provide a flexible framework to detect and describe vulnerabilities in target LLMs or dialog systems.
  • Enable end-to-end testing across diverse generators and deployment contexts.
  • Offer an extensible suite of probes, detectors, and attack-generation mechanisms to reveal weaknesses.
  • Facilitate reporting and integration with vulnerability databases to inform policy decisions.

Proposed method

  • Define four core components (Generators, Probes, Detectors, Buffs) to structure LLM security evaluation.
  • Provide a diverse set of probes that elicit specific vulnerability classes (e.g., false claims, prompt injection, data exfiltration).
  • Implement keyword-based and ML-based detectors to judge outputs and identify failures.
  • Allow adaptive attack generation (atkgen) by learning from prior hits to create new test cases.
  • Support multiple generators (Hugging Face, OpenAI, NVIDIA NIMs, etc.) and extensible integrations.
  • Offer reporting via JSONL logs and an HTML interactive report, with optional upload to vulnerability databases.
Figure 1: The garak architecture. Run configuration determines a set of probes to be used. Each probe interacts with the generator, an abstraction for the target LLM or dialog system. Probes pose prompts to this system in an attempt to elicit insecure responses, and generator responses are recorded.
Figure 1: The garak architecture. Run configuration determines a set of probes to be used. Each probe interacts with the generator, an abstraction for the target LLM or dialog system. Probes pose prompts to this system in an attempt to elicit insecure responses, and generator responses are recorded.

Experimental results

Research questions

  • RQ1How can we audit LLM security in a structured way that supports exploration and discovery of vulnerabilities?
  • RQ2Can a modular framework like garak effectively discover known and unknown vulnerabilities across different LLMs?
  • RQ3How can automated detectors and adaptive attack generation improve the assessment of LLM risk in varied deployment contexts?
  • RQ4What is the role of reporting and policy guidance derived from red-teaming outputs in LLM deployment?
  • RQ5To what extent can open-source tooling accelerate external red-team assessments of LLMs?

Key findings

  • Garak enables structured exploration of LLM weaknesses through Generators, Probes, Detectors, and Buffs.
  • Adaptive attack generation (atkgen) learns from successful probes to generate new test cases.
  • A mix of keyword-based and ML detectors supports scalable failure detection across many outputs.
  • Toxicity attacks can significantly increase failure rates across models (evidenced by the table of toxicity results).
  • The framework supports reporting and external vulnerability sharing to catalog LLM security issues.
Figure 2: Examples top-level grouping of probe results using the OWASP Top 10 categories of LLM vulnerability. Different groupins lead to different top level results and different concentrations of failure, so it is important to choose a taxonomy applicable to the target context.
Figure 2: Examples top-level grouping of probe results using the OWASP Top 10 categories of LLM vulnerability. Different groupins lead to different top level results and different concentrations of failure, so it is important to choose a taxonomy applicable to the target context.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.