# sakshi-jadiya/airgap-call--call-e-hackathon architecture

> Architecture diagram of the GitHub repository sakshi-jadiya/airgap-call--call-e-hackathon, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-10). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sakshi-jadiya/airgap-call--call-e-hackathon
- Repository: https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon

## Overview

AirGap Call is a prototype prompt-firewall and out-of-band incident-response system. A user submits a prompt through the Streamlit dashboard; the FastAPI chat endpoint checks token and containment state, scans for injection patterns, and, on detection, records the incident, returns HTTP 423, and dispatches a background telephony task. An administrator responds by keypad, causing in-memory RLS or token state to change; the dashboard polls and displays that state. The documented simulation endpoint also triggers escalation. The repository shows in-memory state rather than a database. CALL-E behavior and keypad handling are described in the service and README; no separate telephony implementation is present.

Main entry points: [`backend/guard_service.py`](https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/guard_service.py) (FastAPI Gateway), [`frontend/dashboard.py`](https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/frontend/dashboard.py) (Streamlit Dashboard), [`backend/security.py`](https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/security.py) (Security State), [`backend/main.py`](https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/main.py) (Service Launcher)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_console["Admin Console"]
  node_dashboard["Streamlit Dashboard<br/>[dashboard.py]"]
  node_integrity["State Hashing<br/>[dashboard.py]"]
end

subgraph group_backend["API and Orchestration"]
  node_launcher["Service Launcher<br/>[main.py]"]
  node_gateway["FastAPI Gateway<br/>[guard_service.py]"]
  node_incident_api["Incident Status API<br/>[guard_service.py]"]
  node_executor["Background Call Dispatch<br/>[guard_service.py]"]
end

subgraph group_security["Detection and State"]
  node_security["Prompt Detection<br/>[security.py]"]
  node_state[("Security State<br/>[security.py]")]
end

subgraph group_telephony["Out-of-Band Triage"]
  node_calle["CALL-E Telephony"]
end

node_user(("Prompt Operator"))
node_admin(("Admin Phone"))

node_user -->|"enters prompt"| node_dashboard
node_dashboard -->|"posts chat"| node_gateway
node_gateway -->|"scans prompt"| node_security
node_gateway -->|"checks and updates"| node_state
node_security -->|"records incident"| node_state
node_dashboard -->|"polls status"| node_incident_api
node_incident_api -->|"reads status"| node_state
node_dashboard -->|"hashes state"| node_integrity
node_dashboard -->|"triggers simulation"| node_gateway
node_gateway -->|"offloads call"| node_executor
node_executor -->|"creates call"| node_calle
node_calle -->|"dials alert"| node_admin
node_admin -.->|"returns keypad choice"| node_calle
node_executor -->|"applies triage"| node_state
node_launcher -->|"starts server"| node_gateway

click node_dashboard "https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/frontend/dashboard.py"
click node_integrity "https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/frontend/dashboard.py"
click node_launcher "https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/main.py"
click node_gateway "https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/guard_service.py"
click node_incident_api "https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/guard_service.py"
click node_executor "https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/guard_service.py"
click node_security "https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/security.py"
click node_state "https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/security.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_dashboard,node_integrity toneBlue
class node_launcher,node_gateway,node_incident_api,node_executor toneAmber
class node_security,node_state toneMint
class node_calle toneRose
class node_user,node_admin toneIndigo
```

## Components

### Admin Console

- [Streamlit Dashboard](https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/frontend/dashboard.py): `frontend/dashboard.py`
- [State Hashing](https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/frontend/dashboard.py): `frontend/dashboard.py`

### API and Orchestration

- [Service Launcher](https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/main.py): `backend/main.py`
- [FastAPI Gateway](https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/guard_service.py): `backend/guard_service.py`
- [Incident Status API](https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/guard_service.py): `backend/guard_service.py`
- [Background Call Dispatch](https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/guard_service.py): `backend/guard_service.py`

### Detection and State

- [Prompt Detection](https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/security.py): `backend/security.py`
- [Security State](https://github.com/sakshi-jadiya/airgap-call--call-e-hackathon/blob/main/backend/security.py): `backend/security.py`

### Out-of-Band Triage

- **CALL-E Telephony**

### Other components

- **Prompt Operator**
- **Admin Phone**

## Connections

- Prompt Operator → Streamlit Dashboard: enters prompt (evidence: `frontend/dashboard.py`)
- Streamlit Dashboard → FastAPI Gateway: posts chat (evidence: `frontend/dashboard.py`)
- FastAPI Gateway → Prompt Detection: scans prompt (evidence: `backend/guard_service.py`)
- FastAPI Gateway → Security State: checks and updates (evidence: `backend/guard_service.py`)
- Prompt Detection → Security State: records incident (evidence: `backend/security.py`)
- Streamlit Dashboard → Incident Status API: polls status (evidence: `frontend/dashboard.py`)
- Incident Status API → Security State: reads status (evidence: `backend/guard_service.py`)
- Streamlit Dashboard → State Hashing: hashes state (evidence: `frontend/dashboard.py`)
- Streamlit Dashboard → FastAPI Gateway: triggers simulation (evidence: `frontend/dashboard.py`)
- FastAPI Gateway → Background Call Dispatch: offloads call (evidence: `backend/guard_service.py`)
- Background Call Dispatch → CALL-E Telephony: creates call (evidence: `backend/guard_service.py`)
- CALL-E Telephony → Admin Phone: dials alert (evidence: `README.md`)
- Admin Phone → CALL-E Telephony: returns keypad choice (evidence: `README.md`)
- Background Call Dispatch → Security State: applies triage (evidence: `backend/guard_service.py`)
- Service Launcher → FastAPI Gateway: starts server (evidence: `backend/main.py`)
