# nyu-llm-ctf/nyuctf_agents architecture

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

- Interactive diagram: https://gitdiagram.com/nyu-llm-ctf/nyuctf_agents
- Repository: https://github.com/nyu-llm-ctf/nyuctf_agents

## Overview

The repository contains two LLM-driven CTF challenge solvers: the baseline agent and D-CIPHER. In both, a runner starts a challenge-solving loop; the model receives prompts and returns tool requests, which the framework executes in the challenge environment until the challenge is solved or the agent stops. D-CIPHER adds planner/executor coordination and optional autoprompting. The README documents these capabilities; several connections below are based on the SOURCE INDEX because their implementations were not sampled.

Main entry points: [`nyuctf_multiagent/agent.py`](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/agent.py) (Agent roles), [`nyuctf_baseline/conversation.py`](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/conversation.py) (Conversation loop), [`run_dcipher.py`](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/run_dcipher.py) (D-CIPHER runner), [`nyuctf_baseline/backends/vllm_backend.py`](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/backends/vllm_backend.py) (vLLM backend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_baseline["Baseline solver"]
  node_baseline_runner["Baseline runner<br/>[run_baseline.py]"]
  node_baseline_loop["Conversation loop<br/>[conversation.py]"]
  node_baseline_backend["Model backend<br/>[backend.py]"]
  node_baseline_vllm["vLLM backend<br/>[vllm_backend.py]"]
  node_baseline_prompts["Prompt manager<br/>[prompts.py]"]
  node_baseline_formatter["Tool formatters<br/>[formatter.py]"]
  node_baseline_vbpy["VBPY formatter<br/>[vbpy.py]"]
  node_baseline_yaml["YAML formatter<br/>[yaml.py]"]
  node_baseline_tooldefs["Tool definitions<br/>[modules.py]"]
  node_baseline_tools["Challenge tools<br/>[tools.py]"]
end

subgraph group_dcipher["D-CIPHER agents"]
  node_dcipher_runner["D-CIPHER runner<br/>[run_dcipher.py]"]
  node_single_runner["Single-executor runner"]
  node_dcipher_agents["Agent roles<br/>[agent.py]"]
  node_dcipher_config["Agent configuration<br/>[config.py]"]
  node_dcipher_prompting["Prompting<br/>[prompting.py]"]
  node_dcipher_conversation["Agent conversation<br/>[conversation.py]"]
  node_dcipher_backend["Model backend<br/>[backend.py]"]
  node_dcipher_openai["OpenAI backend<br/>[openai_backend.py]"]
  node_dcipher_tools["Agent tools<br/>[tool.py]"]
end

subgraph group_shared["Challenge runtime"]
  node_baseline_environment["Challenge environment<br/>[environment.py]"]
  node_dcipher_environment["Challenge environment<br/>[environment.py]"]
end

subgraph group_external["Model providers"]
  node_providers["Model providers"]
end

node_user(("Operator"))
node_challenge["CTF challenge"]

node_user -->|"runs"| node_baseline_runner
node_baseline_runner -->|"starts"| node_baseline_loop
node_baseline_loop -->|"requests completion"| node_baseline_backend
node_baseline_loop -->|"executes tools"| node_baseline_environment
node_baseline_loop -->|"gets prompts"| node_baseline_prompts
node_baseline_backend -->|"specializes"| node_baseline_vllm
node_baseline_vllm -->|"uses formatter"| node_baseline_vbpy
node_baseline_formatter -->|"formats calls"| node_baseline_tooldefs
node_baseline_vbpy -->|"implements"| node_baseline_formatter
node_baseline_yaml -->|"implements"| node_baseline_formatter
node_baseline_environment -->|"provides tools"| node_baseline_tools
node_baseline_tools -->|"uses definitions"| node_baseline_tooldefs
node_user -->|"runs"| node_dcipher_runner
node_user -->|"runs ablation"| node_single_runner
node_dcipher_runner -->|"starts agents"| node_dcipher_agents
node_single_runner -.->|"starts executor"| node_dcipher_agents
node_dcipher_runner -->|"loads settings"| node_dcipher_config
node_dcipher_runner -->|"sets prompting"| node_dcipher_prompting
node_dcipher_agents -->|"uses conversation"| node_dcipher_conversation
node_dcipher_agents -->|"requests completion"| node_dcipher_backend
node_dcipher_agents -->|"uses environment"| node_dcipher_environment
node_dcipher_agents -->|"dispatches tools"| node_dcipher_tools
node_dcipher_backend -->|"specializes"| node_dcipher_openai
node_dcipher_environment -->|"registers tools"| node_dcipher_tools
node_baseline_environment -->|"starts challenge"| node_challenge
node_dcipher_environment -->|"starts challenge"| node_challenge
node_baseline_vllm -.->|"calls model API"| node_providers
node_dcipher_openai -.->|"calls model API"| node_providers

click node_baseline_runner "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/run_baseline.py"
click node_baseline_loop "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/conversation.py"
click node_baseline_backend "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/backends/backend.py"
click node_baseline_vllm "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/backends/vllm_backend.py"
click node_baseline_prompts "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/prompts/prompts.py"
click node_baseline_formatter "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/formatters/formatter.py"
click node_baseline_vbpy "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/formatters/vbpy.py"
click node_baseline_yaml "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/formatters/yaml.py"
click node_baseline_tooldefs "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/tools/modules.py"
click node_baseline_tools "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/tools/tools.py"
click node_baseline_environment "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/environment.py"
click node_dcipher_runner "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/run_dcipher.py"
click node_single_runner "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/run_single_executor.py"
click node_dcipher_agents "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/agent.py"
click node_dcipher_config "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/config.py"
click node_dcipher_prompting "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/prompting.py"
click node_dcipher_conversation "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/conversation.py"
click node_dcipher_backend "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/backends/backend.py"
click node_dcipher_openai "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/backends/openai_backend.py"
click node_dcipher_tools "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/tools/tool.py"
click node_dcipher_environment "https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/environment.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_baseline_runner,node_baseline_loop,node_baseline_backend,node_baseline_vllm,node_baseline_prompts,node_baseline_formatter,node_baseline_vbpy,node_baseline_yaml,node_baseline_tooldefs,node_baseline_tools toneBlue
class node_dcipher_runner,node_single_runner,node_dcipher_agents,node_dcipher_config,node_dcipher_prompting,node_dcipher_conversation,node_dcipher_backend,node_dcipher_openai,node_dcipher_tools toneAmber
class node_baseline_environment,node_dcipher_environment toneMint
class node_providers toneRose
class node_user,node_challenge toneIndigo
```

## Components

### Baseline solver

- [Baseline runner](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/run_baseline.py): `run_baseline.py`
- [Conversation loop](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/conversation.py): `nyuctf_baseline/conversation.py`
- [Model backend](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/backends/backend.py): `nyuctf_baseline/backends/backend.py`
- [vLLM backend](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/backends/vllm_backend.py): `nyuctf_baseline/backends/vllm_backend.py`
- [Prompt manager](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/prompts/prompts.py): `nyuctf_baseline/prompts/prompts.py`
- [Tool formatters](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/formatters/formatter.py): `nyuctf_baseline/formatters/formatter.py`
- [VBPY formatter](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/formatters/vbpy.py): `nyuctf_baseline/formatters/vbpy.py`
- [YAML formatter](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/formatters/yaml.py): `nyuctf_baseline/formatters/yaml.py`
- [Tool definitions](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/tools/modules.py): `nyuctf_baseline/tools/modules.py`
- [Challenge tools](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/tools/tools.py): `nyuctf_baseline/tools/tools.py`

### D-CIPHER agents

- [D-CIPHER runner](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/run_dcipher.py): `run_dcipher.py`
- [Single-executor runner](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/run_single_executor.py): `run_single_executor.py`
- [Agent roles](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/agent.py): `nyuctf_multiagent/agent.py`
- [Agent configuration](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/config.py): `nyuctf_multiagent/config.py`
- [Prompting](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/prompting.py): `nyuctf_multiagent/prompting.py`
- [Agent conversation](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/conversation.py): `nyuctf_multiagent/conversation.py`
- [Model backend](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/backends/backend.py): `nyuctf_multiagent/backends/backend.py`
- [OpenAI backend](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/backends/openai_backend.py): `nyuctf_multiagent/backends/openai_backend.py`
- [Agent tools](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/tools/tool.py): `nyuctf_multiagent/tools/tool.py`

### Challenge runtime

- [Challenge environment](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_baseline/environment.py): `nyuctf_baseline/environment.py`
- [Challenge environment](https://github.com/nyu-llm-ctf/nyuctf_agents/blob/main/nyuctf_multiagent/environment.py): `nyuctf_multiagent/environment.py`

### Model providers

- **Model providers**

### Other components

- **Operator**
- **CTF challenge**

## Connections

- Operator → Baseline runner: runs
- Baseline runner → Conversation loop: starts (evidence: `run_baseline.py`)
- Conversation loop → Model backend: requests completion (evidence: `nyuctf_baseline/conversation.py`)
- Conversation loop → Challenge environment: executes tools (evidence: `nyuctf_baseline/conversation.py`)
- Conversation loop → Prompt manager: gets prompts (evidence: `nyuctf_baseline/conversation.py`)
- Model backend → vLLM backend: specializes (evidence: `nyuctf_baseline/backends/vllm_backend.py`)
- vLLM backend → VBPY formatter: uses formatter (evidence: `nyuctf_baseline/backends/vllm_backend.py`)
- Tool formatters → Tool definitions: formats calls (evidence: `nyuctf_baseline/formatters/formatter.py`)
- VBPY formatter → Tool formatters: implements (evidence: `nyuctf_baseline/formatters/vbpy.py`)
- YAML formatter → Tool formatters: implements (evidence: `nyuctf_baseline/formatters/yaml.py`)
- Challenge environment → Challenge tools: provides tools (evidence: `nyuctf_baseline/environment.py`)
- Challenge tools → Tool definitions: uses definitions (evidence: `nyuctf_baseline/tools/tools.py`)
- Operator → D-CIPHER runner: runs
- Operator → Single-executor runner: runs ablation
- D-CIPHER runner → Agent roles: starts agents (evidence: `run_dcipher.py`)
- Single-executor runner → Agent roles: starts executor
- D-CIPHER runner → Agent configuration: loads settings (evidence: `run_dcipher.py`)
- D-CIPHER runner → Prompting: sets prompting (evidence: `run_dcipher.py`)
- Agent roles → Agent conversation: uses conversation (evidence: `nyuctf_multiagent/agent.py`)
- Agent roles → Model backend: requests completion (evidence: `nyuctf_multiagent/agent.py`)
- Agent roles → Challenge environment: uses environment (evidence: `nyuctf_multiagent/agent.py`)
- Agent roles → Agent tools: dispatches tools (evidence: `nyuctf_multiagent/agent.py`)
- Model backend → OpenAI backend: specializes (evidence: `nyuctf_multiagent/backends/openai_backend.py`)
- Challenge environment → Agent tools: registers tools (evidence: `nyuctf_multiagent/environment.py`)
- Challenge environment → CTF challenge: starts challenge
- Challenge environment → CTF challenge: starts challenge
- vLLM backend → Model providers: calls model API
- OpenAI backend → Model providers: calls model API
