# ramani-viswanathan/iem-ais architecture

> Architecture diagram of the GitHub repository ramani-viswanathan/iem-ais, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ramani-viswanathan/iem-ais
- Repository: https://github.com/ramani-viswanathan/iem-ais

## Overview

IEM-AIS is a local, URL-driven LLM security assessment utility. An engineer submits a target URL; the UI analyzes the site, then dispatches selected OWASP-risk tests that send adversarial prompts and record real replies. Results are saved as evidence and can be combined into an honest cross-test-case report that also identifies untested scope. The graph preserves all eight documented risk suites. Some suite internals and report-route details are unsampled, so those relationships are shown only where documented or supported by excerpts.

Main entry points: [`ui/server.py`](https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/server.py) (UI API), [`ui/shared/owasp_source.py`](https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/owasp_source.py) (Live OWASP Source), [`ui/shared/inject_base.py`](https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/inject_base.py) (Test Orchestrator), [`OWASP/Jailbreaking`](https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/Jailbreaking) (Prompt Injection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Assessment UI"]
  node_server["UI API<br/>[server.py]"]
end

subgraph group_analysis["Target Analysis"]
  node_site_analysis["Site Analyzer<br/>[site_analyzer.py]"]
end

subgraph group_testing["Risk Testing"]
  node_shared_runner["Test Orchestrator<br/>[inject_base.py]"]
  node_browser_agent["Browser Fallback<br/>[browser_agent.py]"]
  node_owasp_source["Live OWASP Source<br/>[owasp_source.py]"]
  node_jailbreaking["Prompt Injection"]
  node_sensitive["Sensitive Disclosure"]
  node_output["Output Handling"]
  node_consumption["Unbounded Consumption"]
  node_hidden["Hidden Context"]
  node_vector["Vector Weaknesses"]
  node_agency["Excessive Agency"]
  node_misinformation["Misinformation"]
end

subgraph group_reporting["Evidence &amp; Reporting"]
  node_evidence[("Saved Evidence<br/>[server.py]")]
  node_report_builder["Honest Report<br/>[report_builder.py]"]
  node_glosses["Plain-English Glosses<br/>[layman_glosses.py]"]
end

node_engineer(("Assessor"))
node_target["LLM Target Site"]

node_engineer -->|"submits URL"| node_server
node_server -->|"analyzes target"| node_site_analysis
node_site_analysis -->|"fetches page and scripts"| node_target
node_server -->|"dispatches tests"| node_jailbreaking
node_server -->|"dispatches tests"| node_sensitive
node_server -->|"dispatches tests"| node_output
node_server -->|"dispatches tests"| node_consumption
node_server -->|"dispatches tests"| node_hidden
node_server -->|"dispatches tests"| node_vector
node_server -->|"dispatches tests"| node_agency
node_server -->|"dispatches tests"| node_misinformation
node_jailbreaking -->|"uses shared mechanics"| node_shared_runner
node_sensitive -->|"uses shared mechanics"| node_shared_runner
node_output -->|"uses shared mechanics"| node_shared_runner
node_consumption -->|"uses shared mechanics"| node_shared_runner
node_shared_runner -->|"uses browser fallback"| node_browser_agent
node_shared_runner -->|"sends prompts"| node_target
node_jailbreaking -.->|"fetches risk reference"| node_owasp_source
node_sensitive -.->|"fetches risk reference"| node_owasp_source
node_output -.->|"fetches risk reference"| node_owasp_source
node_consumption -.->|"fetches risk reference"| node_owasp_source
node_hidden -.->|"fetches risk reference"| node_owasp_source
node_vector -.->|"fetches risk reference"| node_owasp_source
node_agency -.->|"fetches risk reference"| node_owasp_source
node_misinformation -.->|"fetches risk reference"| node_owasp_source
node_server -->|"writes results"| node_evidence
node_evidence -->|"reads saved results"| node_report_builder
node_report_builder -->|"looks up glosses"| node_glosses
node_server -->|"builds report"| node_report_builder

click node_server "https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/server.py"
click node_site_analysis "https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/site_analyzer.py"
click node_shared_runner "https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/inject_base.py"
click node_browser_agent "https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/browser_agent.py"
click node_owasp_source "https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/owasp_source.py"
click node_jailbreaking "https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/Jailbreaking"
click node_sensitive "https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/SensitiveInformation"
click node_output "https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/OutputHandling"
click node_consumption "https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/UnboundedConsumption"
click node_hidden "https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/HiddenContext"
click node_vector "https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/VectorEmbedding"
click node_agency "https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/ExcessiveAgency"
click node_misinformation "https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/Misinformation"
click node_evidence "https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/server.py"
click node_report_builder "https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/report_builder.py"
click node_glosses "https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/layman_glosses.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_server toneBlue
class node_site_analysis toneAmber
class node_shared_runner,node_browser_agent,node_owasp_source,node_jailbreaking,node_sensitive,node_output,node_consumption,node_hidden,node_vector,node_agency,node_misinformation toneMint
class node_evidence,node_report_builder,node_glosses toneRose
class node_engineer,node_target toneIndigo
```

## Components

### Assessment UI

- [UI API](https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/server.py): `ui/server.py`

### Target Analysis

- [Site Analyzer](https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/site_analyzer.py): `ui/shared/site_analyzer.py`

### Risk Testing

- [Test Orchestrator](https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/inject_base.py): `ui/shared/inject_base.py`
- [Browser Fallback](https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/browser_agent.py): `ui/shared/browser_agent.py`
- [Live OWASP Source](https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/owasp_source.py): `ui/shared/owasp_source.py`
- [Prompt Injection](https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/Jailbreaking): `OWASP/Jailbreaking`
- [Sensitive Disclosure](https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/SensitiveInformation): `OWASP/SensitiveInformation`
- [Output Handling](https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/OutputHandling): `OWASP/OutputHandling`
- [Unbounded Consumption](https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/UnboundedConsumption): `OWASP/UnboundedConsumption`
- [Hidden Context](https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/HiddenContext): `OWASP/HiddenContext`
- [Vector Weaknesses](https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/VectorEmbedding): `OWASP/VectorEmbedding`
- [Excessive Agency](https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/ExcessiveAgency): `OWASP/ExcessiveAgency`
- [Misinformation](https://github.com/ramani-viswanathan/iem-ais/tree/master/OWASP/Misinformation): `OWASP/Misinformation`

### Evidence & Reporting

- [Saved Evidence](https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/server.py): `ui/server.py`
- [Honest Report](https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/report_builder.py): `ui/shared/report_builder.py`
- [Plain-English Glosses](https://github.com/ramani-viswanathan/iem-ais/blob/master/ui/shared/layman_glosses.py): `ui/shared/layman_glosses.py`

### Other components

- **Assessor**
- **LLM Target Site**

## Connections

- Assessor → UI API: submits URL (evidence: `ui/server.py`)
- UI API → Site Analyzer: analyzes target (evidence: `ui/server.py`)
- Site Analyzer → LLM Target Site: fetches page and scripts (evidence: `ui/shared/site_analyzer.py`)
- UI API → Prompt Injection: dispatches tests (evidence: `ui/server.py`)
- UI API → Sensitive Disclosure: dispatches tests (evidence: `ui/server.py`)
- UI API → Output Handling: dispatches tests (evidence: `ui/server.py`)
- UI API → Unbounded Consumption: dispatches tests (evidence: `ui/server.py`)
- UI API → Hidden Context: dispatches tests (evidence: `ui/server.py`)
- UI API → Vector Weaknesses: dispatches tests (evidence: `ui/server.py`)
- UI API → Excessive Agency: dispatches tests (evidence: `ui/server.py`)
- UI API → Misinformation: dispatches tests (evidence: `ui/server.py`)
- Prompt Injection → Test Orchestrator: uses shared mechanics (evidence: `README.md`)
- Sensitive Disclosure → Test Orchestrator: uses shared mechanics (evidence: `README.md`)
- Output Handling → Test Orchestrator: uses shared mechanics (evidence: `README.md`)
- Unbounded Consumption → Test Orchestrator: uses shared mechanics (evidence: `README.md`)
- Test Orchestrator → Browser Fallback: uses browser fallback (evidence: `ui/shared/inject_base.py`)
- Test Orchestrator → LLM Target Site: sends prompts (evidence: `ui/shared/inject_base.py`)
- Prompt Injection → Live OWASP Source: fetches risk reference (evidence: `README.md`)
- Sensitive Disclosure → Live OWASP Source: fetches risk reference (evidence: `README.md`)
- Output Handling → Live OWASP Source: fetches risk reference (evidence: `README.md`)
- Unbounded Consumption → Live OWASP Source: fetches risk reference (evidence: `README.md`)
- Hidden Context → Live OWASP Source: fetches risk reference (evidence: `README.md`)
- Vector Weaknesses → Live OWASP Source: fetches risk reference (evidence: `README.md`)
- Excessive Agency → Live OWASP Source: fetches risk reference (evidence: `README.md`)
- Misinformation → Live OWASP Source: fetches risk reference (evidence: `README.md`)
- UI API → Saved Evidence: writes results (evidence: `ui/server.py`)
- Saved Evidence → Honest Report: reads saved results (evidence: `README.md`)
- Honest Report → Plain-English Glosses: looks up glosses (evidence: `ui/shared/report_builder.py`)
- UI API → Honest Report: builds report (evidence: `README.md`)
