meta-llama/PurpleLlama

Set of tools to assess and improve LLM security.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 53 minutes ago
Added to GitGenius on July 25th, 2024
Created on December 6th, 2023
Open Issues & Pull Requests: 85 (+0)
Number of forks: 770
Total Stargazers: 4,364 (+0)
Total Subscribers: 67 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 5.3 days
Mean response time: 26.5 days
90th percentile: 86.9 days
Tracked items: 75

How this project is maintained

Around half of the issues opened in the past year never receive a reply. 100% of open issues come from outside the core team, so the backlog reflects real-world use rather than internal planning. Work labelled "CyberSecEval" is answered fastest, typically in about 2 days, while "Llama-Guard" waits about 4 weeks. Only 5% of issues opened in the past year have been closed. Three people close 70% of everything that gets resolved.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 38
New in 7 days: 1
Closed in 7 days: 0
Avg open age: 155 days
Stale 30+ days: 33
Stale 90+ days: 26

Recent activity

Opened in 7 days: 1
Closed in 7 days: 0
Comments in 7 days: 1
Events in 7 days: 1

Top labels

  • Llama-Guard (17)
  • CyberSecEval (14)
  • Prompt-Guard (4)
  • Code-Shield (3)
  • LlamaFirewall (1)
  • question (1)

Detailed Description

Purple Llama is Meta's umbrella project designed to provide tools and evaluations for assessing and improving the security of large language models. Written primarily in Python, the repository brings together safeguarding mechanisms and cybersecurity benchmarks to help developers build responsibly with open generative AI models. The project draws its name from the cybersecurity concept of purple teaming, which combines both red team attack and blue team defensive postures into a collaborative approach for evaluating and mitigating risks in generative AI systems.

The repository contains three primary safeguard components. Llama Guard is a series of input and output moderation models built by fine-tuning Meta-Llama models to detect violating content according to the MLCommons standard hazards taxonomy. Llama Guard 3 specifically supports detection of cyberattack responses and malicious code output, with models available in multiple sizes including 8B and 1B parameter versions, plus a 11B vision-capable variant. Prompt Guard protects LLM applications from malicious prompts by detecting prompt injection attacks and jailbreaks that attempt to override model safety features. Code Shield provides inference-time filtering of insecure code generated by LLMs, offering mitigation against insecure code suggestions and code interpreter abuse.

The evaluation and benchmarking component centers on the CyberSec Eval suite, which represents the first industry-wide cybersecurity safety evaluations for LLMs. CyberSec Eval v1 was built in collaboration with security subject matter experts using industry guidance from CWE and MITRE ATT&CK standards. It provides metrics for quantifying cybersecurity risks, tools for evaluating insecure code suggestion frequency, and assessments of LLM compliance with malicious requests. CyberSec Eval 2 expanded the scope to measure code interpreter abuse propensity, offensive cybersecurity capabilities, and prompt injection susceptibility. The most recent CyberSec Eval 3 added test suites for visual prompt injection, spear phishing capabilities, and autonomous offensive cyber operations, with results available on a Hugging Face leaderboard.

Licensing across Purple Llama components is permissive to enable both research and commercial usage. Evaluations and benchmarks use the MIT license, while safeguard models use the corresponding Llama Community licenses depending on their base model version. The project emphasizes community collaboration and standardization of trust and safety tools for generative AI development, with contribution guidelines available in the repository's CONTRIBUTING file and integration planned within the broader Llama reference system and llama-recipes repository.