# mohd-ali-creator/aegis-ai architecture

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

- Interactive diagram: https://gitdiagram.com/mohd-ali-creator/aegis-ai
- Repository: https://github.com/mohd-ali-creator/aegis-ai

## Overview

Aegis AI is an enterprise LLM security proxy with an employee-facing chat interface and an administrator console. Its principal workflow sends a prompt from the client through the gateway to the analysis sidecar, where PII, heuristic, semantic, and attachment/URL checks inform a mitigation decision; the gateway then logs the outcome and, when appropriate, forwards the request to a protected LLM. The README documents these service relationships and capabilities; source excerpts confirm portions of the frontend, sidecar, and registry, but do not expose all gateway routing or persistence implementation details.

Main entry points: [`gateway/server.js`](https://github.com/mohd-ali-creator/aegis-ai/blob/main/gateway/server.js) (API Gateway), [`sidecar/main.py`](https://github.com/mohd-ali-creator/aegis-ai/blob/main/sidecar/main.py) (Analysis API), [`frontend/src/App.jsx`](https://github.com/mohd-ali-creator/aegis-ai/blob/main/frontend/src/App.jsx) (Aegis Web App), [`frontend/src/components/AdminPortal.jsx`](https://github.com/mohd-ali-creator/aegis-ai/blob/main/frontend/src/components/AdminPortal.jsx) (Admin Portal)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client Experience"]
  node_app["Aegis Web App<br/>[App.jsx]"]
  node_admin_portal["Admin Portal<br/>[AdminPortal.jsx]"]
  node_employee_analytics["Employee Analytics"]
end

subgraph group_gateway["Gateway Governance"]
  node_gateway_service["API Gateway<br/>[server.js]"]
  node_dimensions["Security Dimensions"]
end

subgraph group_analysis["Security Analysis"]
  node_sidecar["Analysis API<br/>[main.py]"]
  node_pii_heuristics["PII And Heuristics<br/>[main.py]"]
  node_attachment_url["Attachment And URL Scan<br/>[main.py]"]
  node_ml_classifier["Intent Classifier<br/>[ml_engine.py]"]
  node_risk_decision["Risk And Mitigation<br/>[main.py]"]
end

subgraph group_operations["Audit And Integrations"]
  node_audit_store[("Audit Database")]
  node_protected_llm["Protected LLM"]
end

node_employee(("Employee"))
node_administrator(("Administrator"))

node_employee -->|"submits prompt"| node_app
node_administrator -->|"opens console"| node_admin_portal
node_app -->|"sends requests"| node_gateway_service
node_app -->|"renders"| node_admin_portal
node_admin_portal -->|"fetches admin data"| node_gateway_service
node_employee_analytics -.->|"requests analytics"| node_gateway_service
node_gateway_service -->|"submits prompt"| node_sidecar
node_sidecar -->|"redacts and matches"| node_pii_heuristics
node_sidecar -->|"scores intent"| node_ml_classifier
node_sidecar -->|"scans content"| node_attachment_url
node_attachment_url -->|"scores file content"| node_ml_classifier
node_sidecar -->|"calculates action"| node_risk_decision
node_gateway_service -->|"uses registry"| node_dimensions
node_risk_decision -->|"returns decision"| node_gateway_service
node_gateway_service -->|"writes audit records"| node_audit_store
node_gateway_service -->|"forwards safe prompt"| node_protected_llm

click node_app "https://github.com/mohd-ali-creator/aegis-ai/blob/main/frontend/src/App.jsx"
click node_admin_portal "https://github.com/mohd-ali-creator/aegis-ai/blob/main/frontend/src/components/AdminPortal.jsx"
click node_employee_analytics "https://github.com/mohd-ali-creator/aegis-ai/blob/main/frontend/src/components/EmployeeAnalyticsDashboard.jsx"
click node_gateway_service "https://github.com/mohd-ali-creator/aegis-ai/blob/main/gateway/server.js"
click node_dimensions "https://github.com/mohd-ali-creator/aegis-ai/blob/main/gateway/securityDimensions.js"
click node_sidecar "https://github.com/mohd-ali-creator/aegis-ai/blob/main/sidecar/main.py"
click node_pii_heuristics "https://github.com/mohd-ali-creator/aegis-ai/blob/main/sidecar/main.py"
click node_attachment_url "https://github.com/mohd-ali-creator/aegis-ai/blob/main/sidecar/main.py"
click node_ml_classifier "https://github.com/mohd-ali-creator/aegis-ai/blob/main/sidecar/ml_engine.py"
click node_risk_decision "https://github.com/mohd-ali-creator/aegis-ai/blob/main/sidecar/main.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_app,node_admin_portal,node_employee_analytics toneBlue
class node_gateway_service,node_dimensions toneAmber
class node_sidecar,node_pii_heuristics,node_attachment_url,node_ml_classifier,node_risk_decision toneMint
class node_audit_store,node_protected_llm toneRose
class node_employee,node_administrator toneIndigo
```

## Components

### Client Experience

- [Aegis Web App](https://github.com/mohd-ali-creator/aegis-ai/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Admin Portal](https://github.com/mohd-ali-creator/aegis-ai/blob/main/frontend/src/components/AdminPortal.jsx): `frontend/src/components/AdminPortal.jsx`
- [Employee Analytics](https://github.com/mohd-ali-creator/aegis-ai/blob/main/frontend/src/components/EmployeeAnalyticsDashboard.jsx): `frontend/src/components/EmployeeAnalyticsDashboard.jsx`

### Gateway Governance

- [API Gateway](https://github.com/mohd-ali-creator/aegis-ai/blob/main/gateway/server.js): `gateway/server.js`
- [Security Dimensions](https://github.com/mohd-ali-creator/aegis-ai/blob/main/gateway/securityDimensions.js): `gateway/securityDimensions.js`

### Security Analysis

- [Analysis API](https://github.com/mohd-ali-creator/aegis-ai/blob/main/sidecar/main.py): `sidecar/main.py`
- [PII And Heuristics](https://github.com/mohd-ali-creator/aegis-ai/blob/main/sidecar/main.py): `sidecar/main.py`
- [Attachment And URL Scan](https://github.com/mohd-ali-creator/aegis-ai/blob/main/sidecar/main.py): `sidecar/main.py`
- [Intent Classifier](https://github.com/mohd-ali-creator/aegis-ai/blob/main/sidecar/ml_engine.py): `sidecar/ml_engine.py`
- [Risk And Mitigation](https://github.com/mohd-ali-creator/aegis-ai/blob/main/sidecar/main.py): `sidecar/main.py`

### Audit And Integrations

- **Audit Database**
- **Protected LLM**

### Other components

- **Employee**
- **Administrator**

## Connections

- Employee → Aegis Web App: submits prompt (evidence: `README.md`)
- Administrator → Admin Portal: opens console (evidence: `README.md`)
- Aegis Web App → API Gateway: sends requests (evidence: `README.md`)
- Aegis Web App → Admin Portal: renders (evidence: `frontend/src/App.jsx`)
- Admin Portal → API Gateway: fetches admin data (evidence: `frontend/src/components/AdminPortal.jsx`)
- Employee Analytics → API Gateway: requests analytics
- API Gateway → Analysis API: submits prompt (evidence: `README.md`)
- Analysis API → PII And Heuristics: redacts and matches (evidence: `sidecar/main.py`)
- Analysis API → Intent Classifier: scores intent (evidence: `sidecar/main.py`)
- Analysis API → Attachment And URL Scan: scans content (evidence: `README.md`)
- Attachment And URL Scan → Intent Classifier: scores file content (evidence: `sidecar/main.py`)
- Analysis API → Risk And Mitigation: calculates action (evidence: `sidecar/main.py`)
- API Gateway → Security Dimensions: uses registry (evidence: `gateway/server.js`)
- Risk And Mitigation → API Gateway: returns decision (evidence: `README.md`)
- API Gateway → Audit Database: writes audit records (evidence: `README.md`)
- API Gateway → Protected LLM: forwards safe prompt (evidence: `README.md`)
