Skip to content

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.

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 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

  1. Every Monday ClickRuntime lists the Drive files modified in the last 7 days.

  2. It checks who each file is shared with.

  3. Files open to anyone with the link, or shared with people outside your domain, are collected into a list.

  4. 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

RunsWeekly
Get a weekly email of Drive files shared too widelytoday, 9:00Succeeded
Email · Drive sharing auditDrive sharing audit: 3 files to review. Acme pricing 2026.xlsx - anyone with the link.

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

  • 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

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.
drive_sharing_audit_by_email.pyexample
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?
Files that anyone with the link can open, and files shared with email addresses outside your own domain. You can add domains of trusted clients to leave out.
Does it look at every file in my Drive?
Only files modified in the last 7 days. Older files can be covered by running it once over a longer period.
Does it change sharing settings?
No. It only reads sharing information and sends you the list. Changing access is left to you.
What permissions does it need?
Drive read (drive.metadata.readonly); Gmail gmail.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 runs (weekly). Checks that find nothing to do 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 “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.