A LangGraph multi-agent system designed to jailbreak and analyze other LangGraph systems through automated testing and vulnerability assessment.
Metatesters is an innovative security testing framework that uses AI agents to automatically analyze, test, and find vulnerabilities in LangGraph-based agentic systems. It employs a multi-stage approach:
- Static Graph Analysis - Analyzes the structure and components of target LangGraph systems
- Dynamic Testing Team Generation - Creates specialized AI tester personas based on the analysis
- Automated Test Case Generation - Generates comprehensive test cases including edge cases and fault injection
- Vulnerability Assessment - Executes tests and identifies potential security issues and bugs
- Graph Analysis Agent (
app/agents/graph_analysis/
) - Performs static analysis of target LangGraph systems - Testing Team Agent (
app/agents/testing_team/
) - Generates specialized AI testers and test cases - Arithmetic Sample Agent (
app/agents/arithmetic_sample/
) - Example target system for demonstration - Web UI (
app/ui/
) - Gradio-based interface for interacting with the system - Database Service (
app/service/
) - SQLite-based storage for test results and tester profiles
- Python 3.12+
- OpenAI API key or Azure OpenAI access
- UV package manager (recommended) or pip
-
Clone the repository:
git clone https://github.com/marcos-rg/metatesters.git cd metatesters
-
Install dependencies:
# Using UV (recommended) uv sync # Or using pip pip install -e .
-
Set up environment variables:
cp .env.example .env # Edit .env with your API keys
-
Run the application:
# Start the web interface python main.py # Or run LangGraph development server make test
-
Launch the application:
python main.py
-
Step 1: Analyze Graph
- The system will analyze a sample arithmetic LangGraph system
- View the generated graph visualization and structure analysis
-
Step 2: Generate Testing Team
- Provide feedback to guide tester creation
- The system generates specialized AI tester personas
- Each tester focuses on specific vulnerability types
-
Step 3: Review Test Results
- View generated test cases
- Analyze identified vulnerabilities
- Export results for further analysis
from app.agents import graph_analysis_app, testing_team_app
# Analyze a target graph
result = graph_analysis_app.invoke({
"user_description": "Description of target system",
"valid_input": {"messages": [...]},
"graph_before_compile": target_graph
})
# Generate testing team
testers = testing_team_app.invoke({
"graph_description": result["graph_description"],
"graph_history_sample": result["history_to_show"],
"human_analyst_feedback": "Focus on security vulnerabilities",
"max_analysts": 3,
"min_test_cases": 6
})
The system generates specialized AI testers, including:
- Security Tester - Focuses on authentication, authorization, and data leakage
- Edge Case Tester - Tests boundary conditions and unusual inputs
- Fault Injection Tester - Simulates system failures and error conditions
- Performance Tester - Identifies scalability and performance issues
- Logic Tester - Tests business logic and workflow correctness
metatesters/
βββ app/
β βββ agents/ # Multi-agent system components
β β βββ arithmetic_sample/ # Example target system
β β βββ graph_analysis/ # Static graph analysis agent
β β βββ testing_team/ # Test generation agent
β β βββ config/ # Configuration management
β β βββ utils/ # Shared utilities
β βββ config/ # Application configuration
β βββ service/ # Database and external services
β βββ ui/ # Gradio web interface
βββ main.py # Application entry point
βββ langgraph.json # LangGraph configuration
βββ pyproject.toml # Project dependencies
βββ Makefile # Development commands
Create a .env
file with:
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key
# Azure OpenAI Configuration (alternative)
AZURE_OPENAI_API_KEY=your_azure_key
AZURE_OPENAI_ENDPOINT=your_azure_endpoint
# Database
SQLITE_PATH=./metatesters.db
# Logging
LOG_LEVEL=INFO
Configure models in app/agents/config/graph_config.py
:
# Supported models
- azure_openai/gpt-4.1
- openai/gpt-4
- openai/gpt-3.5-turbo
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork and clone the repository
- Create a virtual environment:
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install development dependencies:
uv sync --dev
This project is licensed under the MIT License - see the LICENSE file for details.
- LangGraph - Framework for building stateful, multi-actor applications
- LangChain - Building applications with LLMs
- Gradio - Web UI framework
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: [email protected]
- LangChain team for the amazing LangGraph framework
- The open-source community for inspiration and tools
- Security researchers working on AI safety