Initial commit
This commit is contained in:
51
docs/email-dlp-workflow.md
Normal file
51
docs/email-dlp-workflow.md
Normal file
@ -0,0 +1,51 @@
|
||||
[ Directory of .eml Files ]
|
||||
│
|
||||
▼
|
||||
┌───────────────┐
|
||||
│ CLI (cli.py) ├────────────────────────────────────────────────┐
|
||||
└───────┬───────┘ │
|
||||
│ Loop through EMLs │
|
||||
▼ │
|
||||
┌───────────────┐ Metadata (Subject, From, To, Date) │
|
||||
│ EML Parser │──────────────────────────────────────────┐ │
|
||||
│ (parser.py) │ │ │
|
||||
├───────────────┤ Body Text (Parsed via bs4) │ │
|
||||
│ - Decode Heads├────────────────────────────────────┐ │ │
|
||||
│ - Extract HTML│ │ │ │
|
||||
│ - Save Attach │ Attachment Files ▼ ▼ ▼
|
||||
│ to Temp Dir ├─────────────┐ ┌────────────────────────┐
|
||||
└───────────────┘ │ │ Prompt Builder │
|
||||
▼ │ (analyzer.py) │
|
||||
┌───────────────┐ ┌───────────────┐ ├────────────────────────┤
|
||||
│ Converter │◄────┤ Temporary Dir │ │ System Prompt: │
|
||||
│(converter.py) │ └───────────────┘ │ - DLP Policy rules │
|
||||
├───────────────┤ │ (from policy.py) │
|
||||
│ - MarkItDown │ │ - Schemas & Thresholds │
|
||||
│ - Zip/7z Loop │ │ │
|
||||
│ - PyMuPDF Ext │ │ User Prompt: │
|
||||
│ - Text Extrac │ │ - Email Metadata │
|
||||
│ - Image Base64│ │ - Body Text │
|
||||
└───────┬───────┘ │ - Multimodal list │
|
||||
│ │ (Texts + Image URLs) │
|
||||
│ Converted Texts & IMAGE_SENTINELs └───────────┬────────────┘
|
||||
└─────────────────────────────────────────────────► │ Use OpenAI-comp
|
||||
│ API (vLLM/Qwen)
|
||||
┌────────────────────────┐ (or simulator)
|
||||
│ LLM Inference │
|
||||
└───────────┬────────────┘
|
||||
│
|
||||
┌───────────▼────────────┐
|
||||
│ JSON validation │
|
||||
│ (analyzer.py) │
|
||||
├────────────────────────┤
|
||||
│ Parse: action, risk, │
|
||||
│ violations, summary │
|
||||
└───────────┬────────────┘
|
||||
│ DLPResult
|
||||
▼
|
||||
┌────────────────────────┐
|
||||
│ CLI Output │
|
||||
├────────────────────────┤
|
||||
│ - Write JSON to disk │
|
||||
│ - Rich summary table │
|
||||
└────────────────────────┘
|
||||
Reference in New Issue
Block a user