AegisAI Perspectives · 176

How does zero-hour auto purge (ZAP) work in Microsoft 365, and what does it miss?

ZAP acts on Microsoft 365 mail delivered in the last 48 hours once found malicious. For phishing and spam, four anti-spam policy actions stop it acting.

TL;DR
Answer
Microsoft's zero-hour auto purge (ZAP) acts on malicious email delivered in the last 48 hours. For phishing and spam verdicts, four anti-spam policy actions stop it, and allowlists or mail flow rules might override it.
Who it's for
If you run IT for a company of 20 to 500 people on Microsoft 365, with a small team and no SOC, use this page to check what ZAP did.
Watch out for
Users aren't notified when ZAP moves a message, and ZAP isn't logged in the Exchange mailbox audit logs, so confirm it in the Mailflow status report and Threat Explorer.
What AegisAI does
AegisAI pulls one bad email from every inbox it reached, forwards included. It reads mail through the Microsoft 365 or Google Workspace API after delivery.
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.

How does zero-hour auto purge (ZAP) work in Microsoft 365, and what does it miss?

Zero-hour auto purge (ZAP) retroactively detects and neutralizes malicious messages delivered to cloud mailboxes in the last 48 hours1. For phishing and spam verdicts, ZAP takes no action under four anti-spam policy actions, and allowlists or mail flow rules might override it. AegisAI investigates every email for what it is trying to do, and removes the ones that fail from every mailbox they reached21.

If you run IT for a company of 20 to 500 people on Microsoft 365, with a small team and no SOC, use this page to check what ZAP did and what it left in place. How removal after delivery works in an API-based layer is on the inbound email security page.

Key takeaways

  • ZAP quarantines malware and high confidence phishing whether the message was read or not47.
  • For spam and high confidence spam, Microsoft states the ZAP action for unread messages only8.
  • When a phishing or spam verdict uses the action Add X-Header, Prepend subject line with text, Redirect message to email address or Delete message, ZAP takes no action6.
  • Allowlists and Exchange mail flow rules might override ZAP actions9.
  • Users aren't notified when ZAP moves a message3, and ZAP isn't logged in the Exchange mailbox audit logs as a system action19.

The short answer

QuestionAnswer
How does zero-hour auto purge (ZAP) work in Microsoft 365, and what does it miss?It acts on delivered messages that are found to be malicious, within the last 48 hours of delivered email. It takes no action on phishing and spam verdicts under four anti-spam policy actions, its spam action is stated for unread mail only, and allowlists or mail flow rules might override it
Which licence does ZAP need?No special licensing for ZAP for malware, spam or phishing. ZAP for Teams protection needs Defender for Office 365 Plan 1 or Plan 214
Where is ZAP turned on?Enable zero-hour auto purge (ZAP) in the anti-spam policy, on by default16, and Enable zero-hour auto purge for malware in the anti-malware policy18
How do I see what ZAP did?The Mailflow view in the Mailflow status report for the count, and Threat Explorer with Additional action ZAP for each message1213

What you can do by the end

  • Confirm the ZAP settings in every anti-spam and anti-malware policy you run.
  • List the cases where ZAP takes no action because of policy actions, allowlists or mail flow rules.
  • Show what ZAP did each week from the Mailflow status report and Threat Explorer.

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

What does ZAP do to a delivered message, and when does it not act?

ZAP finds and takes automated action on messages that are already in a user's mailbox.

  • For read or unread messages found to contain malware, ZAP quarantines the message that contains the malware attachment.
  • For read or unread messages identified as high confidence phishing, ZAP quarantines the message.
  • For phishing that is not high confidence phishing, the outcome depends on the action configured for a Phishing verdict in the applicable anti-spam policy5.
  • For unread spam and high confidence spam, the outcome depends on the action configured for that verdict in the anti-spam policy.

ZAP can act on messages in other folders too, if the message wasn't deleted and the same or stronger action wasn't already applied15.

The Microsoft Learn page sets five limits on where ZAP acts.

  • ZAP's search is limited to the last 48 hours of delivered email.
  • For spam and high confidence spam, the ZAP action is stated for unread messages only.
  • When a phishing or spam verdict uses Add X-Header, Prepend subject line with text, Redirect message to email address or Delete message, ZAP takes no action on the message.
  • Allowlists and Exchange mail flow rules (transport rules) might override ZAP actions.
  • For malware and high confidence phishing, ZAP does not act where allow entries from admin submissions of false positives apply, and those entries exist for 45 days after the last used date by default11.

Read the verdict actions in each anti-spam policy before you count on ZAP for any of them.

How do you check what ZAP did in your tenant?

Work from the policies to the reports. Steps 5 and 6 depend on your Defender for Office 365 plan.

  1. Open the anti-spam policies. In the Microsoft Defender portal, go to Email & collaboration > Policies & rules > Threat policies > Anti-spam in the Policies section17.

  2. In each policy, confirm Enable zero-hour auto purge (ZAP) is selected. ZAP is on by default.

  3. In the same policy, read the action for the Phishing verdict and for both spam verdicts. Change any of the four actions where ZAP takes no action, if you want ZAP to move those messages.

  4. Open the anti-malware policies at Email & collaboration > Policies & rules > Threat policies > Anti-Malware10, and confirm Enable zero-hour auto purge for malware is selected.

  5. Count what ZAP did. Use the Mailflow view in the Mailflow status report to see the number of ZAP-affected messages for a date range.

  6. Find each message. In Threat Explorer, filter the All email tab by the value ZAP in the Additional action column. Threat Explorer is in Defender for Office 365 Plan 2, and Real-time detections is in Plan 120.

Run steps 5 and 6 once a week, and again after any change to an allowlist or a mail flow rule.

Which ZAP setting does what, and where is it?

ZAP is turned on in the anti-spam and anti-malware policies, the verdict actions in the anti-spam policy set its outcome for phishing and spam, and the Mailflow status report and Threat Explorer show what it did.

Setting or stepWhere it is in the admin consoleEdition or licenceWhat it doesWhat it does not do
Enable zero-hour auto purge (ZAP)Microsoft Defender portal, Email & collaboration > Policies & rules > Threat policies > Anti-spamNo special licensing for ZAP for spam and phishingDetects and takes action on messages delivered to cloud mailboxes; on by defaultTakes no action under the four anti-spam policy actions listed above
Phishing verdict actionSame anti-spam policyNo special licensing for ZAP for phishingSets the ZAP outcome for read or unread phishingApplies to phishing, not high confidence phishing, which ZAP quarantines
Spam and High confidence spam verdict actionsSame anti-spam policyNo special licensing for ZAP for spamSets the ZAP outcome for spam found after deliveryStated for unread messages only
Enable zero-hour auto purge for malwareMicrosoft Defender portal, Email & collaboration > Policies & rules > Threat policies > Anti-MalwareNo special licensing for ZAP for malwareQuarantines delivered messages that contain malwareSearches only the last 48 hours of delivered email
Mailflow viewMailflow status reportNot named on the ZAP pageShows the number of ZAP-affected messages for a date rangeShows a count, not each message
Threat Explorer, Additional action ZAPAll email tab, Additional action columnDefender for Office 365 Plan 2; Real-time detections in Plan 1Filters the email events where ZAP actedNot a user notice or an audit log entry (see Key takeaways)
Allowlists and Exchange mail flow rulesExchange mail flow rules (transport rules) and allowlistsNot named on the ZAP pageMight override ZAP actionsAdmin allow entries from false positive submissions last 45 days after last use by default

How does removal after delivery work in an API-based layer?

An API-based layer reads mail through the provider's API after delivery and applies its own verdicts, as described in API-based email security before the user opens.

AegisAI reports on its inbound email security page that 3 in 10 confirmed phishing emails cleared native Gmail and Microsoft filters in Q3 202625. How automated quarantine and remediation work across tools, and how to test them in a trial, is covered in automated email quarantine and remediation.

How AegisAI handles this

AegisAI pulls one bad email from every inbox it reached, forwards included24. It reads mail through the Microsoft 365 or Google Workspace API after delivery22. The inbound email security page states that the median verdict takes 1.9 seconds, and a convicted message is removed from every mailbox it reached within seconds23.

Book a demoSee inbound email security

See your own records: Check your domain.

How to measure it in 30 days

Track three numbers from the Defender portal.

  • ZAP-affected messages per week from the Mailflow view.
  • Messages in Threat Explorer with Additional action ZAP, split by verdict.
  • Anti-spam policies that still use one of the four actions where ZAP takes no action.

To see an email investigation from start to finish, talk to the team. On day 30, compare the weekly ZAP count with the number of policies you changed.

Questions people ask

How does zero-hour auto purge (ZAP) work in Microsoft 365, and what does it miss?

ZAP acts on malicious email delivered to cloud mailboxes in the last 48 hours. For phishing and spam verdicts, four policy actions stop it, and allowlists or mail flow rules might override it. AegisAI states on its inbound email security page that a convicted message is removed from every mailbox it reached within seconds.

Is ZAP on by default?

Yes. Enable zero-hour auto purge (ZAP) is on by default in anti-spam policies. For malware, check that Enable zero-hour auto purge for malware is selected in each anti-malware policy.

Do I need Defender for Office 365 for ZAP?

There are no special licensing requirements for ZAP for malware, spam or phishing. ZAP for Teams protection needs Plan 1 or Plan 2. Threat Explorer is in Plan 2, and Real-time detections is in Plan 1.

Why did ZAP leave a spam message a user had already read?

For spam and high confidence spam, Microsoft states the ZAP action for unread messages only. Malware and high confidence phishing are quarantined whether read or not.

Will users or the audit log show that ZAP moved a message?

No. Users aren't notified, and ZAP isn't logged in the Exchange mailbox audit logs as a system action. Use the Mailflow status report and Threat Explorer instead.

Sources

  1. (Microsoft Learn, Zero-hour auto purge (ZAP) in Microsoft Defender for Office 365, last updated 1 June 2026, read 20 November 2026)
  2. (Microsoft Learn, Configure anti-spam policies, read 20 November 2026)
  3. (Microsoft Learn, Configure anti-malware policies, read 20 November 2026)
  4. (Microsoft Learn, About Threat Explorer and Real-time detections, read 20 November 2026)
  5. (AegisAI, Inbound email security, read 20 November 2026)
  6. (AegisAI Perspectives, API-based email security before the user opens, read 20 November 2026)
  7. (AegisAI Perspectives, How automated email quarantine and remediation works, read 20 November 2026)
  8. (AegisAI, Book a demo)

Recent posts

Every email, investigated.