AegisAI Perspectives · 143

Does API-based email security stop an email before the user opens it?

No, API-based email security acts after delivery, so the email lands first; this page shows what holds it before delivery and how fast removal follows.

TL;DR
Answer
No. API-based email security reads mail through the Microsoft 365 or Google Workspace API after delivery, so the email reaches the inbox first and is removed after.
Who it's for
If you run IT for a company of 20 to 500 people on Microsoft 365 or Google Workspace, with a small IT or security team and no SOC.
Watch out for
Removal cannot undo a click made before it, and in Gmail an opened phishing message stays in the inbox until someone removes it by hand.
What AegisAI does
AegisAI states on its email phishing prevention page that it reaches a verdict in 1.9 seconds at the median, and removes a convicted message within seconds.
Book a demo

See it on your own Google Workspace or Microsoft 365 tenant. No MX change.

Or get the Q3 2026 State of the AI Attack report (free, instant download)

Not ready for a demo? Check your domain.

Does API-based email security stop an email before the user opens it?

No. API-based email security reads mail through the Microsoft 365 or Google Workspace API after delivery, so the email reaches the inbox first2. AegisAI investigates every email for what it is trying to do, and removes the ones that fail from every mailbox they reached1. Its email phishing prevention page states that it reaches a verdict in 1.9 seconds at the median, and removes a convicted message within seconds4. AegisAI reports on its inbound email security page that 3 in 10 confirmed phishing emails cleared native Gmail and Microsoft filters in Q3 20263.

If you run IT for a company of 20 to 500 people on Microsoft 365 or Google Workspace, with a small IT or security team and no SOC, this page lays out one email's clock. It shows what holds an email before delivery, what acts in the seconds and hours after, and what no post-delivery layer can undo. The comparison of the two models is in API-based or gateway email security: how they differ. The connection and its wider limits are in API-based email security: how it works and its limits.

What you can do by the end

  • Name the built-in checks that hold an email before delivery on Microsoft 365 and Google Workspace.
  • Measure the seconds from arrival to verdict and removal on your own mail.
  • Count how many flagged emails were opened before removal, and plan the follow-up.

Key takeaways

- An API-based layer works after delivery, so it does not hold an email before the inbox9.

- With Safe Links on, Microsoft 365 scans URLs before delivery and holds the message until scanning is finished1415.

- Gmail can slightly delay a suspicious message to run extra checks before delivery20.

- The stated median from arrival to verdict is 1.9 seconds, detonation included, and removal follows within seconds5.

- In Gmail, unopened phishing found after delivery is removed automatically; an opened message stays until someone removes it2223.

The short answer

QuestionAnswerSource
Does API-based email security stop an email before the user opens it?No. It reads mail through the API after delivery. The figure stated on the product page is a 1.9 second median to verdict, with removal of a convicted message within seconds.Inbound email security page; phishing prevention page
What can stop an email before delivery?The platform's own checks. With Safe Links on, Microsoft 365 scans URLs before delivery and holds the message until scanning is finished. Gmail can slightly delay a suspicious message for extra checks.Microsoft Learn; Google Workspace Admin Help
How long do those holds take?Safe Attachments scanning typically completes within 15 minutes12. The Gmail Security Sandbox scan should be complete within a few minutes21.Microsoft Learn; Google Workspace Admin Help
What happens to an email the user already opened?In Gmail, an opened phishing message found after delivery stays until manually removed. An API layer pulls a bad email from every inbox it reached, forwards included7.Google Workspace Admin Help; API-based or gateway page
Is the user told when an email is pulled?Not by Microsoft's zero-hour auto purge (ZAP): users aren't notified when it moves a message19.Microsoft Learn

Short on time? Watch the explainer, or book a demo.

How does API-based timing compare with secure email gateway interception?

An API-based layer does not intercept an email in transit. It works after delivery, through the Microsoft 365 or Google Workspace API. It sits out of the mail path, with no change to mail routing (MX records), so it has no point at which to intercept an email in transit. So the holds before delivery come from the platform itself. In Microsoft 365, all messages pass through the built-in security features for cloud mailboxes before users see them10.

Safe Links scans URLs prior to delivery, whether or not they are rewritten. Messages that contain URLs are held until scanning is finished. Safe Attachments opens attachments in a virtual environment before delivery, a process Microsoft calls detonation11. That scanning typically completes within 15 minutes. The Dynamic Delivery option delivers the message at once, with placeholders in place of attachments until the scan is complete13.

In Google Workspace, enhanced pre-delivery message scanning slightly delays a suspicious message so Gmail can run additional security checks. The Security Sandbox also adds a slight delay, and its scan should be complete within a few minutes.

Turn on the pre-delivery checks your plan includes before you add a layer after delivery.

What is the exposure window problem, and how does timing set it?

The exposure window is the time an email sits in the inbox before it is removed. The API layer starts when the mailbox reports a new message. On Google Workspace, Gmail push notifications run through Cloud Pub/Sub, which typically delivers them within a few seconds24.

The verdict comes next. The AegisAI email phishing prevention page states a median time from arrival to verdict of 1.9 seconds, detonation included. A convicted message is removed within seconds. One bad email is pulled from every inbox it reached, forwards included.

Ask any vendor for its arrival to removal time as a median, and check it on your own tenant.

What happens in the hours after delivery?

The platforms run their own sweeps. Microsoft's ZAP finds and takes automated action on messages that are already in a user's mailbox17. Its search is limited to the last 48 hours of delivered email18. Users aren't notified if ZAP detects and moves a message.

In Gmail, unopened messages found to be phishing after delivery are reclassified and removed from the inbox automatically. If the recipient opened or interacted with the message, it stays in the inbox until manually removed.

A link can also turn bad after it lands. Microsoft's own example of a missed link reads: "Because the link wasn't malicious on delivery, SafeLinks didn't detect it."16 Find out who removes opened messages in your tenant, and how that person learns about them.

What can a post-delivery layer not do?

It cannot hold an email before it lands. It reads mail after delivery, so the inbox gets the email first.

It cannot undo a click. If someone opens the email and clicks in the seconds before removal, pulling the email later does not reverse that click. The window is short, but it is not zero.

It depends on the platform's notice. On Gmail, Cloud Pub/Sub typically delivers that notice within a few seconds. Typically is not always.

It cannot remove anything without write access. Removal needs write access your admin grants and can revoke8.

The wider list of limits is on the how it works and its limits page. Keep the platform's pre-delivery checks on, and treat the API layer as the fast pass after delivery.

What are the compliance implications of pre-open threat quarantine?

The main one is the record. Users aren't notified if ZAP detects and moves a message, so the record sits with the admin. Manual removals in Gmail need the same record. This page makes no claim that any product meets a law, standard or framework. Keep one log line per pulled email: arrival, verdict, removal, and whether it was opened.

How do you close the exposure window on your own mail?

Set the holds before delivery first, then shorten the time after it.

  1. Turn on Safe Links and select its setting "Wait for URL scanning to complete before delivering the message", so URLs are scanned prior to delivery and messages that contain URLs are held.

  2. Choose how Safe Attachments delivers: hold the message for a scan that typically completes within 15 minutes, or use Dynamic Delivery with placeholders.

  3. In Gmail, turn on enhanced pre-delivery message scanning for suspicious messages.

  4. Decide whether the Security Sandbox delay of a few minutes suits your users.

  5. Connect the API layer in monitoring mode, and compare it with what your current stack delivered6.

  6. Grant write access after the monitoring run, so convicted messages are removed within seconds.

  7. Name one owner for opened Gmail messages.

Write the owner's name next to step 7 today.

Which control acts at which moment?

Each row is one control, the moment it acts and the time its owner states.

MomentControlWhat it doesStated timeSource
Before deliveryMicrosoft 365 built-in protectionAll messages pass through it before users see themBefore users see the message
Before deliverySafe LinksScans URLs and holds the messageUntil scanning is finished
Before deliverySafe AttachmentsDetonates attachments in a virtual environmentTypically within 15 minutes
At deliverySafe Attachments Dynamic DeliveryDelivers at once, attachments as placeholdersPlaceholders until the scan is complete
Before deliveryGmail enhanced pre-delivery scanningSlightly delays a suspicious message for extra checksA slight delay
Before deliveryGmail Security SandboxScans before deliveryWithin a few minutes
After deliveryGmail push through Cloud Pub/SubTells a connected app about new mailTypically within a few seconds
After deliveryAPI layer, product page figureVerdict, then removal from every inbox it reached1.9 seconds median to verdict; removal within secondsAegisAI email phishing prevention page
After deliveryMicrosoft ZAPActs on messages already in mailboxes; users not notifiedLast 48 hours of delivered email
After deliveryGmail post-delivery phishing removalRemoves unopened messages; opened ones stayAutomatic for unopened messages

Mark which of these rows are switched on in your tenant today.

How AegisAI handles this

It reads mail through the Microsoft 365 or Google Workspace API after delivery, with no change to mail routing (MX records). AegisAI states on its email phishing prevention page that it reaches a verdict in 1.9 seconds at the median, and removes a convicted message within seconds. One bad email is pulled from every inbox it reached, forwards included. Removal needs write access your admin grants and can revoke.

Book a demoSee inbound email security

See your own records: Check your domain.

How to measure it in 30 days

Track four numbers on your own mail, in one sheet.

  • Median time from arrival to verdict, against the stated 1.9 seconds.
  • How many flagged emails were opened before a verdict.
  • ZAP actions in the same weeks, inside its 48 hour window.
  • After write access, time to removal from every inbox, forwards included.

To get these numbers on your own tenant, ask for a monitoring-mode test of your mail. Put the medians side by side before you change any setting.

Questions people ask

Does API-based email security stop an email before the user opens it?

Not before it lands. It reads mail through the API after delivery. AegisAI states on its email phishing prevention page that it reaches a verdict in 1.9 seconds at the median, and removes a convicted message within seconds. Keep the platform's pre-delivery checks on for the moment before delivery.

Can the user see the email before it is removed?

Yes, for a short window. The email reaches the inbox first, because the layer works after delivery. The email phishing prevention page states a 1.9 second median to verdict, with removal within seconds.

What happens if the user already opened the email?

Gmail's own sweep leaves it for a person to remove. An API layer pulls a bad email from every inbox it reached, forwards included. Removal does not undo a click made before it.

Does Microsoft 365 hold an email while it checks links?

Yes. With Safe Links on, URLs are scanned prior to delivery, and messages that contain URLs are held until scanning is finished.

Are users told when an email is pulled after delivery?

Not by ZAP: users aren't notified if it detects and moves a message. Tell your users how pulled email is handled.

Sources

  1. (AegisAI: Inbound email security, read 14 November 2026)
  2. (AegisAI: Email phishing prevention, read 14 November 2026)
  3. (AegisAI: API-based or gateway email security: how they differ, published 9 November 2026)
  4. (AegisAI: API-based email security: how it works and its limits)
  5. (Microsoft Learn: Mail flow and the built-in protection for cloud mailboxes, updated 9 July 2025, read 14 November 2026)
  6. (Microsoft Learn: Safe Attachments, updated 17 July 2026, read 14 November 2026)
  7. (Microsoft Learn: Safe Links, updated 14 October 2026, read 14 November 2026)
  8. (Microsoft Learn: Zero-hour auto purge, updated 1 June 2026, read 14 November 2026)
  9. (Google Workspace Admin Help: Pre-delivery message scanning, page dated 10 November 2026, read 14 November 2026)
  10. (Google Workspace Admin Help: Gmail Security Sandbox overview, page dated 10 November 2026, read 14 November 2026)
  11. (Google Workspace Admin Help: View alert details, page dated 10 November 2026, read 14 November 2026)
  12. (Google for Developers: Gmail API push notifications, read 14 November 2026)
  13. (AegisAI: demo request page)

Recent posts

Every email, investigated.