# harshithgraj/red-team-ai-agent architecture

> Architecture diagram of the GitHub repository harshithgraj/red-team-ai-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/harshithgraj/red-team-ai-agent
- Repository: https://github.com/harshithgraj/red-team-ai-agent

## Overview

Red Team AI Agent is a local proposal stress-testing CLI. Users supply a proposal by file, inline text, or interactive input, choose a persona and standard or debate mode, and receive AI-generated critique; reports and debate logs can be saved as Markdown. The principal orchestration and Groq request logic are in redteam.py. The README also documents an HTML findings portfolio, but its data-loading or runtime links are not established by the sampled source, so those are left unwired.

Main entry points: [`redteam.py`](https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py) (Standard Analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Proposal Input"]
  node_cli["CLI Entry<br/>[redteam.py]"]
  node_proposal["Proposal Text<br/>[redteam.py]"]
end

subgraph group_analysis["Critique Workflows"]
  node_personas["Persona Prompts<br/>[redteam.py]"]
  node_standard["Standard Analysis<br/>[redteam.py]"]
  node_debate["Debate Mode<br/>[redteam.py]"]
end

subgraph group_integration["AI Integration"]
  node_groq["Groq Chat API"]
end

subgraph group_outputs["Review Outputs"]
  node_report["Critique Report<br/>[redteam.py]"]
  node_debate_log["Debate Log<br/>[redteam.py]"]
  node_portfolio["Findings Portfolio"]
end

node_user(("Proponent"))

node_user -->|"supplies proposal"| node_cli
node_cli -->|"reads text"| node_proposal
node_cli -->|"starts analysis"| node_standard
node_cli -->|"starts debate"| node_debate
node_standard -->|"selects prompt"| node_personas
node_debate -->|"selects prompt"| node_personas
node_standard -->|"sends messages"| node_groq
node_debate -->|"sends history"| node_groq
node_groq -->|"returns critique"| node_standard
node_groq -->|"returns response"| node_debate
node_standard -->|"saves report"| node_report
node_debate -->|"saves transcript"| node_debate_log

click node_cli "https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py"
click node_proposal "https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py"
click node_personas "https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py"
click node_standard "https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py"
click node_debate "https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py"
click node_report "https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py"
click node_debate_log "https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py"
click node_portfolio "https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam-portfolio.html"

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_cli,node_proposal toneBlue
class node_personas,node_standard,node_debate toneAmber
class node_groq toneMint
class node_report,node_debate_log,node_portfolio toneRose
class node_user toneIndigo
```

## Components

### Proposal Input

- [CLI Entry](https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py): `redteam.py`
- [Proposal Text](https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py): `redteam.py`

### Critique Workflows

- [Persona Prompts](https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py): `redteam.py`
- [Standard Analysis](https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py): `redteam.py`
- [Debate Mode](https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py): `redteam.py`

### AI Integration

- **Groq Chat API**

### Review Outputs

- [Critique Report](https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py): `redteam.py`
- [Debate Log](https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam.py): `redteam.py`
- [Findings Portfolio](https://github.com/harshithgraj/red-team-ai-agent/blob/main/redteam-portfolio.html): `redteam-portfolio.html`

### Other components

- **Proponent**

## Connections

- Proponent → CLI Entry: supplies proposal
- CLI Entry → Proposal Text: reads text
- CLI Entry → Standard Analysis: starts analysis
- CLI Entry → Debate Mode: starts debate
- Standard Analysis → Persona Prompts: selects prompt
- Debate Mode → Persona Prompts: selects prompt
- Standard Analysis → Groq Chat API: sends messages
- Debate Mode → Groq Chat API: sends history
- Groq Chat API → Standard Analysis: returns critique
- Groq Chat API → Debate Mode: returns response
- Standard Analysis → Critique Report: saves report
- Debate Mode → Debate Log: saves transcript
