
Modern phishing attacks are smarter than ever. They impersonate executives, mimic trusted brands, and evade traditional filters with ease. To fight back, I built an autonomous AI phishing detector — a system that uses Claude AI as an intelligent agent capable of analyzing, reasoning, and acting like a real security analyst.
The Vision
The goal was simple:
Create an AI-powered system that thinks for itself — identifying phishing attempts in real time, using contextual reasoning and external threat intelligence only when necessary.
Unlike rule-based or static ML models, this system is self-directed. It decides when to investigate, which tools to use, and how to synthesize results into a final verdict.
The Problem

Modern phishing campaigns are growing exponentially:
- 1,003,924 attacks recorded in Q1 2025 (APWG)
- 3.4 billion phishing emails sent daily
- Over 90% of cyberattacks begin with phishing
Traditional defenses fail because:
- Static rules can’t adapt to new attack patterns
- Basic models lack deep contextual understanding
- Manual triage doesn’t scale — and minutes matter
What’s needed is an autonomous system that acts like a security analyst: adaptive, context-aware, and tireless.
The Solution: An Autonomous AI Agent
This system uses Claude 4 via the Model Context Protocol (MCP) to autonomously detect, verify, and classify phishing emails.
Core Capabilities
- Understands natural language and email intent
- Extracts and investigates suspicious URLs/domains
- Decides autonomously whether to call threat intelligence APIs
- Synthesizes findings into explainable recommendations
- Operates continuously, without human intervention
Architecture Overview
Orchestration: n8n
Agent: Claude Sonnet 4
Threat Intel: VirusTotal
Framework: Model Context Protocol (MCP)
Email I/O: Gmail API
Flow Summary:
- n8n triggers every 5 minutes to fetch unread Gmail messages
- Claude AI analyzes emails and extracts potential IOCs (Indicators of Compromise)
- If necessary, it calls a custom check_virustotal tool
- It reevaluates findings with reputation data
- A JavaScript node formats a threat report and emails the SOC team

How the AI Agent Thinks
Here’s what autonomy looks like in practice:
- Initial Review — Claude reads sender, subject, and body, looking for red flags like urgency or typosquatting.
- Tool Decision — If URLs appear suspicious, it independently calls the check_virustotal tool.
- Verification — VirusTotal returns domain reputation data (e.g., 12/95 malicious detections).
- Synthesis — Claude combines results into a contextual risk score and provides an explainable recommendation: Allow, Quarantine, or Block.
Example
Email:
From: security@paypa1-verify.com
Subject: URGENT: Verify Your Account
Claude’s Reasoning:
- “paypa1” shows typosquatting → suspicious
- Urgency tactics present
- VirusTotal flags 12/95 malicious
- Final Threat Score: 98/100 (BLOCK)
This reasoning and final decision are automatically emailed to the security team.
Below you can see our agent running in real time:
Why MCP Matters
The Model Context Protocol is what enables Claude to act like an autonomous analyst. Instead of hardcoding logic (“always call VirusTotal”), MCP allows the model to reason about tool usage contextually.
That means:
- Fewer wasted API calls
- Better adaptation to new phishing techniques
- Modular extensibility — new tools like WHOIS or URLScan can be added instantly
Performance Snapshot
Metric Result Detection Accuracy High (context-adaptive) False Positives <5% Avg. Processing Time 8–15 seconds per email Daily Throughput ~2,800 emails Cost per Email $0.01–$0.03 VirusTotal Calls 10–20/day
Final Report Print Out



Key Advantages
1. True Autonomy
The AI agent determines its own investigation path — no static rules or manual triggers.
2. Context-Aware Intelligence
Understands linguistic cues, sender reputation, and behavioral context to differentiate legitimate emails from scams.
3. Explainable AI
Every decision comes with full reasoning and confidence scores, empowering analysts to trust (and audit) outcomes.
4. Scalable & Extensible
Add tools like WHOIS, URLScan, or Passive DNS with minimal setup — Claude learns to use them dynamically.
5. Cost Efficiency
By reasoning before acting, the system drastically reduces unnecessary API usage.
Future Enhancements
Tool Additions:
- WHOIS Lookup
- URLScan.io
- Passive DNS
- Certificate Transparency
- OCR for image-based phishing
Integrations:
- SIEM (Splunk, QRadar)
- Email quarantine automation
- SOC ticket creation
Real-World Use Cases
Enterprise SOCs
Automate triage, cut analyst workload by 80%, and maintain 24/7 coverage.
Financial Services
Prevent business email compromise (BEC) and fraudulent wire requests with real-time detection.
SMBs
Affordable AI-based protection without needing a full security team.
Sample Detections
- Phishing:
“Your Microsoft account will be deleted” → BLOCK (96/100)
Domain flagged as malicious (8/95 engines) - Legitimate:
“Team meeting tomorrow” → ALLOW (5/100) - Suspicious but Clean:
Marketing newsletter → ALLOW (35/100) with contextual note
Contributing
This is an open-source initiative. Contributions are welcome in:
- New tool integrations
- Detection logic
- Optimization and performance
- Documentation and UI improvements
About the Creator
Max Matkovski
AI/ML Engineer | Security Automation Enthusiast
📧 maxmatkovski [at] gmail [dot] com
🔗 linkedin.com/in/maxmatkovski