邮件安全

使用 Laya 检测钓鱼邮件

对可疑邮件做分类,并判断凭据窃取风险。

使用场景

在大量邮件进入更重的检测器或人工分析前,用 Laya 做第一层分流。

State

Your Microsoft 365 password expires today. Confirm your account immediately and enter your password to avoid suspension.

Typed questions

choiceemail_type

How should this email be classified?

normalspamphishing
noulcredential_theft

Is this email trying to obtain account credentials?

预期方向

  • 查看主要结构化结果是否符合预期
  • 检查概率 / score 是否支持你的业务阈值
上游 spam / phishing benchmark 很强,但这些任务在训练 mix 中,仍需用自己的邮件分布验证。

直接复制代码

Python
from laya import Router
router = Router(preload=True)
state = {"email": "Your Microsoft 365 password expires today. Confirm your account and enter your password."}
questions = {
    "email_type": {"type": "choice", "instructions": "How should this email be classified?", "criteria": {"normal": "legitimate", "spam": "bulk promotion", "phishing": "credential theft"}},
    "credential_theft": {"type": "noul", "instructions": "Is this email trying to obtain account credentials?"}
}
print(router.predict(state, questions))
TypeScript / Node.js
import { Laya } from "@receptron/laya";
const laya = await Laya.load();
const result = await laya.systemOne(
  { email: "Your Microsoft 365 password expires today. Confirm your account." },
  {
    email_type: { type: "choice", instructions: "How should this email be classified?", criteria: { normal: "legitimate", spam: "bulk promotion", phishing: "credential theft" } },
    credential_theft: { type: "noul", instructions: "Is this trying to obtain credentials?" },
  },
);
console.log(result.answers);
await laya.close();