# greysahy/aciarena architecture

> Architecture diagram of the GitHub repository greysahy/aciarena, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/greysahy/aciarena
- Repository: https://github.com/greysahy/aciarena

## Overview

ACIArena evaluates multi-agent systems against cascading-injection attacks across task domains, with defenses and attack-success verification as evaluation concerns. The main workflow is evaluation orchestration, task execution through a selected MAS, and attack/defense assessment. The tree and excerpts support the principal modules and several calls; some MAS implementations and evaluation wiring are unsampled, so their internal links are omitted rather than inferred.

Main entry points: [`aciarena/mas/base_mas.py`](https://github.com/greysahy/aciarena/blob/main/aciarena/mas/base_mas.py) (MAS Lifecycle), [`aciarena/attacks/base_attack.py`](https://github.com/greysahy/aciarena/blob/main/aciarena/attacks/base_attack.py) (Attack Strategies), [`aciarena/evaluation/task_executor.py`](https://github.com/greysahy/aciarena/blob/main/aciarena/evaluation/task_executor.py) (Task Executor), [`aciarena/utils/factory.py`](https://github.com/greysahy/aciarena/blob/main/aciarena/utils/factory.py) (Registries and Factory)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_evaluation["Evaluation"]
  node_executor["Task Executor<br/>[task_executor.py]"]
  node_suite["Evaluation Suite"]
  node_dataset["Dataset Selection<br/>[selection.py]"]
  node_tasks["Task Domains"]
  node_factory["Registries and Factory<br/>[factory.py]"]
  node_logger["Evaluation Logging<br/>[logger.py]"]
end

subgraph group_agents["Agent Runtime"]
  node_baseagent["Agent Lifecycle<br/>[base_agent.py]"]
  node_llm["LLM Interface<br/>[base_llm.py]"]
  node_openai["OpenAI Adapter<br/>[openai_llm.py]"]
  node_memory["Conversation Memory<br/>[base_memory.py]"]
end

subgraph group_systems["Multi-Agent Systems"]
  node_masbase["MAS Lifecycle<br/>[base_mas.py]"]
  node_camel["CAMEL<br/>[camel_mas.py]"]
  node_camelprompt["CAMEL Prompts<br/>[prompt.py]"]
  node_debate["LLM Debate<br/>[llm_debate_mas.py]"]
  node_debateagents["Debate Roles"]
  node_agentverse["AgentVerse"]
  node_autogen["AutoGen"]
  node_mad["MAD"]
  node_metagpt["MetaGPT<br/>[metagpt_mas.py]"]
  node_metagptagent["MetaGPT Roles<br/>[metagpt_agent.py]"]
  node_selfconsistency["Self-Consistency"]
end

subgraph group_security["Attack and Defense"]
  node_attacks["Attack Strategies<br/>[base_attack.py]"]
  node_disclosure["Disclosure Attacks"]
  node_disruption["Disruption Attacks"]
  node_hijacking["Hijacking Attacks"]
  node_sentinel["ACI Sentinel<br/>[aci_sentinel.py]"]
  node_detector["BERT Detector<br/>[bert_detector.py]"]
end

node_user(("Evaluator"))
node_llmservice{{"OpenAI API"}}

node_user -->|"runs evaluation"| node_executor
node_executor -->|"builds components"| node_factory
node_executor -->|"selects tasks"| node_tasks
node_executor -->|"loads attacks"| node_attacks
node_executor -->|"configures defense"| node_sentinel
node_executor -->|"constructs MAS"| node_masbase
node_suite -->|"uses task types"| node_tasks
node_suite -->|"uses attacks"| node_attacks
node_suite -.->|"selects datasets"| node_dataset
node_factory -->|"creates logger"| node_logger
node_factory -->|"builds MAS"| node_masbase
node_factory -->|"builds attacks"| node_attacks
node_baseagent -->|"calls interface"| node_llm
node_baseagent -->|"initializes provider"| node_openai
node_baseagent -->|"stores conversation"| node_memory
node_openai -->|"sends completions"| node_llmservice
node_masbase -->|"manages agents"| node_baseagent
node_camel -->|"uses prompts"| node_camelprompt
node_camel -->|"registers system"| node_factory
node_debate -->|"creates and queries"| node_debateagents
node_debate -->|"extends lifecycle"| node_masbase
node_metagptagent -->|"extends agent"| node_baseagent
node_metagpt -.->|"uses role agents"| node_metagptagent
node_agentverse -.->|"implements system"| node_masbase
node_autogen -.->|"implements system"| node_masbase
node_mad -.->|"implements system"| node_masbase
node_selfconsistency -.->|"implements system"| node_masbase
node_attacks -->|"modifies system"| node_masbase
node_disclosure -->|"extends attack base"| node_attacks
node_disruption -->|"extends attack base"| node_attacks
node_hijacking -->|"extends attack base"| node_attacks
node_sentinel -->|"uses model interface"| node_openai

click node_executor "https://github.com/greysahy/aciarena/blob/main/aciarena/evaluation/task_executor.py"
click node_suite "https://github.com/greysahy/aciarena/blob/main/aciarena/evaluation/evaluation_suite.py"
click node_dataset "https://github.com/greysahy/aciarena/blob/main/aciarena/evaluation/datasets/selection.py"
click node_tasks "https://github.com/greysahy/aciarena/tree/main/aciarena/evaluation/task"
click node_factory "https://github.com/greysahy/aciarena/blob/main/aciarena/utils/factory.py"
click node_baseagent "https://github.com/greysahy/aciarena/blob/main/aciarena/agent_components/base_agent.py"
click node_llm "https://github.com/greysahy/aciarena/blob/main/aciarena/agent_components/llms/base_llm.py"
click node_openai "https://github.com/greysahy/aciarena/blob/main/aciarena/agent_components/llms/openai_llm.py"
click node_memory "https://github.com/greysahy/aciarena/blob/main/aciarena/agent_components/memory/base_memory.py"
click node_masbase "https://github.com/greysahy/aciarena/blob/main/aciarena/mas/base_mas.py"
click node_camel "https://github.com/greysahy/aciarena/blob/main/aciarena/mas/camel/camel_mas.py"
click node_camelprompt "https://github.com/greysahy/aciarena/blob/main/aciarena/mas/camel/prompt.py"
click node_debate "https://github.com/greysahy/aciarena/blob/main/aciarena/mas/llm_debate/llm_debate_mas.py"
click node_debateagents "https://github.com/greysahy/aciarena/tree/main/aciarena/mas/llm_debate/agents"
click node_agentverse "https://github.com/greysahy/aciarena/tree/main/aciarena/mas/agentverse"
click node_autogen "https://github.com/greysahy/aciarena/tree/main/aciarena/mas/autogen"
click node_mad "https://github.com/greysahy/aciarena/tree/main/aciarena/mas/mad"
click node_metagpt "https://github.com/greysahy/aciarena/blob/main/aciarena/mas/metagpt/metagpt_mas.py"
click node_metagptagent "https://github.com/greysahy/aciarena/blob/main/aciarena/mas/metagpt/agents/metagpt_agent.py"
click node_selfconsistency "https://github.com/greysahy/aciarena/tree/main/aciarena/mas/self_consistency"
click node_attacks "https://github.com/greysahy/aciarena/blob/main/aciarena/attacks/base_attack.py"
click node_disclosure "https://github.com/greysahy/aciarena/blob/main/aciarena/attacks/disclosure_attack.py"
click node_disruption "https://github.com/greysahy/aciarena/blob/main/aciarena/attacks/disruption_attack.py"
click node_hijacking "https://github.com/greysahy/aciarena/blob/main/aciarena/attacks/hijacking_attack.py"
click node_sentinel "https://github.com/greysahy/aciarena/blob/main/aciarena/defenses/aci_sentinel.py"
click node_detector "https://github.com/greysahy/aciarena/blob/main/aciarena/defenses/bert_detector.py"
click node_logger "https://github.com/greysahy/aciarena/blob/main/aciarena/utils/logger.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_executor,node_suite,node_dataset,node_tasks,node_factory,node_logger toneBlue
class node_baseagent,node_llm,node_openai,node_memory toneAmber
class node_masbase,node_camel,node_camelprompt,node_debate,node_debateagents,node_agentverse,node_autogen,node_mad,node_metagpt,node_metagptagent,node_selfconsistency,node_llmservice toneMint
class node_attacks,node_disclosure,node_disruption,node_hijacking,node_sentinel,node_detector toneRose
class node_user toneIndigo
```

## Components

### Evaluation

- [Task Executor](https://github.com/greysahy/aciarena/blob/main/aciarena/evaluation/task_executor.py): `aciarena/evaluation/task_executor.py`
- [Evaluation Suite](https://github.com/greysahy/aciarena/blob/main/aciarena/evaluation/evaluation_suite.py): `aciarena/evaluation/evaluation_suite.py`
- [Dataset Selection](https://github.com/greysahy/aciarena/blob/main/aciarena/evaluation/datasets/selection.py): `aciarena/evaluation/datasets/selection.py`
- [Task Domains](https://github.com/greysahy/aciarena/tree/main/aciarena/evaluation/task): `aciarena/evaluation/task`
- [Registries and Factory](https://github.com/greysahy/aciarena/blob/main/aciarena/utils/factory.py): `aciarena/utils/factory.py`
- [Evaluation Logging](https://github.com/greysahy/aciarena/blob/main/aciarena/utils/logger.py): `aciarena/utils/logger.py`

### Agent Runtime

- [Agent Lifecycle](https://github.com/greysahy/aciarena/blob/main/aciarena/agent_components/base_agent.py): `aciarena/agent_components/base_agent.py`
- [LLM Interface](https://github.com/greysahy/aciarena/blob/main/aciarena/agent_components/llms/base_llm.py): `aciarena/agent_components/llms/base_llm.py`
- [OpenAI Adapter](https://github.com/greysahy/aciarena/blob/main/aciarena/agent_components/llms/openai_llm.py): `aciarena/agent_components/llms/openai_llm.py`
- [Conversation Memory](https://github.com/greysahy/aciarena/blob/main/aciarena/agent_components/memory/base_memory.py): `aciarena/agent_components/memory/base_memory.py`

### Multi-Agent Systems

- [MAS Lifecycle](https://github.com/greysahy/aciarena/blob/main/aciarena/mas/base_mas.py): `aciarena/mas/base_mas.py`
- [CAMEL](https://github.com/greysahy/aciarena/blob/main/aciarena/mas/camel/camel_mas.py): `aciarena/mas/camel/camel_mas.py`
- [CAMEL Prompts](https://github.com/greysahy/aciarena/blob/main/aciarena/mas/camel/prompt.py): `aciarena/mas/camel/prompt.py`
- [LLM Debate](https://github.com/greysahy/aciarena/blob/main/aciarena/mas/llm_debate/llm_debate_mas.py): `aciarena/mas/llm_debate/llm_debate_mas.py`
- [Debate Roles](https://github.com/greysahy/aciarena/tree/main/aciarena/mas/llm_debate/agents): `aciarena/mas/llm_debate/agents`
- [AgentVerse](https://github.com/greysahy/aciarena/tree/main/aciarena/mas/agentverse): `aciarena/mas/agentverse`
- [AutoGen](https://github.com/greysahy/aciarena/tree/main/aciarena/mas/autogen): `aciarena/mas/autogen`
- [MAD](https://github.com/greysahy/aciarena/tree/main/aciarena/mas/mad): `aciarena/mas/mad`
- [MetaGPT](https://github.com/greysahy/aciarena/blob/main/aciarena/mas/metagpt/metagpt_mas.py): `aciarena/mas/metagpt/metagpt_mas.py`
- [MetaGPT Roles](https://github.com/greysahy/aciarena/blob/main/aciarena/mas/metagpt/agents/metagpt_agent.py): `aciarena/mas/metagpt/agents/metagpt_agent.py`
- [Self-Consistency](https://github.com/greysahy/aciarena/tree/main/aciarena/mas/self_consistency): `aciarena/mas/self_consistency`

### Attack and Defense

- [Attack Strategies](https://github.com/greysahy/aciarena/blob/main/aciarena/attacks/base_attack.py): `aciarena/attacks/base_attack.py`
- [Disclosure Attacks](https://github.com/greysahy/aciarena/blob/main/aciarena/attacks/disclosure_attack.py): `aciarena/attacks/disclosure_attack.py`
- [Disruption Attacks](https://github.com/greysahy/aciarena/blob/main/aciarena/attacks/disruption_attack.py): `aciarena/attacks/disruption_attack.py`
- [Hijacking Attacks](https://github.com/greysahy/aciarena/blob/main/aciarena/attacks/hijacking_attack.py): `aciarena/attacks/hijacking_attack.py`
- [ACI Sentinel](https://github.com/greysahy/aciarena/blob/main/aciarena/defenses/aci_sentinel.py): `aciarena/defenses/aci_sentinel.py`
- [BERT Detector](https://github.com/greysahy/aciarena/blob/main/aciarena/defenses/bert_detector.py): `aciarena/defenses/bert_detector.py`

### Other components

- **Evaluator**
- **OpenAI API**

## Connections

- Evaluator → Task Executor: runs evaluation
- Task Executor → Registries and Factory: builds components (evidence: `aciarena/evaluation/task_executor.py`)
- Task Executor → Task Domains: selects tasks (evidence: `aciarena/evaluation/task_executor.py`)
- Task Executor → Attack Strategies: loads attacks (evidence: `aciarena/evaluation/task_executor.py`)
- Task Executor → ACI Sentinel: configures defense (evidence: `aciarena/evaluation/task_executor.py`)
- Task Executor → MAS Lifecycle: constructs MAS (evidence: `aciarena/evaluation/task_executor.py`)
- Evaluation Suite → Task Domains: uses task types (evidence: `aciarena/evaluation/evaluation_suite.py`)
- Evaluation Suite → Attack Strategies: uses attacks (evidence: `aciarena/evaluation/evaluation_suite.py`)
- Evaluation Suite → Dataset Selection: selects datasets
- Registries and Factory → Evaluation Logging: creates logger (evidence: `aciarena/utils/factory.py`)
- Registries and Factory → MAS Lifecycle: builds MAS (evidence: `aciarena/utils/factory.py`)
- Registries and Factory → Attack Strategies: builds attacks (evidence: `aciarena/utils/factory.py`)
- Agent Lifecycle → LLM Interface: calls interface (evidence: `aciarena/agent_components/base_agent.py`)
- Agent Lifecycle → OpenAI Adapter: initializes provider (evidence: `aciarena/agent_components/base_agent.py`)
- Agent Lifecycle → Conversation Memory: stores conversation (evidence: `aciarena/agent_components/base_agent.py`)
- OpenAI Adapter → OpenAI API: sends completions (evidence: `aciarena/agent_components/llms/openai_llm.py`)
- MAS Lifecycle → Agent Lifecycle: manages agents (evidence: `aciarena/mas/base_mas.py`)
- CAMEL → CAMEL Prompts: uses prompts (evidence: `aciarena/mas/camel/camel_mas.py`)
- CAMEL → Registries and Factory: registers system (evidence: `aciarena/mas/camel/camel_mas.py`)
- LLM Debate → Debate Roles: creates and queries (evidence: `aciarena/mas/llm_debate/llm_debate_mas.py`)
- LLM Debate → MAS Lifecycle: extends lifecycle (evidence: `aciarena/mas/llm_debate/llm_debate_mas.py`)
- MetaGPT Roles → Agent Lifecycle: extends agent (evidence: `aciarena/mas/metagpt/agents/metagpt_agent.py`)
- MetaGPT → MetaGPT Roles: uses role agents
- AgentVerse → MAS Lifecycle: implements system
- AutoGen → MAS Lifecycle: implements system
- MAD → MAS Lifecycle: implements system
- Self-Consistency → MAS Lifecycle: implements system
- Attack Strategies → MAS Lifecycle: modifies system (evidence: `aciarena/attacks/base_attack.py`)
- Disclosure Attacks → Attack Strategies: extends attack base (evidence: `aciarena/attacks/disclosure_attack.py`)
- Disruption Attacks → Attack Strategies: extends attack base (evidence: `aciarena/attacks/disruption_attack.py`)
- Hijacking Attacks → Attack Strategies: extends attack base (evidence: `aciarena/attacks/hijacking_attack.py`)
- ACI Sentinel → OpenAI Adapter: uses model interface (evidence: `aciarena/defenses/aci_sentinel.py`)
