# cpaio00/intelligent-download-security architecture

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

- Interactive diagram: https://gitdiagram.com/cpaio00/intelligent-download-security
- Repository: https://github.com/cpaio00/intelligent-download-security

## Overview

SentinelPE is an investigation-stage design for local-first static detection of user-selected Windows PE files. The documented workflow validates and extracts features in a browser extension, classifies locally, and requests per-file consent before escalating uncertain files to a server. A declined upload or failed step must produce UNSCANNED. The README explicitly states that none of these components or the evaluation pipeline is implemented; the graph therefore represents documented design, not observed runtime calls. Relationships below are documented in the README; no source excerpts were available.

Main entry points: [`extension`](https://github.com/cpaio00/intelligent-download-security/tree/main/extension) (Extension page), [`backend`](https://github.com/cpaio00/intelligent-download-security/tree/main/backend) (FastAPI service), [`ml`](https://github.com/cpaio00/intelligent-download-security/tree/main/ml) (Compact local model), [`docs/testing-plan.md`](https://github.com/cpaio00/intelligent-download-security/blob/main/docs/testing-plan.md) (Routing comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser analysis"]
  node_extension["Extension page"]
  node_validation["PE validation"]
  node_extractor["Static feature extractor"]
  node_digest["SHA-256 digest"]
  node_consent["Per-file consent"]
  node_verdict["User verdict"]
  node_unscanned["UNSCANNED result"]
end

subgraph group_server["Server analysis"]
  node_api["FastAPI service"]
  node_shap["SHAP attributions"]
end

subgraph group_models["Models and routing"]
  node_localmodel["Compact local model"]
  node_router["Confidence router"]
  node_servermodel["Full-feature model"]
end

subgraph group_evaluation["Evaluation"]
  node_parity["Feature parity evaluation<br/>[testing-plan.md]"]
  node_routingeval["Routing comparison<br/>[testing-plan.md]"]
  node_results["Evaluation measures"]
end

node_user(("File user"))
node_pefile["Selected PE file"]
node_dataset[("EMBER2024 data")]

node_user -->|"selects file"| node_extension
node_pefile -->|"provides bytes"| node_extension
node_extension -->|"validates PE"| node_validation
node_extension -->|"extracts features"| node_extractor
node_extension -->|"computes digest"| node_digest
node_extension -->|"classifies locally"| node_localmodel
node_localmodel -->|"returns probability"| node_router
node_router -->|"returns local verdict"| node_verdict
node_router -->|"requests consent"| node_consent
node_consent -->|"uploads with consent"| node_api
node_consent -->|"decline means"| node_unscanned
node_extension -->|"failure means"| node_unscanned
node_api -->|"classifies file"| node_servermodel
node_api -->|"computes explanations"| node_shap
node_api -->|"returns verdict and digest"| node_verdict
node_dataset -->|"supplies feature records"| node_parity
node_dataset -->|"supplies evaluation records"| node_routingeval
node_routingeval -->|"measures strategies"| node_results

click node_extension "https://github.com/cpaio00/intelligent-download-security/tree/main/extension"
click node_validation "https://github.com/cpaio00/intelligent-download-security/tree/main/extension"
click node_extractor "https://github.com/cpaio00/intelligent-download-security/tree/main/extension"
click node_digest "https://github.com/cpaio00/intelligent-download-security/tree/main/extension"
click node_localmodel "https://github.com/cpaio00/intelligent-download-security/tree/main/ml"
click node_router "https://github.com/cpaio00/intelligent-download-security/tree/main/extension"
click node_consent "https://github.com/cpaio00/intelligent-download-security/tree/main/extension"
click node_verdict "https://github.com/cpaio00/intelligent-download-security/tree/main/extension"
click node_unscanned "https://github.com/cpaio00/intelligent-download-security/tree/main/extension"
click node_api "https://github.com/cpaio00/intelligent-download-security/tree/main/backend"
click node_servermodel "https://github.com/cpaio00/intelligent-download-security/tree/main/ml"
click node_shap "https://github.com/cpaio00/intelligent-download-security/tree/main/backend"
click node_parity "https://github.com/cpaio00/intelligent-download-security/blob/main/docs/testing-plan.md"
click node_routingeval "https://github.com/cpaio00/intelligent-download-security/blob/main/docs/testing-plan.md"
click node_results "https://github.com/cpaio00/intelligent-download-security/tree/main/results"

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_extension,node_validation,node_extractor,node_digest,node_consent,node_verdict,node_unscanned,node_user toneBlue
class node_api,node_shap,node_dataset toneAmber
class node_localmodel,node_router,node_servermodel toneMint
class node_parity,node_routingeval,node_results toneRose
class node_pefile toneIndigo
```

## Components

### Browser analysis

- [Extension page](https://github.com/cpaio00/intelligent-download-security/tree/main/extension): `extension`
- [PE validation](https://github.com/cpaio00/intelligent-download-security/tree/main/extension): `extension`
- [Static feature extractor](https://github.com/cpaio00/intelligent-download-security/tree/main/extension): `extension`
- [SHA-256 digest](https://github.com/cpaio00/intelligent-download-security/tree/main/extension): `extension`
- [Per-file consent](https://github.com/cpaio00/intelligent-download-security/tree/main/extension): `extension`
- [User verdict](https://github.com/cpaio00/intelligent-download-security/tree/main/extension): `extension`
- [UNSCANNED result](https://github.com/cpaio00/intelligent-download-security/tree/main/extension): `extension`

### Server analysis

- [FastAPI service](https://github.com/cpaio00/intelligent-download-security/tree/main/backend): `backend`
- [SHAP attributions](https://github.com/cpaio00/intelligent-download-security/tree/main/backend): `backend`

### Models and routing

- [Compact local model](https://github.com/cpaio00/intelligent-download-security/tree/main/ml): `ml`
- [Confidence router](https://github.com/cpaio00/intelligent-download-security/tree/main/extension): `extension`
- [Full-feature model](https://github.com/cpaio00/intelligent-download-security/tree/main/ml): `ml`

### Evaluation

- [Feature parity evaluation](https://github.com/cpaio00/intelligent-download-security/blob/main/docs/testing-plan.md): `docs/testing-plan.md`
- [Routing comparison](https://github.com/cpaio00/intelligent-download-security/blob/main/docs/testing-plan.md): `docs/testing-plan.md`
- [Evaluation measures](https://github.com/cpaio00/intelligent-download-security/tree/main/results): `results`

### Other components

- **File user**
- **Selected PE file**
- **EMBER2024 data**

## Connections

- File user → Extension page: selects file (evidence: `README.md`)
- Selected PE file → Extension page: provides bytes (evidence: `README.md`)
- Extension page → PE validation: validates PE (evidence: `README.md`)
- Extension page → Static feature extractor: extracts features (evidence: `README.md`)
- Extension page → SHA-256 digest: computes digest (evidence: `README.md`)
- Extension page → Compact local model: classifies locally (evidence: `README.md`)
- Compact local model → Confidence router: returns probability (evidence: `README.md`)
- Confidence router → User verdict: returns local verdict (evidence: `README.md`)
- Confidence router → Per-file consent: requests consent (evidence: `README.md`)
- Per-file consent → FastAPI service: uploads with consent (evidence: `README.md`)
- Per-file consent → UNSCANNED result: decline means (evidence: `README.md`)
- Extension page → UNSCANNED result: failure means (evidence: `README.md`)
- FastAPI service → Full-feature model: classifies file (evidence: `README.md`)
- FastAPI service → SHAP attributions: computes explanations (evidence: `README.md`)
- FastAPI service → User verdict: returns verdict and digest (evidence: `README.md`)
- EMBER2024 data → Feature parity evaluation: supplies feature records (evidence: `README.md`)
- EMBER2024 data → Routing comparison: supplies evaluation records (evidence: `README.md`)
- Routing comparison → Evaluation measures: measures strategies (evidence: `README.md`)
