Try it in 30 seconds

  1. Open https://github.com/brandosabatini/secondlook/blob/main/dist/secondlook.html and click Download raw file.
  2. Double-click the downloaded file. It runs offline in any modern browser, with nothing to install.
  3. Pick an example from the Example menu (7 suspicious, 4 genuine, all synthetic), or paste your own message.

Inspiration

My university dissertation was on The Next Generation of Cyber Threats: AI in Social Engineering Attacks. Its uncomfortable conclusion was that the advice most people were taught ("look for spelling mistakes") stopped working the day AI tools started writing scam messages. What does not go away is the pressure: a deadline, a threat, a request for a code, money to a "new" account, a reason not to call. A scam cannot drop those without stopping working.

I also work in IT infrastructure and support, and I keep seeing the same moment: someone forwards a message and asks "is this real?". They don't need a red light. They need someone to point at the exact words, explain the trick, and tell them what to do instead. SecondLook is that second look.

What it does

Paste a text, a chat message or a whole email (the "Show original" view), or open an .eml file. In under a second SecondLook shows:

  • A calm verdict in three levels: Stop and verify first, Take a careful look, or No clear warning signs. Never "safe". Every result says how sure it is and what it cannot know.
  • Why: each warning sign with the exact words highlighted in the message and a one-paragraph explanation. 19 persuasion techniques are recognised in English, Italian and Spanish: urgency, threats, requests for one-time codes, logins, money, gift cards or crypto, changed bank details, secrecy, "don't call me", "new number", moving to WhatsApp, remote-access apps, QR codes, prizes and more.
  • The scam it looks like: when signals combine into a known recipe it names it (parcel fee, "Hi Mum", boss/invoice fraud, fake tech support, code theft, fake account warning, prize bait) and explains how that scam works.
  • Link X-ray: who really owns each address. It decodes punycode and highlights letters from other alphabets, catches look-alikes (paypa1, rnicrosoft, amazom), brand names glued to other domains, links whose text shows one site but open another, user@host tricks, shorteners, redirects and raw IPs. It never opens a link.
  • Sender checks for raw emails: SPF, DKIM and DMARC results, display names that claim a brand or show a fake address, official-sounding names on free webmail, Reply-To that goes elsewhere, dangerous attachments (invoice.pdf.exe, macros, attached login pages).
  • What to do: safe next steps tailored to the scam (call the number you already have, type the real address yourself, never pass on a code), plus "already clicked or paid?" recovery steps and where to report.
  • Report: a plain-text summary for an IT team or a bank, with links defanged (hxxps://example[.]com) and emails, phone, card and IBAN numbers masked.

One example of the safer outcome (synthetic)

Maria (a fictional parent) gets a WhatsApp from an unknown number: "Hi Mum, I dropped my phone in the sink and this is my new number… Could you send £640 to this account? Please don't call, the microphone isn't working." She pastes it into SecondLook. It answers Stop and verify first. Looks like: The "Hi Mum" family scam, highlights "Hi Mum", "this is my new number", "send £640" and "Please don't call", and explains that scammers avoid calls because a voice would give them away. The first step it suggests is call the number you already have saved. Maria calls her daughter's old number, her daughter answers from school, and the £640 stays in Maria's account.

Who it helps

People who get a message and hesitate: parents and grandparents, students, small-office staff who pay invoices, and the helpdesk people they forward messages to. The CLI (secondlook --json message.eml, exit codes 0/1/2) lets a helpdesk or security team triage reported emails in a script.

How I built it

  • No framework, no server, no runtime dependencies. Plain HTML, CSS and JavaScript modules. A build step inlines everything into one 90 KB HTML file that works offline when double-clicked. A strict Content-Security-Policy (default-src 'none', connect-src 'none') means the page cannot send data anywhere.
  • A pure analysis engine (src/core/) shared by the web app and a Node CLI: persuasion rules with a Unicode-aware word boundary (so "mamá" and "código" work), negation handling ("never share this code" is not a request), a link analyser with an RFC 3492 punycode decoder and a look-alike "skeleton" check, a defensive MIME parser (header folding, RFC 2047, base64, quoted-printable, multipart, attachments) that turns HTML into text without running it, a scoring and scam-pattern layer, and the advice and report builders.
  • Tests that judge the tool, not just the code: 38 unit tests and 16 Playwright browser tests. Every example has its expected verdict checked. A false-positive corpus of everyday messages in three languages (real 2FA codes, delivery notices, friends' chats) must stay calm. Other tests cover the CLI, fuzzed random input, a 200,000-character message, hostile HTML (<script>, onerror, javascript: links stay inert), keyboard-only use, a phone layout with no sideways scrolling, axe-core accessibility scans of every tab in light and dark mode, the single file opened from disk, and a check that the page makes zero network requests. GitHub Actions runs it all on every push.

Trust and responsible design

  • Privacy by construction: nothing is uploaded, stored or logged; closing the tab forgets the message. Reports mask personal details by default.
  • Explains uncertainty: the lowest result is "No clear warning signs", always followed by "that is not proof it is safe" and why (for example, a hacked real account). Medium results say honest messages use some of these words too.
  • Users can correct it: any warning can be marked "I know this is expected"; the verdict recalculates and it can be undone.
  • Creates no new risk: links are never opened, previewed or made clickable; message content is only inserted as text; reports defang links so nobody clicks them by accident.
  • Not a replacement for emergency services: it says so, and points to the bank, the IT team, the police and national reporting lines.

Challenges I ran into

  • False positives. A real bank text says "never share this code" and "it expires in 5 minutes"; a scam says "share the code with me, it's urgent". Handling negation, first-person requests ("send me the code" vs "we'll send you a code") and a false-positive corpus took more time than writing the rules.
  • Showing a disguised address honestly. My first version proudly displayed the owner of xn--pypal-4ve.com as "pаypal.com", which is exactly the trick. Now the real (ASCII) form is shown as the owner and the disguised form is shown separately, with the foreign letter highlighted.
  • Words in other languages. JavaScript's \b only knows ASCII, so "Hola mamá" did not match. I built a Unicode-aware word boundary used by every rule.
  • Parsing hostile emails safely without a browser HTML parser in the CLI: a small, tested MIME and HTML reader that only extracts text and links.

Accomplishments that I'm proud of

  • It explains why, at the level of the exact words, in three languages, and names the scam.
  • The disguised-link view: the red Cyrillic "а" makes an invisible trick visible.
  • Zero network requests, zero dependencies at runtime, one file you can email to your parents.
  • Every example and every language is covered by tests, including the messages that must not be flagged.

What I learned

That a good warning has four parts: what was found, where, why it matters and what to do instead. That a tool which can be wrong must make it easy to say "this one is fine". And that the most important safety test is the false-positive test: a tool that cries wolf gets ignored.

What's next for SecondLook

  • A browser extension that sends the selected text to the same offline engine.
  • More languages (French and German next) and a community-reviewed rule file.
  • Optional, opt-in checks against public blocklists for people who want them (off by default, clearly labelled as sending data).
  • A "practice" mode with synthetic messages for classrooms and family workshops.

Limitations

  • It reads the message, not the internet: it cannot see where a link finally leads, whether a site is new, or who answers a phone number.
  • A scam with none of the usual signs (for example, from a hacked friend's real account) can get "No clear warning signs". That is why that result always says it is not proof of safety.
  • Rules cover English, Italian and Spanish only; the brand list holds about 40 commonly imitated organisations; domain logic uses a short suffix list, not the full Public Suffix List.
  • Sender checks need the full original email; a pasted body only gets the text and link checks.

Built for SafeSpace Hacks, and credits

  • All code, tests, example messages and images in the repository were written for SafeSpace Hacks; the git history shows the dates. No pre-existing code was reused. My background knowledge comes from my dissertation on AI in social engineering and my work in IT infrastructure.
  • AI assistance: I used an AI coding assistant (Claude Code by Anthropic) to help write the code, tests and documentation. I chose the problem, the scope, the warning signs and the safety rules, and I reviewed the result.
  • Third-party: Playwright (Apache-2.0), axe-core (MPL-2.0) and esbuild (MIT), for testing and building only. No datasets were used.
  • Data: all messages, names, numbers, accounts and addresses are synthetic. Brand names appear only to demonstrate impersonation and belong to their owners; SecondLook is not affiliated with any of them.

Built With

Share this project:

Updates

Submission history