# How we sort through reported phishing emails

Every 15 minutes, a Machine agent opens newly reported emails, checks headers, links and attachments for warning signs, and posts a verdict with a suggested action to Slack. A person makes the final call.

Canonical page: https://themachine.myapps.ai/use-cases/phishing-triage

You trained everyone to forward anything fishy to the phishing-report inbox.
It worked. Now that inbox gets more mail than one person can get through, and
each message means pulling up raw headers, hovering over each link and making
a judgement call. The easy spam is already gone by then, caught by the email
gateway. What people forward is the murky stuff that actually needs eyes on
it. And when a real attack is underway, those reports come in all at once.

So an agent on Machine now looks at that inbox every 15 minutes. It works
through each report and posts its verdict, plus what it suggests doing, in our
security channel on Slack. Reading and suggesting is the whole job. It won't
block a sender, delete an email, or change anything else in Gmail.

- **Team:** Machine
- **Runs on:** A cron every 15 minutes
- **Connected systems:** Gmail · Slack
- **Mode:** Reads Gmail, never writes to it · a single Slack post for each report

## The problem

The gateway strips out the blatant junk, so whatever lands in the report inbox
is already the tricky layer. An invoice that looks believable. A login page
one letter off from the real one. A display name that doesn't match where the
replies go. Getting the call right means looking at SPF, DKIM and DMARC
results, following a short link to find where it truly ends up, and spotting
a "PDF" that is really a document full of macros. That's a handful of checks
on every single message before anyone can say what it is.

The usual answers buckle when volume rises. If a person checks the inbox
whenever they have a moment, a live campaign can go unnoticed for hours. A
fixed list of bad domains can't know about the lookalike someone registered
this morning. Quarantining every reported message is quick, but it gets
things wrong often enough that people learn to ignore it. And blocking a
genuine sender by mistake becomes an incident all by itself.

## What we built

Every 15 minutes, a cron on Machine starts a brand new agent session that can
read the phishing-report Gmail inbox and nothing more. It collects whatever
was reported since the previous check. For each one it looks at the sender's
authentication results, compares the reply-to and return-path with the
display name, follows each link to where it really goes, and inspects any
attachments. Then it rates the risk and writes up a verdict: block this
sender, warn everyone who might have the same email, or leave it alone. The
verdict goes to the security channel in Slack. Gmail itself stays untouched.

## How it works

### Fire every 15 minutes

A **cron trigger** starts the agent four times an hour. Each time, Machine
spins up a new **session**, a fresh cloud computer set up just for that run.
If a wave of reports arrives mid-attack, the next tick catches them instead
of waiting on someone's calendar. Nothing is carried over from one run to the
next.

### Hand it the warning-sign playbook

The agent's idea of a red flag is written into a **skill**, the playbook it
works from. It covers reading SPF, DKIM and DMARC results, what it means when
the reply-to and return-path don't line up, following a shortened or hidden
link to its real destination, which attachment types deserve suspicion, and
how all of that adds up to a risk level and a suggested action.

### Hook up the inbox, read-only

A scoped **connector** links the agent to its tools. Machine holds the token
on its own servers, so the model never sees it. The agent works with:

- **The phishing-report inbox in Gmail.** It reads each fresh report in full:
the headers, the links and the attachments.
- **Slack, for posting.** For each reported email it writes one verdict that
gives the risk level, the clues behind it and the suggested action.

### Draw the lines

The agent **looks, suggests and alerts. That's it.** Blocking senders,
deleting or moving mail, cleaning anything up in Gmail or elsewhere: none of
that is open to it. When it names an action, that's advice for someone on
the security team to take or leave.

### Post what it found

The result is one Slack post per reported email, inside 15 minutes. It shows
the risk level, the exact clues it found (the authentication that failed, the
link that doesn't go where it claims, the attachment that looks off) and
what it suggests. Security takes it from there and decides whether to block
the sender, warn the people who got it, or mark it harmless and move on.

> **The pattern**
> A **cron** every 15 minutes opens a new session with a **connector** that
> can only read the phishing-report Gmail inbox. A **skill** holds the list of
> warning signs. The agent sorts and suggests. Blocking, deleting and cleanup
> are never in its hands.

## Guardrails

This agent reads real reports from staff about possible attacks, so what it
can reach is narrow and flows one way only:

- **Kept apart.** Each run gets its own sealed-off sandbox. The session can
  see only the phishing-report inbox and the security channel, and it sends
  nothing anywhere else.
- **Locked-down keys.** The Gmail credential is stored encrypted in the
  Secrets Manager, added to the sandbox at run time, and only handed to the
  agents you grant them to.
- **Advice, not action.** It analyses, sorts and suggests. It will not block
  a sender, delete or quarantine mail, or carry out any other fix. Whatever it
  recommends is for a person to do.
- **All of it lives in code.** The warning-sign playbook, the risk levels and
  what each system lets it do are files in the repo. They're versioned, and
  you change them with a reviewed **change request**, not a switch on a
  dashboard.

## The outcome

- **15 min:** The longest a reported email waits for a verdict
- **Read-only:** Gmail is never blocked, cleared or edited by the agent
- **3 signals:** Headers, links and attachments, looked at on each report

Reports once sat until someone found a spare minute. Now each one has a
verdict inside 15 minutes, with the clues spelled out and a suggested next
step. The agent never touches a sender or a mailbox. Your security team still
makes every decision. They just start with the homework already finished.
