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.
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
Every 10 minutes, ClickRuntime looks at emails that arrived since the last check and pulls out their links.
Emails it has already checked are skipped, so each link is scanned once.
Each link is looked up on VirusTotal and the verdict is added as a row in your Security sheet.
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
Build your own
Need it to work differently?
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
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?
Which links are checked?
Does it delete or quarantine the email?
What permissions does it need?
Does it need AI?
How many runs does it use?
Can I change how it works?
Related
You might also like
Turn sheet briefs into AI drafts reviewed in Teams
Add a brief to your sheet and an AI draft is written into the row and posted to your Teams channel for review.
See how it worksPost upcoming deadlines from a sheet to Teams
Each morning your Teams channel lists every item in your tracker due in the next two days, with the person responsible.
See how it worksSee new job listings as they're posted
Jobs that match your keywords show up in a Slack channel, each one only once.
See how it worksKeep exploring
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.