Skip to content

Every 10 minutes

Scan email links, log results and alert Teams on bad ones

Links in new emails are checked with VirusTotal, every result is logged in your Security sheet, and malicious ones are flagged in Teams.

Runs
Every 10 minutes
Apps
Google Sheets, Microsoft Teams
AI
Not needed
Access
Sheets write; ChannelMessage.Send

Send this to your assistant

Create a ClickRuntime automation: every 10 minutes, check the links in new emails with VirusTotal, log each result in my Security sheet and post to our Teams security channel if any link is malicious.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

A small accounting firm handles invoices and bank details by email, which makes it a regular phishing target. There is no security team, and staff are told to be careful, but one convincing link is all it takes.

Checking every link against VirusTotal and posting a warning to Teams gives the office a shared early warning. The sheet becomes a record of what came in, which helps when a client or insurer asks.

What you get out of it

  • Warnings before anyone clicks

    A malicious link is flagged in Teams within minutes of arriving. Colleagues can be told to delete the email before it does damage.

  • A log for audits and insurers

    Every scanned link is recorded with its verdict and time. You can show what was checked and when.

  • Security without a security team

    The checks run on their own in the background. A small office gets a layer of protection it would otherwise skip.

  • Patterns become visible

    The sheet shows which senders and domains keep sending bad links. You can block them at the mail level.

How it works

What happens, step by step

  1. Every 10 minutes, ClickRuntime looks at emails that arrived since the last check and pulls out their links.

  2. Emails it has already checked are skipped, so each link is scanned once.

  3. Each link is looked up on VirusTotal and the verdict is added as a row in your Security sheet.

  4. If any link is reported as malicious, a warning with the sender and subject is posted to your Teams channel.

Before it runs live

  • Connect your Google Sheets account and pick the spreadsheets it may use
  • Connect Microsoft Teams

What you get

RunsEvery 10 minutes
Scan email links, log results and alert Teams on bad onestoday, 9:00Succeeded
Teams · #security⚠️ Malicious link in "Invoice overdue - Contoso Ltd": 7 engines flag it as phishing. Do not open.

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Google Sheets and Microsoft Teams steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
log_suspicious_link_scans_to_a_sheet_and_alert_teams.pyexample
import re, base64
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, http, state, report_fetched

SHEET_ID, TEAM_ID, CHANNEL_ID = "your-spreadsheet-id", "your-team-id", "your-channel-id"

@on_trigger
def run(event):
    creds = Credentials(credentials.connection("google", "work"))
    gmail = build("gmail", "v1", credentials=creds, cache_discovery=False).users().messages()
    seen = state.get("seen") or []
    new = [m["id"] for m in gmail.list(userId="me", q="newer_than:1d").execute().get("messages", []) if m["id"] not in seen]
    report_fetched(len(new))
    if not new:
        return {"new": 0}
    vt, rows = {"x-apikey": credentials.secret("VIRUSTOTAL_API_KEY")}, []
    for mid in new:
        msg = gmail.get(userId="me", id=mid, format="full").execute()
        subject = next((h["value"] for h in msg["payload"]["headers"] if h["name"] == "Subject"), "")
        for url in list(set(re.findall(r"https?://[^\s\"'<>]+", str(msg["payload"]))))[:5]:
            uid = base64.urlsafe_b64encode(url.encode()).decode().strip("=")
            stats = http.get(f"https://www.virustotal.com/api/v3/urls/{uid}", headers=vt).json().get("data", {}).get("attributes", {}).get("last_analysis_stats", {})
            bad = stats.get("malicious", 0)
            rows.append([msg["internalDate"], subject, url, bad])
            if bad:
                http.post(f"https://graph.microsoft.com/v1.0/teams/{TEAM_ID}/channels/{CHANNEL_ID}/messages",
                          headers={"Authorization": f"Bearer {credentials.connection('microsoft', 'work')}"},
                          json={"body": {"content": f"⚠️ Malicious link in \"{subject}\": {url}"}})
    if rows:
        build("sheets", "v4", credentials=creds, cache_discovery=False).spreadsheets().values().append(spreadsheetId=SHEET_ID,
            range="Security!A:D", valueInputOption="USER_ENTERED", body={"values": rows}).execute()
    state.set("seen", (seen + new)[-1000:])
    return {"emails": len(new), "links": len(rows)}

FAQ

Common questions

Do I need a VirusTotal account?
Yes, a VirusTotal API key is needed. The free public key works for light use; a busy shared inbox may need a higher quota.
Which links are checked?
Links found in emails that arrived since the last check. Common safe domains, such as your own website, can be skipped to save lookups.
Does it delete or quarantine the email?
No. It logs and alerts only. Removing the email is left to you or your mail admin.
What permissions does it need?
Sheets write; ChannelMessage.Send. Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run each time it checks. Checks that find nothing new and stop right away aren't counted.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Scan email links, log results and alert Teams on bad ones” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.