# naishsayed/securedrive-ai architecture

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

- Interactive diagram: https://gitdiagram.com/naishsayed/securedrive-ai
- Repository: https://github.com/naishsayed/securedrive-ai

## Overview

SecureDrive AI is a MetaDrive autonomous-driving simulator with an attack-control interface and telemetry logging. The principal loop in simulation/autonomous_drive.py gets actions from the custom autopilot, optionally modifies them through the attack engine, steps MetaDrive, then collects and logs telemetry. The tree also contains separate traffic-model and IDM avoidance implementations; their integration with the main loop is not shown, so they are represented as distinct capabilities without inferred links. No README content was provided.

Main entry points: [`simulation/autonomous_drive.py`](https://github.com/naishsayed/securedrive-ai/blob/main/simulation/autonomous_drive.py) (Simulation loop), [`gui/attack_panel.py`](https://github.com/naishsayed/securedrive-ai/blob/main/gui/attack_panel.py) (Attack panel), [`simulation/telemetry.py`](https://github.com/naishsayed/securedrive-ai/blob/main/simulation/telemetry.py) (Telemetry collection), [`attacks/attack_engine.py`](https://github.com/naishsayed/securedrive-ai/blob/main/attacks/attack_engine.py) (Attack engine)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Simulation runtime"]
  node_sim_loop["Simulation loop"]
  node_metadrive["MetaDrive environment"]
  node_autopilot["SecureDrive autopilot"]
  node_basic_runner["Basic MetaDrive runner<br/>[main.py]"]
end

subgraph group_security["Attack controls"]
  node_attack_engine["Attack engine<br/>[attack_engine.py]"]
  node_attack_panel["Attack panel<br/>[attack_panel.py]"]
end

subgraph group_observability["Telemetry"]
  node_telemetry["Telemetry collection<br/>[telemetry.py]"]
  node_logger["CSV telemetry logger"]
end

subgraph group_driving["Traffic driving"]
  node_traffic_model["SecureDrive traffic model"]
  node_avoidance["IDM traffic avoidance"]
end

node_operator(("Operator"))

node_operator -->|"starts"| node_sim_loop
node_sim_loop -->|"steps environment"| node_metadrive
node_sim_loop -->|"computes actions"| node_autopilot
node_sim_loop -->|"modifies actions"| node_attack_engine
node_sim_loop -->|"creates interface"| node_attack_panel
node_attack_panel -.->|"controls attacks"| node_attack_engine
node_sim_loop -->|"collects data"| node_telemetry
node_sim_loop -->|"logs records"| node_logger
node_telemetry -->|"provides records"| node_logger
node_sim_loop -->|"resets episodes"| node_metadrive
node_operator -->|"starts"| node_basic_runner

click node_sim_loop "https://github.com/naishsayed/securedrive-ai/blob/main/simulation/autonomous_drive.py"
click node_autopilot "https://github.com/naishsayed/securedrive-ai/blob/main/simulation/custom_autopilot.py"
click node_attack_engine "https://github.com/naishsayed/securedrive-ai/blob/main/attacks/attack_engine.py"
click node_attack_panel "https://github.com/naishsayed/securedrive-ai/blob/main/gui/attack_panel.py"
click node_telemetry "https://github.com/naishsayed/securedrive-ai/blob/main/simulation/telemetry.py"
click node_logger "https://github.com/naishsayed/securedrive-ai/blob/main/simulation/telemetry_logger.py"
click node_traffic_model "https://github.com/naishsayed/securedrive-ai/blob/main/simulation/securedrive_traffic_model.py"
click node_avoidance "https://github.com/naishsayed/securedrive-ai/blob/main/simulation/traffic_avoidance.py"
click node_basic_runner "https://github.com/naishsayed/securedrive-ai/blob/main/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_sim_loop,node_metadrive,node_autopilot,node_basic_runner toneBlue
class node_attack_engine,node_attack_panel toneAmber
class node_telemetry,node_logger toneMint
class node_traffic_model,node_avoidance toneRose
class node_operator toneIndigo
```

## Components

### Simulation runtime

- [Simulation loop](https://github.com/naishsayed/securedrive-ai/blob/main/simulation/autonomous_drive.py): `simulation/autonomous_drive.py`
- **MetaDrive environment**
- [SecureDrive autopilot](https://github.com/naishsayed/securedrive-ai/blob/main/simulation/custom_autopilot.py): `simulation/custom_autopilot.py`
- [Basic MetaDrive runner](https://github.com/naishsayed/securedrive-ai/blob/main/main.py): `main.py`

### Attack controls

- [Attack engine](https://github.com/naishsayed/securedrive-ai/blob/main/attacks/attack_engine.py): `attacks/attack_engine.py`
- [Attack panel](https://github.com/naishsayed/securedrive-ai/blob/main/gui/attack_panel.py): `gui/attack_panel.py`

### Telemetry

- [Telemetry collection](https://github.com/naishsayed/securedrive-ai/blob/main/simulation/telemetry.py): `simulation/telemetry.py`
- [CSV telemetry logger](https://github.com/naishsayed/securedrive-ai/blob/main/simulation/telemetry_logger.py): `simulation/telemetry_logger.py`

### Traffic driving

- [SecureDrive traffic model](https://github.com/naishsayed/securedrive-ai/blob/main/simulation/securedrive_traffic_model.py): `simulation/securedrive_traffic_model.py`
- [IDM traffic avoidance](https://github.com/naishsayed/securedrive-ai/blob/main/simulation/traffic_avoidance.py): `simulation/traffic_avoidance.py`

### Other components

- **Operator**

## Connections

- Operator → Simulation loop: starts (evidence: `simulation/autonomous_drive.py`)
- Simulation loop → MetaDrive environment: steps environment (evidence: `simulation/autonomous_drive.py`)
- Simulation loop → SecureDrive autopilot: computes actions (evidence: `simulation/autonomous_drive.py`)
- Simulation loop → Attack engine: modifies actions (evidence: `simulation/autonomous_drive.py`)
- Simulation loop → Attack panel: creates interface (evidence: `simulation/autonomous_drive.py`)
- Attack panel → Attack engine: controls attacks (evidence: `gui/attack_panel.py`)
- Simulation loop → Telemetry collection: collects data (evidence: `simulation/autonomous_drive.py`)
- Simulation loop → CSV telemetry logger: logs records (evidence: `simulation/autonomous_drive.py`)
- Telemetry collection → CSV telemetry logger: provides records (evidence: `simulation/autonomous_drive.py`)
- Simulation loop → MetaDrive environment: resets episodes (evidence: `simulation/autonomous_drive.py`)
- Operator → Basic MetaDrive runner: starts (evidence: `main.py`)
