# shuwuwu/hci-agent-transparency architecture

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

- Interactive diagram: https://gitdiagram.com/shuwuwu/hci-agent-transparency
- Repository: https://github.com/shuwuwu/hci-agent-transparency
- Video tour (about a minute): https://gitdiagram.com/shuwuwu/hci-agent-transparency/video

## Overview

This repository supports an HCI study of whether agent action traces help participants detect unauthorized behavior. Researchers prepare AgentDojo run data and capability skills, select and execute scenarios, then turn successful runs into low- and high-transparency stimuli with workspace snapshots. Participants inspect the request, response, optional action log, workspace, and skills in a browser UI; their interactions are logged. The graph focuses on this research workflow and its core processing modules. Some scripts and UI relationships are included only where the README or source index documents them.

Main entry points: [`src/scripts/agentdojo_runs.py`](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/agentdojo_runs.py) (Run parsing), [`src/participant_ui`](https://github.com/shuwuwu/hci-agent-transparency/tree/main/src/participant_ui) (Participant UI), [`src/scripts/generate_skills.py`](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/generate_skills.py) (Skill generation), [`src/scripts/participant_server.py`](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/participant_server.py) (Participant server)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_study_ui["Participant study"]
  node_participant_server["Participant server"]
  node_participant_ui["Participant UI"]
  node_interaction_log["Interaction logging<br/>[interaction_log.py]"]
  node_stimuli_data[("Study stimuli")]
  node_workspace_data[("Workspace snapshots")]
  node_skill_data[("Generated skills")]
end

subgraph group_agent_data["Agent data"]
  node_recorded_runs[("Recorded runs")]
  node_agentdojo_runs["Run parsing<br/>[agentdojo_runs.py]"]
  node_agentdojo_source["Pinned source access"]
  node_agentdojo_tools["Workspace tool specs<br/>[agentdojo_tools.py]"]
  node_scenario_extract["Scenario extraction"]
end

subgraph group_skills["Capability skills"]
  node_skill_sources["Skill source packages"]
  node_capability_prompts["Skill prompts"]
  node_prompt_utils["Prompt helpers<br/>[prompt_utils.py]"]
  node_skill_generation["Skill generation<br/>[generate_skills.py]"]
  node_skill_validation["Skill validation"]
  node_skill_text["Skill text analysis<br/>[skill_text.py]"]
  node_skill_map["Skill map checks<br/>[check_skill_map.py]"]
  node_review_sheet["Skill review sheets"]
end

subgraph group_study_pipeline["Study pipeline"]
  node_execution_plan["Execution planning"]
  node_execution_runner["Scenario execution<br/>[run_executions.py]"]
  node_stimulus_builder["Stimulus building<br/>[build_stimuli.py]"]
  node_stimulus_text["Stimulus text<br/>[stimulus_text.py]"]
  node_tool_result_parser["Tool result parsing"]
  node_snapshot_builder["Snapshot building"]
  node_explorer_export["Explorer trace export"]
end

node_participant(("Participant"))
node_external_openai{{"OpenAI API"}}
node_agentdojo{{"AgentDojo"}}

node_participant -->|"uses study"| node_participant_server
node_participant_server -->|"serves UI"| node_participant_ui
node_participant_server -->|"writes logs"| node_interaction_log
node_participant_ui -->|"presents stimuli"| node_stimuli_data
node_participant_ui -->|"shows workspace"| node_workspace_data
node_participant_ui -->|"shows skills"| node_skill_data
node_agentdojo_source -->|"reads pinned files"| node_agentdojo
node_agentdojo_tools -->|"reads tool source"| node_agentdojo_source
node_agentdojo_tools -->|"uses tool groups"| node_agentdojo_runs
node_scenario_extract -->|"reads traces"| node_recorded_runs
node_scenario_extract -->|"parses runs"| node_agentdojo_runs
node_skill_sources -->|"uses tool specs"| node_agentdojo_tools
node_skill_sources -->|"reads schemas"| node_agentdojo_source
node_capability_prompts -->|"uses helpers"| node_prompt_utils
node_capability_prompts -->|"uses constants"| node_agentdojo_runs
node_skill_generation -->|"sends saved prompts"| node_capability_prompts
node_skill_generation -->|"validates output"| node_skill_validation
node_skill_generation -->|"requests generation"| node_external_openai
node_skill_validation -->|"checks skill text"| node_skill_text
node_skill_map -->|"checks definitions"| node_skill_text
node_skill_map -->|"checks traces"| node_agentdojo_runs
node_review_sheet -->|"uses validation"| node_skill_validation
node_review_sheet -->|"analyzes skill text"| node_skill_text
node_execution_plan -->|"uses run constants"| node_agentdojo_runs
node_execution_runner -->|"runs planned cases"| node_execution_plan
node_execution_runner -->|"executes scenarios"| node_agentdojo
node_stimulus_builder -->|"formats actions"| node_stimulus_text
node_stimulus_text -->|"parses tool results"| node_tool_result_parser
node_stimulus_builder -->|"writes stimuli"| node_stimuli_data
node_snapshot_builder -->|"writes snapshots"| node_workspace_data
node_explorer_export -->|"reads run data"| node_agentdojo_runs
node_explorer_export -->|"uses stimulus data"| node_stimulus_builder

click node_participant_server "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/participant_server.py"
click node_participant_ui "https://github.com/shuwuwu/hci-agent-transparency/tree/main/src/participant_ui"
click node_interaction_log "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/interaction_log.py"
click node_stimuli_data "https://github.com/shuwuwu/hci-agent-transparency/tree/main/src/data/stimuli"
click node_workspace_data "https://github.com/shuwuwu/hci-agent-transparency/tree/main/src/data/workspace"
click node_skill_data "https://github.com/shuwuwu/hci-agent-transparency/tree/main/src/data/skills"
click node_recorded_runs "https://github.com/shuwuwu/hci-agent-transparency/tree/main/src/data/gpt-4o-2024-05-13/workspace"
click node_agentdojo_runs "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/agentdojo_runs.py"
click node_agentdojo_source "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/agentdojo_source.py"
click node_agentdojo_tools "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/agentdojo_tools.py"
click node_scenario_extract "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/extract_scenarios.py"
click node_skill_sources "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/build_skill_sources.py"
click node_capability_prompts "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/build_capability_prompts.py"
click node_prompt_utils "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/prompt_utils.py"
click node_skill_generation "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/generate_skills.py"
click node_skill_validation "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/validate_capability_skills.py"
click node_skill_text "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/skill_text.py"
click node_skill_map "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/check_skill_map.py"
click node_execution_plan "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/build_execution_plan.py"
click node_execution_runner "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/run_executions.py"
click node_stimulus_builder "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/build_stimuli.py"
click node_stimulus_text "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/stimulus_text.py"
click node_tool_result_parser "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/tool_result_parser.py"
click node_snapshot_builder "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/build_workspace_snapshots.py"
click node_explorer_export "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/export_explorer_traces.py"
click node_review_sheet "https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/build_review_sheet.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_participant_server,node_participant_ui,node_interaction_log,node_stimuli_data,node_workspace_data,node_skill_data toneBlue
class node_recorded_runs,node_agentdojo_runs,node_agentdojo_source,node_agentdojo_tools,node_scenario_extract toneAmber
class node_skill_sources,node_capability_prompts,node_prompt_utils,node_skill_generation,node_skill_validation,node_skill_text,node_skill_map,node_review_sheet,node_external_openai toneMint
class node_execution_plan,node_execution_runner,node_stimulus_builder,node_stimulus_text,node_tool_result_parser,node_snapshot_builder,node_explorer_export toneRose
class node_participant,node_agentdojo toneIndigo
```

## Components

### Participant study

- [Participant server](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/participant_server.py): `src/scripts/participant_server.py`
- [Participant UI](https://github.com/shuwuwu/hci-agent-transparency/tree/main/src/participant_ui): `src/participant_ui`
- [Interaction logging](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/interaction_log.py): `src/scripts/interaction_log.py`
- [Study stimuli](https://github.com/shuwuwu/hci-agent-transparency/tree/main/src/data/stimuli): `src/data/stimuli`
- [Workspace snapshots](https://github.com/shuwuwu/hci-agent-transparency/tree/main/src/data/workspace): `src/data/workspace`
- [Generated skills](https://github.com/shuwuwu/hci-agent-transparency/tree/main/src/data/skills): `src/data/skills`

### Agent data

- [Recorded runs](https://github.com/shuwuwu/hci-agent-transparency/tree/main/src/data/gpt-4o-2024-05-13/workspace): `src/data/gpt-4o-2024-05-13/workspace`
- [Run parsing](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/agentdojo_runs.py): `src/scripts/agentdojo_runs.py`
- [Pinned source access](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/agentdojo_source.py): `src/scripts/agentdojo_source.py`
- [Workspace tool specs](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/agentdojo_tools.py): `src/scripts/agentdojo_tools.py`
- [Scenario extraction](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/extract_scenarios.py): `src/scripts/extract_scenarios.py`

### Capability skills

- [Skill source packages](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/build_skill_sources.py): `src/scripts/build_skill_sources.py`
- [Skill prompts](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/build_capability_prompts.py): `src/scripts/build_capability_prompts.py`
- [Prompt helpers](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/prompt_utils.py): `src/scripts/prompt_utils.py`
- [Skill generation](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/generate_skills.py): `src/scripts/generate_skills.py`
- [Skill validation](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/validate_capability_skills.py): `src/scripts/validate_capability_skills.py`
- [Skill text analysis](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/skill_text.py): `src/scripts/skill_text.py`
- [Skill map checks](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/check_skill_map.py): `src/scripts/check_skill_map.py`
- [Skill review sheets](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/build_review_sheet.py): `src/scripts/build_review_sheet.py`

### Study pipeline

- [Execution planning](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/build_execution_plan.py): `src/scripts/build_execution_plan.py`
- [Scenario execution](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/run_executions.py): `src/scripts/run_executions.py`
- [Stimulus building](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/build_stimuli.py): `src/scripts/build_stimuli.py`
- [Stimulus text](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/stimulus_text.py): `src/scripts/stimulus_text.py`
- [Tool result parsing](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/tool_result_parser.py): `src/scripts/tool_result_parser.py`
- [Snapshot building](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/build_workspace_snapshots.py): `src/scripts/build_workspace_snapshots.py`
- [Explorer trace export](https://github.com/shuwuwu/hci-agent-transparency/blob/main/src/scripts/export_explorer_traces.py): `src/scripts/export_explorer_traces.py`

### Other components

- **Participant**
- **OpenAI API**
- **AgentDojo**

## Connections

- Participant → Participant server: uses study (evidence: `README.md`)
- Participant server → Participant UI: serves UI (evidence: `README.md`)
- Participant server → Interaction logging: writes logs (evidence: `src/scripts/participant_server.py`)
- Participant UI → Study stimuli: presents stimuli (evidence: `README.md`)
- Participant UI → Workspace snapshots: shows workspace (evidence: `README.md`)
- Participant UI → Generated skills: shows skills (evidence: `README.md`)
- Pinned source access → AgentDojo: reads pinned files (evidence: `src/scripts/agentdojo_source.py`)
- Workspace tool specs → Pinned source access: reads tool source (evidence: `src/scripts/agentdojo_tools.py`)
- Workspace tool specs → Run parsing: uses tool groups (evidence: `src/scripts/agentdojo_tools.py`)
- Scenario extraction → Recorded runs: reads traces (evidence: `README.md`)
- Scenario extraction → Run parsing: parses runs (evidence: `src/scripts/extract_scenarios.py`)
- Skill source packages → Workspace tool specs: uses tool specs (evidence: `src/scripts/build_skill_sources.py`)
- Skill source packages → Pinned source access: reads schemas (evidence: `src/scripts/build_skill_sources.py`)
- Skill prompts → Prompt helpers: uses helpers (evidence: `src/scripts/build_capability_prompts.py`)
- Skill prompts → Run parsing: uses constants (evidence: `src/scripts/build_capability_prompts.py`)
- Skill generation → Skill prompts: sends saved prompts (evidence: `src/scripts/generate_skills.py`)
- Skill generation → Skill validation: validates output (evidence: `src/scripts/generate_skills.py`)
- Skill generation → OpenAI API: requests generation (evidence: `README.md`)
- Skill validation → Skill text analysis: checks skill text (evidence: `src/scripts/validate_capability_skills.py`)
- Skill map checks → Skill text analysis: checks definitions (evidence: `src/scripts/check_skill_map.py`)
- Skill map checks → Run parsing: checks traces (evidence: `src/scripts/check_skill_map.py`)
- Skill review sheets → Skill validation: uses validation (evidence: `src/scripts/build_review_sheet.py`)
- Skill review sheets → Skill text analysis: analyzes skill text (evidence: `src/scripts/build_review_sheet.py`)
- Execution planning → Run parsing: uses run constants (evidence: `src/scripts/build_execution_plan.py`)
- Scenario execution → Execution planning: runs planned cases (evidence: `src/scripts/run_executions.py`)
- Scenario execution → AgentDojo: executes scenarios (evidence: `README.md`)
- Stimulus building → Stimulus text: formats actions (evidence: `src/scripts/build_stimuli.py`)
- Stimulus text → Tool result parsing: parses tool results (evidence: `src/scripts/stimulus_text.py`)
- Stimulus building → Study stimuli: writes stimuli (evidence: `README.md`)
- Snapshot building → Workspace snapshots: writes snapshots (evidence: `README.md`)
- Explorer trace export → Run parsing: reads run data (evidence: `src/scripts/export_explorer_traces.py`)
- Explorer trace export → Stimulus building: uses stimulus data (evidence: `src/scripts/export_explorer_traces.py`)
