Weekly
Get a weekly email of Drive files shared too widely
Every Monday you get an email listing recently edited Drive files that anyone with the link or people outside your company can open.
- Runs
- Weekly
- Apps
- Gmail, Google Drive
- AI
- Not needed
- Access
- Drive read (drive.metadata.readonly); Gmail gmail.send
Send this to your assistant
Create a ClickRuntime automation: every Monday, check Drive files modified in the last 7 days and email me any shared with 'anyone with the link' or with external domains.
First time? Adding ClickRuntime to your assistant takes about two minutes.
Why use it
Why teams use this automation
A small agency shares files with clients all the time. Somebody switches a folder to 'anyone with the link' to get past an access request, and months later a pricing sheet or a contract is still open to whoever has the URL.
This automation reviews the files touched in the past week and emails you the ones that are open to anyone or shared outside your domain. You check a short list once a week instead of discovering an exposure by accident.
What you get out of it
Catch exposures while they are recent
Looking at last week's files means you see a risky share while you still remember why it was made and can tighten it.
A short list, not a full audit
Only recently active files are checked, so the email stays small enough to actually read and act on.
Useful for client and security reviews
A weekly record of sharing checks helps when a client or insurer asks how you protect their documents.
Nothing is changed without you
The email is a report. You decide which shares are fine and which to remove, so legitimate client sharing is never broken.
How it works
What happens, step by step
Every Monday ClickRuntime lists the Drive files modified in the last 7 days.
It checks who each file is shared with.
Files open to anyone with the link, or shared with people outside your domain, are collected into a list.
You get an email with each file's name, link and who can open it.
Before it runs live
- Connect Google through your own Google app (a one-time, 10-minute setup), so it works with your own Gmail
- Connect Google Drive
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
- Run it at a different time, more or less often, or only on weekdays
- 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 Gmail and Google Drive steps into one automation
Under the hood
The code that runs this automation
from datetime import datetime, timedelta, timezone
from google.oauth2.credentials import Credentials
from googleapiclient.discovery import build
from clickruntime import on_trigger, credentials, notify
DOMAIN = "northwind.example"
@on_trigger
def run(event):
drive = build("drive", "v3", credentials=Credentials(credentials.connection("google", "work")), cache_discovery=False)
since = (datetime.now(timezone.utc) - timedelta(days=7)).strftime("%Y-%m-%dT%H:%M:%S")
files = drive.files().list(q=f"modifiedTime > '{since}' and trashed = false", pageSize=500,
fields="files(id,name,webViewLink)").execute().get("files", [])
flagged = []
for f in files:
perms = drive.permissions().list(fileId=f["id"], fields="permissions(type,emailAddress)").execute().get("permissions", [])
wide = [p["type"] if p["type"] == "anyone" else p.get("emailAddress", "") for p in perms
if p["type"] == "anyone" or (p.get("emailAddress") and not p["emailAddress"].endswith("@" + DOMAIN))]
if wide:
flagged.append(f"{f['name']} - {', '.join(wide)}\n {f['webViewLink']}")
if flagged:
notify.email_me(f"Drive sharing audit: {len(flagged)} files to review", "\n\n".join(flagged))
return {"checked": len(files), "flagged": len(flagged)}FAQ
Common questions
What counts as shared too widely?
Does it look at every file in my Drive?
Does it change sharing settings?
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
Archive every email from one sender to a Drive folder
Each new email from the sender you choose is saved as a file in your Drive folder, so you keep a complete record outside your inbox.
See how it worksGet emailed when a web page changes, with snapshots in Drive
Whenever a page you watch changes, you get an email showing what changed and a copy of the new version is saved to Drive.
See how it worksSave client email attachments into Drive, one folder per company
Attachments from client emails are filed in Drive automatically, each in a folder named after the sender's company.
See how it worksKeep exploring
Set up “Get a weekly email of Drive files shared too widely” from your assistant
Copy the prompt above, or connect your assistant first. Free plan, no credit card.