Full implementation of the Howl email triage system: - Microsoft Graph API integration with MSAL auth (client-credentials and delegated modes) - Claude LLM classification via tool use for structured output - PostgreSQL database with customers, vendors, whitelist, and email_log tables - Alembic migration for full schema - APScheduler daemon with graceful shutdown - Typer CLI (run, dry-run, status commands) - Business rule classifier with overrides (whitelist protection, low-confidence fallback) - Action executor (move to folders, flag, escalate with webhook) - 35 passing unit tests - README, SETUP, and NEXT_STEPS documentation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
65 lines
2.3 KiB
JSON
65 lines
2.3 KiB
JSON
{
|
|
"customer_inquiry": {
|
|
"classification": "customer_inquiry",
|
|
"confidence": 0.95,
|
|
"action": "move_customer",
|
|
"reasoning": "This is a known customer following up on an order. Should be routed to the Customers folder for response.",
|
|
"priority": "normal",
|
|
"requires_human_review": false,
|
|
"tags": ["order-followup", "customer-service"]
|
|
},
|
|
"vendor_invoice": {
|
|
"classification": "vendor_invoice",
|
|
"confidence": 0.97,
|
|
"action": "move_vendor",
|
|
"reasoning": "Invoice from a known vendor with a specific invoice number and payment details. Route to Vendors folder.",
|
|
"priority": "normal",
|
|
"requires_human_review": true,
|
|
"tags": ["invoice", "payment-due"]
|
|
},
|
|
"spam": {
|
|
"classification": "spam",
|
|
"confidence": 0.98,
|
|
"action": "move_spam",
|
|
"reasoning": "Classic spam characteristics: gift card offer, urgency language, unknown sender domain.",
|
|
"priority": "low",
|
|
"requires_human_review": false,
|
|
"tags": ["gift-card-scam", "promotional"]
|
|
},
|
|
"phishing": {
|
|
"classification": "phishing",
|
|
"confidence": 0.96,
|
|
"action": "move_spam",
|
|
"reasoning": "Phishing attempt: impersonates Microsoft using a suspicious domain, requests credential verification.",
|
|
"priority": "high",
|
|
"requires_human_review": true,
|
|
"tags": ["phishing", "credential-theft", "impersonation"]
|
|
},
|
|
"urgent": {
|
|
"classification": "urgent_action_required",
|
|
"confidence": 0.93,
|
|
"action": "escalate",
|
|
"reasoning": "Known customer reporting production system outage. Requires immediate human attention.",
|
|
"priority": "urgent",
|
|
"requires_human_review": true,
|
|
"tags": ["production-outage", "customer-escalation"]
|
|
},
|
|
"low_confidence": {
|
|
"classification": "unknown",
|
|
"confidence": 0.45,
|
|
"action": "move_review",
|
|
"reasoning": "Cannot determine the nature of this email with sufficient confidence. Human review recommended.",
|
|
"priority": "normal",
|
|
"requires_human_review": true,
|
|
"tags": []
|
|
},
|
|
"newsletter": {
|
|
"classification": "newsletter",
|
|
"confidence": 0.92,
|
|
"action": "move_spam",
|
|
"reasoning": "Unsolicited newsletter from an unknown sender. Contains unsubscribe link.",
|
|
"priority": "low",
|
|
"requires_human_review": false,
|
|
"tags": ["newsletter", "marketing"]
|
|
}
|
|
}
|