Skip to main content

LLM Red Teaming Framework for defensive security research

Project description

HiveTrace Red

HiveTrace Red: LLM Red Teaming Framework

License Python 3.10+ Documentation

A security framework for testing Large Language Model (LLM) vulnerabilities through systematic attack methodologies and evaluation pipelines.

HiveTrace Red can be used for:

  • Red teaming your LLM applications - Test safety guardrails before deployment
  • Research & benchmarking - Systematic evaluation of LLM robustness across attack vectors
  • Compliance testing - Validate AI safety requirements and regulatory standards
  • Attack technique research - Explore and compose novel jailbreak methodologies

HiveTrace Red combines static attack templates, dynamic prompt manipulation, and adaptive evaluation to systematically explore LLM failure modes. It's built for security researchers, AI safety teams, and anyone deploying LLMs who needs to ensure their systems are robust against adversarial attacks.

Features

  • 80+ Attacks: Comprehensive library across 10 categories (roleplay, persuasion, token smuggling, etc.)
  • Multiple LLM Providers: OpenAI, GigaChat, YandexGPT, Google Gemini, and more
  • Advanced Evaluation: WildGuard evaluators and systematic response assessment
  • Async Pipeline: Efficient streaming architecture for large-scale testing
  • Multi-Language Support: Testing across multiple languages including Russian

Attack Categories

Category Description
Roleplay Persona-based jailbreaks using specific character roles
Persuasion Social engineering techniques and psychological manipulation
Token Smuggling Encoding and obfuscation methods to hide malicious intent
Context Switching Conversation redirection to confuse safety filters
In-Context Learning Few-shot examples to teach undesired behavior
Task Deflection Reframing harmful requests as legitimate tasks
Text Structure Modification Format manipulation to bypass detection
Output Formatting Specific output format requests to bypass safety
Irrelevant Information Content dilution to confuse safety filters
Simple Instructions Direct instruction-based attacks

How It Works

Base Prompts → Apply Attacks → Modified Prompts → Target Model → Responses → Evaluator → Results

The framework provides a 3-stage pipeline:

  1. Attack Generation: Apply various attack techniques to base prompts
  2. Model Testing: Send modified prompts to target LLMs
  3. Evaluation: Assess responses using WildGuard or custom evaluators

The hivetracered-report command generates comprehensive HTML reports with:

  • Executive summary with key metrics and OWASP LLM Top 10 mapping
  • Interactive charts showing attack success rates by type and name
  • Content analysis with response length distributions
  • Data explorer with filtering capabilities
  • Sample prompts and responses for detailed inspection

Results Example

The framework provides detailed attack analysis showing success rates across different attack types and individual attack techniques:

Attack Analysis Results

The analysis includes:

  • Success Rate by Attack Type: Comparative effectiveness of different attack categories (persuasion, roleplay, simple instructions, etc.)
  • Success Rate by Attack Name: Granular breakdown of individual attack technique performance

Installation

Install HiveTraceRed via pip:

pip install hivetracered

This will install the package and make the following CLI commands available:

  • hivetracered - Main CLI for running attack pipelines
  • hivetracered-report - Generate HTML reports from results
  • hivetracered-recorder - Record browser interactions for web-based models (requires pip install 'hivetracered[web]')

Alternatively, install from source:

git clone https://github.com/HiveTrace/HiveTraceRed.git
cd HiveTraceRed
pip install -e .

Documentation

📖 Complete Documentation - Installation, tutorials, API reference, and attack guides

Requirements

  • Python 3.10 or higher
  • pip package manager
  • Virtual environment (recommended)

Responsible Use

⚠️ This tool is designed for defensive security research only.

HiveTrace Red should be used exclusively for:

  • Testing and improving your own LLM systems
  • Developing robust AI safety mechanisms
  • Conducting authorized security assessments
  • Academic research on LLM vulnerabilities

Do NOT use this tool for:

  • Attacking systems you don't own or have permission to test
  • Malicious purposes or causing harm
  • Bypassing safety measures in production systems without authorization

Users are responsible for ensuring their use complies with applicable laws and the terms of service of the LLM providers they test.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hivetracered-1.0.13.tar.gz (194.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hivetracered-1.0.13-py3-none-any.whl (306.1 kB view details)

Uploaded Python 3

File details

Details for the file hivetracered-1.0.13.tar.gz.

File metadata

  • Download URL: hivetracered-1.0.13.tar.gz
  • Upload date:
  • Size: 194.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for hivetracered-1.0.13.tar.gz
Algorithm Hash digest
SHA256 d0996f6889545221976394f4d99327a484e5f1e3bb0432c713efdb1e42c63f1d
MD5 8693a5db5168d241fa5be729c968dedd
BLAKE2b-256 0dd44bc17fc27c4cf8e47a60516b2c8c6031ca8e703b8d82da27870f513c2c14

See more details on using hashes here.

File details

Details for the file hivetracered-1.0.13-py3-none-any.whl.

File metadata

  • Download URL: hivetracered-1.0.13-py3-none-any.whl
  • Upload date:
  • Size: 306.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for hivetracered-1.0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 70cddd8885c3ce06ad77d07d7656166e8201aa33381fae9924020d46457f8c9e
MD5 449b3d6d12592104fbad58aea4949156
BLAKE2b-256 376e7d9d0ece5c530730551a32405680c1b98433e09a9e19ca9992de3343d815

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page