type.inbound
and length(recipients.to) + length(recipients.bcc) + length(recipients.cc) == 1
// exclude To: Undisclosed recipients:;
// since we won't have a valid recipient email
and any(recipients.to, .email.domain.valid == true)
and (
profile.by_sender().prevalence in ("new", "outlier")
or (
profile.by_sender().any_messages_malicious_or_spam
and not profile.by_sender().any_messages_benign
)
)
and (
any(recipients.to,
(
strings.icontains(subject.subject, .email.email)
or strings.icontains(subject.subject, .email.local_part)
)
and (
.email.domain.valid or strings.icontains(.display_name, "undisclosed")
)
)
)
and any(recipients.to,
strings.icontains(body.current_thread.text, .email.email)
)
and any(body.links,
any(recipients.to,
strings.icontains(..href_url.query_params, .email.email)
)
and (
(
not strings.icontains(.display_text, "unsubscribe")
and not strings.icontains(.href_url.path, "unsubscribe")
)
)
)
and any(ml.nlu_classifier(body.current_thread.text).intents,
.name in ("cred_theft") and .confidence == "high"
)
// negate highly trusted sender domains unless they fail DMARC authentication
and (
(
sender.email.domain.root_domain in $high_trust_sender_root_domains
and not headers.auth_summary.dmarc.pass
)
or sender.email.domain.root_domain not in $high_trust_sender_root_domains
)
Playground
Test against your own EMLs or sample data.