Phishing Email Triage
Full-stack phishing analysis: extract IOCs, enrich URLs against URLhaus, classify intent with GPT-4o-mini, score 0–100, route to quarantine or monitor. 9 steps, ~8 seconds end-to-end.
name: Phishing Email Triage
version: "1.0"
trigger: email_received
inputs:
- name: sender
- name: subject
- name: body
- name: headers
- name: attachments
steps:
# 1-4. Extract IOCs (URLs, IPs, emails, base64)
- id: extract_urls
type: regex.extract
with:
input: "{{ inputs.body }}"
pattern: "https?://[^\s\"'<>)\]\}]+"
global: true
- id: extract_ips
type: regex.extract
with:
input: "{{ inputs.body }} {{ inputs.headers }}"
pattern: "\\b(IP address pattern)\\b"
global: true
- id: extract_emails
type: regex.extract
with:
input: "{{ inputs.body }}"
pattern: "[a-zA-Z0-9._%+\\-]+@[a-zA-Z0-9.\\-]+\\.[a-zA-Z]{2,}"
global: true
- id: extract_base64
type: regex.extract
with:
input: "{{ inputs.body }}"
pattern: "[A-Za-z0-9+/]{40,}={0,2}"
global: true
# 5. URLhaus reputation (no API key needed)
- id: enrich_urls
type: http.post
on_failure: continue
with:
url: "https://urlhaus-api.abuse.ch/v1/url/"
headers:
Content-Type: "application/x-www-form-urlencoded"
body:
url: "{{ steps.extract_urls.output.all[0] }}"
# 6. LLM intent classification
- id: analyze_intent
type: llm.analyze
with:
model: gpt-4o-mini
temperature: 0.1
json_output: true
system: "You are a senior email security analyst..."
prompt: "Classify this email. Return JSON: classification, confidence, reasoning, signals"
# 7. Combine IOC + LLM into 0-100 risk score
- id: score
type: transform
with:
compute:
ioc_component: "min(url_count*15,30) + min(ip_count*10,10) + base64_bonus"
llm_component: "confidence * direction_factor * 0.6"
final_score: "clamp(ioc + llm, 0, 100)"
severity: "score>=70?critical : score>=40?high : score>=20?medium : low"
# 8. Route: quarantine if score >= 70, else monitor
- id: route
type: conditional
with:
if: "steps.score.output.final_score >= 70"
# 9a/9b. Output verdict with IOCs and LLM reasoning
- id: recommend_quarantine
type: output
if: "steps.route.output.result == true"
with:
value:
verdict: "{{ steps.analyze_intent.output.parsed.classification }}"
recommended_action: quarantine
score: "{{ steps.score.output.final_score }}"
severity: "{{ steps.score.output.severity }}"
llm_reasoning: "{{ steps.analyze_intent.output.parsed.reasoning }}"
phishing_signals: "{{ steps.analyze_intent.output.parsed.phishing_signals }}"
legitimate_signals: "{{ steps.analyze_intent.output.parsed.legitimate_signals }}"
- id: recommend_monitor
type: output
if: "steps.route.output.result == false"
with:
value:
verdict: "{{ steps.analyze_intent.output.parsed.classification }}"
recommended_action: monitor
score: "{{ steps.score.output.final_score }}"
severity: "{{ steps.score.output.severity }}"
llm_reasoning: "{{ steps.analyze_intent.output.parsed.reasoning }}"
phishing_signals: "{{ steps.analyze_intent.output.parsed.phishing_signals }}"
legitimate_signals: "{{ steps.analyze_intent.output.parsed.legitimate_signals }}"
Run Demo
Submit a suspicious email. The engine runs all 9 steps live.