AEGIS is a large-scale dataset and benchmark for detecting errors in Multi-Agent Systems (MAS). It provides systematically generated failure scenarios with verifiable ground-truth labels across multiple MAS frameworks, enabling development and evaluation of robust error detection methods.
AEGIS/
βββ aegis_core/ # Core AEGIS framework
β βββ malicious_factory/ # Error injection system (FMMaliciousFactory)
β βββ agent_systems/ # MAS wrapper interfaces
β βββ utils/ # Utility functions
βββ core/ # Core task definitions
βββ methods/ # MAS method implementations
β βββ dylan/ # DyLAN framework
β βββ agentverse/ # AgentVerse framework
β βββ llm_debate/ # LLM Debate framework
β βββ macnet/ # MacNet framework
β βββ ... # Other MAS frameworks
βββ magnetic_one/ # Magnetic-One specific integration
βββ model_api_configs/ # API configuration files
βββ experiments/ # Experiment configurations
βββ configs/ # MAS framework configs
βββ examples/ # Usage examples
βββ evaluation/ # Evaluation utilities
βββ utils/ # General utilities
# Clone the repository
git clone <repository-url>
cd AEGIS
# Install dependencies
pip install -r requirements.txt
Copy and modify the configuration files:
# Copy model API configuration template
cp model_api_configs/model_api_config.json.template model_api_configs/model_api_config.json
# Edit with your API keys and endpoints
from aegis_core.malicious_factory import (
FMMaliciousFactory,
FMErrorType,
InjectionStrategy,
AgentContext
)
# Initialize the FM Malicious Factory (LLM optional for instruction generation)
factory = FMMaliciousFactory(llm=None)
# Create agent context
agent_context = AgentContext(
role_name="MathSolver",
role_type="Specialist Agent",
agent_id="agent_001",
system_message="You are a math problem solver.",
tools=["calculator"],
description="A specialized agent for math problems"
)
# Generate injection instruction for a specific FM error type
task_context = "Solve: 2x + 5 = 17"
instruction = factory.get_injection_instruction(
fm_type=FMErrorType.FM_2_3, # Deviate from main goal
agent_context=agent_context,
injection_strategy=InjectionStrategy.PROMPT_INJECTION,
task_context=task_context
)
The malicious factory provides sophisticated error injection capabilities:
Standardized interfaces for various MAS frameworks:
AEGIS supports 14 failure modes based on the MAST taxonomy:
Specification Issues (FM-1.x)
Inter-Agent Misalignment (FM-2.x)
Task Verification Failures (FM-3.x)
Run evaluations using the provided scripts:
# Evaluate on AEGIS-Bench
python evaluation/evaluate.py --dataset aegis_bench --model your_model
# Evaluate on Who&When benchmark
python evaluation/evaluate.py --dataset whowhen --model your_model
IMPORTANT: This repository does NOT contain any API keys or credentials. You must configure your own API keys before use.
First, copy the environment template and configure your credentials:
# Copy environment template
cp .env.template .env
# Edit .env file with your actual API keys
nano .env # or use your preferred editor
Required environment variables (add to .env file):
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_BASE_URL=https://api.openai.com/v1
# Google/Gemini Configuration
GOOGLE_API_KEY=your_google_api_key_here
# Azure OpenAI (if using Azure)
AZURE_OPENAI_API_KEY=your_azure_api_key_here
AZURE_OPENAI_ENDPOINT=your_azure_endpoint_here
# Anthropic/Claude (if using Claude)
ANTHROPIC_API_KEY=your_anthropic_api_key_here
# Dataset Paths (optional, defaults provided)
GAIA_VALIDATION_DIR=./data/gaia/validation
GAIA_TEST_DIR=./data/gaia/test
Copy and configure the model API template:
# Copy model configuration template
cp configs/model_api_config.json.template model_api_configs/model_api_config.json
# Edit with your actual endpoints and keys
nano model_api_configs/model_api_config.json
Example configuration:
{
"gpt-4o-mini": {
"model_list": [
{
"model_name": "gpt-4o-mini-2024-07-18",
"model_url": "https://api.openai.com/v1",
"api_key": "YOUR_OPENAI_API_KEY"
}
],
"max_workers_per_model": 20
},
"gemini-2.0-flash": {
"model_list": [
{
"model_name": "gemini-2.0-flash",
"model_url": "https://generativelanguage.googleapis.com/v1beta/openai/",
"api_key": "YOUR_GEMINI_API_KEY"
}
],
"max_workers_per_model": 1
}
}
.env or model_api_configs/model_api_config.json filesEach MAS framework has its own configuration file in configs/:
config_main.yaml: General configurationconfig_humaneval.yaml: Code generation tasksconfig_math.yaml: Mathematical reasoning tasksSee the examples/ directory for detailed usage examples:
basic_error_injection.py: FM error injection workflow with FMMaliciousFactorymulti_framework_evaluation.py: Comparing different MAS frameworksIf you use AEGIS in your research, please cite:
@article{kong2025aegis,
title={AEGIS: Automated Error Generation and Attribution for Multi-Agent Systems},
author={Kong, Fanqi and Zhang, Ruijie and Yin, Huaxiao and Zhang, Guibin and Zhang, Xiaofei and Chen, Ziang and Zhang, Zhaowei and Zhang, Xiaoyuan and Zhu, Song-Chun and Feng, Xue},
journal={arXiv preprint arXiv:2509.14295},
year={2025}
}
Python
98.0%
Shell
1.7%
AEGIS is a large-scale dataset and benchmark for detecting errors in Multi-Agent Systems (MAS). It provides systematically generated failure scenarios with verifiable ground-truth labels across multiple MAS frameworks, enabling development and evaluation of robust error detection methods.
AEGIS/
βββ aegis_core/ # Core AEGIS framework
β βββ malicious_factory/ # Error injection system (FMMaliciousFactory)
β βββ agent_systems/ # MAS wrapper interfaces
β βββ utils/ # Utility functions
βββ core/ # Core task definitions
βββ methods/ # MAS method implementations
β βββ dylan/ # DyLAN framework
β βββ agentverse/ # AgentVerse framework
β βββ llm_debate/ # LLM Debate framework
β βββ macnet/ # MacNet framework
β βββ ... # Other MAS frameworks
βββ magnetic_one/ # Magnetic-One specific integration
βββ model_api_configs/ # API configuration files
βββ experiments/ # Experiment configurations
βββ configs/ # MAS framework configs
βββ examples/ # Usage examples
βββ evaluation/ # Evaluation utilities
βββ utils/ # General utilities
# Clone the repository
git clone <repository-url>
cd AEGIS
# Install dependencies
pip install -r requirements.txt
Copy and modify the configuration files:
# Copy model API configuration template
cp model_api_configs/model_api_config.json.template model_api_configs/model_api_config.json
# Edit with your API keys and endpoints
from aegis_core.malicious_factory import (
FMMaliciousFactory,
FMErrorType,
InjectionStrategy,
AgentContext
)
# Initialize the FM Malicious Factory (LLM optional for instruction generation)
factory = FMMaliciousFactory(llm=None)
# Create agent context
agent_context = AgentContext(
role_name="MathSolver",
role_type="Specialist Agent",
agent_id="agent_001",
system_message="You are a math problem solver.",
tools=["calculator"],
description="A specialized agent for math problems"
)
# Generate injection instruction for a specific FM error type
task_context = "Solve: 2x + 5 = 17"
instruction = factory.get_injection_instruction(
fm_type=FMErrorType.FM_2_3, # Deviate from main goal
agent_context=agent_context,
injection_strategy=InjectionStrategy.PROMPT_INJECTION,
task_context=task_context
)
The malicious factory provides sophisticated error injection capabilities:
Standardized interfaces for various MAS frameworks:
AEGIS supports 14 failure modes based on the MAST taxonomy:
Specification Issues (FM-1.x)
Inter-Agent Misalignment (FM-2.x)
Task Verification Failures (FM-3.x)
Run evaluations using the provided scripts:
# Evaluate on AEGIS-Bench
python evaluation/evaluate.py --dataset aegis_bench --model your_model
# Evaluate on Who&When benchmark
python evaluation/evaluate.py --dataset whowhen --model your_model
IMPORTANT: This repository does NOT contain any API keys or credentials. You must configure your own API keys before use.
First, copy the environment template and configure your credentials:
# Copy environment template
cp .env.template .env
# Edit .env file with your actual API keys
nano .env # or use your preferred editor
Required environment variables (add to .env file):
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_BASE_URL=https://api.openai.com/v1
# Google/Gemini Configuration
GOOGLE_API_KEY=your_google_api_key_here
# Azure OpenAI (if using Azure)
AZURE_OPENAI_API_KEY=your_azure_api_key_here
AZURE_OPENAI_ENDPOINT=your_azure_endpoint_here
# Anthropic/Claude (if using Claude)
ANTHROPIC_API_KEY=your_anthropic_api_key_here
# Dataset Paths (optional, defaults provided)
GAIA_VALIDATION_DIR=./data/gaia/validation
GAIA_TEST_DIR=./data/gaia/test
Copy and configure the model API template:
# Copy model configuration template
cp configs/model_api_config.json.template model_api_configs/model_api_config.json
# Edit with your actual endpoints and keys
nano model_api_configs/model_api_config.json
Example configuration:
{
"gpt-4o-mini": {
"model_list": [
{
"model_name": "gpt-4o-mini-2024-07-18",
"model_url": "https://api.openai.com/v1",
"api_key": "YOUR_OPENAI_API_KEY"
}
],
"max_workers_per_model": 20
},
"gemini-2.0-flash": {
"model_list": [
{
"model_name": "gemini-2.0-flash",
"model_url": "https://generativelanguage.googleapis.com/v1beta/openai/",
"api_key": "YOUR_GEMINI_API_KEY"
}
],
"max_workers_per_model": 1
}
}
.env or model_api_configs/model_api_config.json filesEach MAS framework has its own configuration file in configs/:
config_main.yaml: General configurationconfig_humaneval.yaml: Code generation tasksconfig_math.yaml: Mathematical reasoning tasksSee the examples/ directory for detailed usage examples:
basic_error_injection.py: FM error injection workflow with FMMaliciousFactorymulti_framework_evaluation.py: Comparing different MAS frameworksIf you use AEGIS in your research, please cite:
@article{kong2025aegis,
title={AEGIS: Automated Error Generation and Attribution for Multi-Agent Systems},
author={Kong, Fanqi and Zhang, Ruijie and Yin, Huaxiao and Zhang, Guibin and Zhang, Xiaofei and Chen, Ziang and Zhang, Zhaowei and Zhang, Xiaoyuan and Zhu, Song-Chun and Feng, Xue},
journal={arXiv preprint arXiv:2509.14295},
year={2025}
}
Python
98.0%
Shell
1.7%