惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

量子位
I
InfoQ
人人都是产品经理
人人都是产品经理
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
Hugging Face - Blog
Hugging Face - Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
SegmentFault 最新的问题
美团技术团队
小众软件
小众软件
Blog — PlanetScale
Blog — PlanetScale
Jina AI
Jina AI
aimingoo的专栏
aimingoo的专栏
H
Help Net Security
Last Week in AI
Last Week in AI
博客园_首页
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
L
LangChain Blog
云风的 BLOG
云风的 BLOG
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
G
Google Developers Blog
博客园 - 叶小钗
博客园 - Franky

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built a phishing detector into Chrome using Claude AI. ...
carlos lopez · 2026-06-17 · via DEV Community

My mother called me last week. Someone had sent her an SMS
claiming to be from DHL, asking her to pay a £2.99 customs
fee via a link. She almost clicked it.

That was enough. I spent a weekend building a Chrome extension
that lets you paste any suspicious message and get an instant
verdict. Here's how it works.

The architecture (and why Cloudflare Workers)

The obvious approach is to call the Claude API directly from
the extension. Don't do this. Your API key lives in the
extension code, which anyone can extract from the Chrome Web
Store in about 30 seconds.

The right pattern: extension → Cloudflare Worker → Claude API.
The Worker lives server-side, holds the API key as an
environment variable, and acts as a proxy. Cloudflare's free
tier handles 100,000 requests/day, which is more than enough.

The Worker

export default {
async fetch(request, env) {
const { prompt } = await request.json();

const response = await fetch('https://api.anthropic.com/v1/messages', {
  method: 'POST',
  headers: {
    'x-api-key': env.ANTHROPIC_API_KEY,
    'anthropic-version': '2023-06-01',
    'content-type': 'application/json'
  },
  body: JSON.stringify({
    model: 'claude-haiku-4-5-20251001',
    max_tokens: 350,
    messages: [{ role: 'user', content: prompt }]
  })
});

return response;

}
}

I'm using Haiku, not Opus. For a classification task like
this — is this phishing or not — Haiku is faster, 10x cheaper,
and gets the same result. Opus is overkill.

The prompt

After a dozen iterations, this is what actually works:

"You are an expert cybersecurity analyst specializing in
phishing detection. Analyze the following message and
determine if it is PHISHING, SUSPICIOUS, or LEGITIMATE.

Pay special attention to impersonation of financial
institutions (PayPal, Chase, Barclays), government agencies
(IRS, HMRC, DVLA), delivery services (UPS, FedEx, Royal Mail)
and major tech companies (Amazon, Apple, Microsoft, Netflix).

Respond ONLY in this format:
VERDICT: [PHISHING / SUSPICIOUS / LEGITIMATE]
CONFIDENCE: [High / Medium / Low]
SIGNALS: [comma-separated list, max 4]
ADVICE: [one clear action sentence]"

One thing worth knowing: parse only the VERDICT line,
not the whole response. Otherwise txt.includes("PHISHING")
will always return true because the word appears in the
template itself.

const verdictLine = txt.split('\n')
.find(l => l.startsWith('VERDICT:')) || '';
const isPhishing = verdictLine.includes('PHISHING');

Obvious in hindsight. Took me longer than I'd like to admit.

Results

Tested against 50 real phishing attempts. Claude got 48 right.
The two it missed were unusually well-crafted —
legitimate-looking domains with no obvious red flags.
For anything with a suspicious link or an urgency pattern,
it's essentially perfect.


If you want the full source code — extension, Worker, and
deploy instructions — I packaged it here: https://carlosdevlop.gumroad.com/l/ai-phishing-detector-bundle