跳到正文
DEV Community· Maddie Brooks·· 4 小時前AI 評分58

Second Look 為自由工作者提供本機詐騙檢查

Second Look: a local scam check for freelancers, before you reply

AI 導讀

Second Look 是 Maddie Brooks 製作的本機詐騙檢查工具,讓自由工作者在回覆客戶前辨識付款騙局,並顯示觸發警告的原文及建議回覆。工具以 8 條規則判定 Looks OK、Be careful 或 Stop,再由本地 Gemma 3 1B IT 生成解釋和回覆草稿;安全檢查會拒絕不合適的草稿,並在失敗時改用固定文本。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 2: Side Hustle

What I Built

Not long ago a "client" for my side hustle sent me a payment request. It wasn't money coming to me. It was a PayPal invoice for me to pay, presented as a fee I had to cover before the work could start. I didn't pay it, but I did read it twice before I noticed it was backwards. A real client pays you.

That's the reverse-invoice trap, and it has relatives that every new freelancer, Etsy seller and Marketplace seller sees sooner or later: buy the "training kit" first, an overpaid check where you "just send back the difference", gift cards for a "transfer fee", a "verification code" someone needs, "let's move to WhatsApp so I can pay you directly".

Second Look is a small command-line tool you run before you reply. Paste the message and it gives you:

  • a verdict: Looks OK, Be careful or Stop
  • the exact words that triggered each warning, and a plain explanation
  • a calm reply that keeps the conversation and the money on the platform

It all runs on your laptop. Client messages are full of names, rates, addresses and payment details, so pasting them into a cloud chatbot is a risk of its own.

Who would pay for it: new freelancers on Upwork, Fiverr, Contra and Freelancer, and small online sellers. I can see it as a $19 one-time desktop app, or as a "message check" perk that a paid freelancer community gives its members.

Demo

Try it in your browser: https://maddiebrooks208.github.io/second-look/

Paste a message or click one of the 20 samples. The demo page runs a JavaScript port of the rules, so nothing you paste leaves the browser. A check script confirms it gives the same verdict, rules and matched words as the Python version on all 20 examples. The Gemma explanation runs locally, so it's only in the command-line app.

Command-line app with Gemma, real output from the repo (8-CPU Linux box, no GPU). Screenshots and an asciinema recording are in /demo.

$ second-look check examples/09-whatsapp-direct.txt
SECOND LOOK: BE CAREFUL
  [medium] Move off the platform before escrow
      matched: 'WhatsApp', 'pay you directly'

Why:
  Verdict: Be careful. The client is attempting to bypass the platform's payment
  protection by communicating through a different channel.

Suggested reply:
  Thanks for the message. Before I start, I'd like to keep our chat and the contract on
  the platform with a funded milestone. Happy to go from there.

(gemma-3-1b-it-Q4_K_M.gguf: explanation=model, reply=fallback; guard tripped: moves the chat off-platform: 'WhatsApp'. The verdict comes from plain rules, not the model.)

The explanation came from Gemma. Gemma's reply draft was rejected, and the last line says why. A normal job looks like this:

$ second-look check examples/12-legit-candles.txt
SECOND LOOK: LOOKS OK
  no known payment-trap patterns found

Why:
  Verdict: Looks OK. The client is requesting a significant amount of content creation,
  and none of the known trap patterns indicated a potential risk.

Suggested reply:
  Okay, I can certainly handle that. Let's see what I can do.

Code

GitHub logo maddiebrooks208 / second-look

Local-first scam check for freelance client messages: plain-code rules decide, a local open-weight model explains and drafts a safe reply.

Second Look

A local-first "before you reply" checker for freelancers and side hustlers.

Paste a client message, job post, or payment email. Second Look flags the classic side-hustle payment traps (an invoice sent to you, "pay for the training kit first", overpay-and-refund, gift cards or crypto, requests for logins or codes, moving off-platform before escrow, pressure to hurry, big unpaid "test tasks") and suggests a calm reply that keeps money on the platform. Nothing leaves your laptop.

  • Plain-code rules decide the verdict (Looks OK / Be careful / Stop), each with the exact words that triggered it. See second_look/rules.py or run second-look rules.
  • A small open-weight model running locally (Gemma 3 1B IT, via llama.cpp) explains the result and drafts a reply. It can't change the verdict. Every model sentence goes through a guard; a draft that tells you to pay, buy, click, share info or move off-platform…

MIT-licensed. The core has no dependencies; llama-cpp-python is optional. There are 50 tests, including one for each of the 20 example messages.

How I Built It

The rules decide the verdict. Eight plain regex rules (reverse invoice, pay to start, overpay and refund, gift cards or crypto, asks for logins or codes, off-platform, pressure, large unpaid test task) each carry a severity and a one-line "why". Any high-severity hit means Stop. A medium hit means Be careful. Anyone can read the list and add to it. I think a list of scam patterns should be public.

The model only does the wording. Gemma 3 1B instruction-tuned runs as a 4-bit GGUF (806 MB) through llama.cpp and llama-cpp-python, on CPU. It gets the fixed verdict, the findings and the message, and makes two short calls, one for the explanation and one for the reply. Each check takes about 4 to 5 seconds.

Then I watched it fail, and kept the logs. All four runs over the 20 examples are in /logs, unedited:

  1. One prompt asking for both parts: 0 of 20 usable. The 1B model skipped the explanation and often wrote as the scammer: "We've already processed the onboarding fee..."
  2. Two separate calls: the format came back, and so did the danger. For the bank-login example it drafted: "Please send your online banking login details and a photo of your ID." It agreed to move to WhatsApp. One explanation called a fake fee "a standard payment process."
  3. Few-shot examples plus a stricter guard: explanations got much better. Replies to scam messages still came out as "I'll process the invoice as per your instructions" and "Please send the gift card codes to the platform."
  4. Final version: the explanation and the reply are checked separately. The reply guard rejects anything that says pay, buy, click, send money, share details, gives a link, mentions WhatsApp or Telegram, or agrees to deal "directly". It also rejects replies that are too short, or that don't keep things on the platform when the message was flagged. The explanation guard rejects instructions to act, links, any softening ("looks legit", "a standard security protocol"), and any explanation that doesn't state the fixed verdict. If either one fails, that part uses fixed text. If the model file is missing, everything does.

The final run kept 16 of 20 Gemma explanations and 5 of 20 Gemma replies. All five kept replies were for the normal messages. Every reply Gemma drafted for a flagged message was rejected. I could have hidden that, but it's the most useful thing I learned: a 1B model is good at saying why something looks wrong, and it should not be the one writing your answer to a scammer. For those messages, Second Look now uses a fixed, boring and safe reply.

Why Does Open Innovation Matter?

  • The messages stay private. You'd be checking messages from people who may be trying to steal from you, and those messages include your name, your rates and sometimes your payment details. A local open-weight model means none of it leaves the laptop. That isn't possible with a closed API.
  • I could see the failures and build around them. Because the model runs locally with fixed settings, I could rerun the same 20 messages after every change and log exactly what it said. The guard comes straight out of those logs.
  • The pattern list belongs in the open. Scammers share what works. Freelancers should too. The rules are a short Python file anyone can audit, fork or extend.
  • It costs $0 per check and works offline, which matters for a tool aimed at people who are just starting to earn.

Prize Categories

Best Use of Gemma: Gemma 3 1B IT runs locally through llama.cpp, writes every explanation and the replies to normal messages, and its failures shaped the guard design.


AI disclosure: I built this with AI coding assistance (Grok Bot), and this post was drafted with AI help and edited by me. Every output shown is from a real run, and the logs are in the repo. Credits: Gemma 3 (Google, Gemma Terms of Use), llama.cpp, llama-cpp-python, asciinema, Pillow.

來源:DEV Community · dev.to