How marksman8/phishing_guard works
PhishGuard takes a pasted raw email through deterministic parsing and injection detection, evidence retrieval, external tool verification, risk/confidence scoring, and a threshold-based decision. It returns a cited recommendation and audit trail, escalating low-confidence cases for human review. The graph and node excerpts establish the main runtime flow; README capability descriptions support the tool and escalation branches. Some integrations and UI details are documented but their implementation was not sampled.
Main entry points: graph.py Analysis graph · decision.py Decision and citations · factory.py Provider selection · analyzer.py Email analyzer
Components 22
Email intake
- Paste UI
app.py - Analysis graph
phishguard/graph.py - Case state
phishguard/state.py - Email analyzer
phishguard/nodes/analyzer.py - Email parser
phishguard/parsing.py - Injection detector
phishguard/injection.py
Evidence gathering
- Evidence retriever
phishguard/nodes/retriever.py - Pattern index access
phishguard/vectorstore.py - Chroma pattern store
data/seed_patterns.jsonl - Tool verifier
phishguard/nodes/verifier.py
Risk assessment
- Risk and confidence
phishguard/nodes/risk.py
Decision and audit
- Decision and citations
phishguard/nodes/decision.py - Redacted trace
phishguard/state.py
Models and tools
- MCP tool client
phishguard/mcp_client.py - MCP tool server
mcp_server.py - LLM provider interface
phishguard/llm/base.py - Provider selection
phishguard/llm/factory.py - LLM backends
phishguard/llm/ollama.py
Other components
- Email analyst
- Domain and URL checks
- Human review
- Classification and recommendation
Connections 24
- Email analyst → Paste UI: pastes email
README.md - Paste UI → Analysis graph: runs analysis
app.py - Analysis graph → Email analyzer: starts at
phishguard/graph.py - Email analyzer → Email parser: parses email
phishguard/nodes/analyzer.py - Email analyzer → Injection detector: detects injection
phishguard/nodes/analyzer.py - Analysis graph → Evidence retriever: routes to
phishguard/graph.py - Evidence retriever → Pattern index access: queries patterns
phishguard/nodes/retriever.py - Pattern index access → Chroma pattern store: reads index
- Analysis graph → Tool verifier: routes to
phishguard/graph.py - Tool verifier → MCP tool client: calls tools
phishguard/nodes/verifier.py - MCP tool client → MCP tool server: starts subprocess
phishguard/mcp_client.py - MCP tool server → Domain and URL checks: checks domains and URLs
README.md - Analysis graph → Risk and confidence: routes to
phishguard/graph.py - Risk and confidence → Tool verifier: reads tool results
phishguard/nodes/risk.py - Risk and confidence → Provider selection: requests content flags
phishguard/nodes/risk.py - Decision and citations → Provider selection: requests recommendation
phishguard/nodes/decision.py - Provider selection → LLM provider interface: creates provider
phishguard/llm/factory.py - Provider selection → LLM backends: selects backend
phishguard/llm/factory.py - Analysis graph → Decision and citations: routes to
phishguard/graph.py - Decision and citations → MCP tool client: escalates case
phishguard/nodes/decision.py - MCP tool server → Human review: creates review ticket
README.md - Decision and citations → Classification and recommendation: returns classification
README.md - Analysis graph → Redacted trace: persists trace
phishguard/graph.py - Case state → Redacted trace: redacts trace entries
phishguard/state.py