Microsoft 365 Best Practices Library · Email, files and Teams

Safe Attachments policy design for Microsoft Defender for Office 365

Safe Attachments opens an email attachment in a sealed test environment before your staff can open it. If the file behaves like malware, the message is held. This guide explains the four actions you can choose, when Dynamic Delivery makes sense, the separate switch that protects files in SharePoint, OneDrive and Teams, how password-protected attachments are handled, and how to confirm it all works.

Prefer to have it done for you? IT Perfection provides Microsoft 365 security hardening for companies in Irvine, Orange County and Los Angeles County.

Ali Hassani, CISSP and Certified CISO, IT PerfectionWritten by Ali Hassani, CISSP and C|CISO · 25+ years designing, securing and supporting business networks · Updated November 2026

IT specialist helping an employee at her workstation
1 · ReviewWe check which Safe Attachments policy covers each mailbox.

Microsoft 365 Best Practices Library › Email, files and Teams › Safe Attachments policy design

What it isA second check on email attachments, after ordinary anti-malware scanning. Each attachment is opened in a virtual environment (Microsoft calls this detonation) before delivery. A separate setting does the same for files in SharePoint, OneDrive and Teams.
Where it livesMicrosoft Defender portal › Email & collaboration › Policies & rules › Threat policies › Safe Attachments
License neededDefender for Office 365 Plan 1 (included in Microsoft 365 Business Premium) or Plan 2 (included in E5). Either plan can be bought as an add-on.
Time to set upThirty to sixty minutes to review and set. A new policy typically takes about 30 minutes to take effect.
Risk if missingHigh Ordinary scanning looks for known malware. A new or altered file that no scanner has seen before can pass it.

Why it matters

Known malware is caught by scanning. New malware is caught by watching what it does

Every Exchange Online mailbox has anti-malware protection that compares attachments with known threats. That works well for files that have been seen before. It works less well for a file that was built yesterday for one campaign.

Safe Attachments adds a second step. The attachment is opened in a virtual environment and watched. If it tries to do something harmful, the message is quarantined, and later copies of the same attachment are blocked automatically. Microsoft says this scanning typically completes within 15 minutes, and sometimes takes longer.

As with Safe Links, there is no default Safe Attachments policy, but tenants with Defender for Office 365 get the Built-in protection preset policy, which applies Safe Attachments to every recipient who is not covered by another policy. So the question for most companies is not “is it on?” but “is it on for everyone, with the right action, and is the file protection for SharePoint, OneDrive and Teams switched on as well?”

The four actions

Off, Monitor, Block or Dynamic Delivery

A Safe Attachments policy has one main setting, called Safe Attachments unknown malware response. It has four possible values.

ActionWhat happensUse it when
OffAttachments are not checked by Safe Attachments. Ordinary anti-malware scanning still runs.Microsoft does not recommend this for most users.
MonitorMessages are delivered, and detections are tracked. Messages with a detected attachment can be redirected to a mailbox you name for review.You want to observe for a short time before blocking.
BlockMessages with a detected attachment are quarantined. Later copies are blocked automatically. Safe messages may be delayed by the scan.The default, and the value in the Standard and Strict presets.
Dynamic DeliveryThe message body is delivered at once with a placeholder for each attachment. The attachment appears when the scan finishes. Detected messages are quarantined.A short delay on attachments causes real problems for the business.

Dynamic Delivery has limits that are worth knowing before choosing it. It works only for Exchange Online mailboxes. Microsoft lists cases where it cannot replace the attachment, including messages moved out of the Inbox by an Inbox rule, messages in public folders, deleted messages, S/MIME encrypted messages, and tenants where the Exclaimer signature service is enabled. The preset security policies use Block, and their values cannot be edited, so Dynamic Delivery requires a custom policy for users who are not in a preset.

Beyond email

A separate switch protects SharePoint, OneDrive and Teams

Safe Attachments policies cover email only. Files that are uploaded to SharePoint, OneDrive or a Teams channel are protected by a different setting, found under Global settings on the Safe Attachments page. It is on or off for the whole organization. It cannot be limited to certain users or to Teams alone.

When this setting is on and a file is identified as malicious, people cannot open, move, copy or share it. By default they can still download it. Microsoft recommends closing that gap with one SharePoint Online PowerShell command:

Set-SPOTenant -DisallowInfectedFileDownload $true

This affects users and administrators alike; people can still delete the file. Microsoft also recommends creating an alert policy so that an administrator is notified when a malicious file is detected in a library.

Safe Attachments policiesEmail attachments. Scoped to users, groups or domains. One policy applies per recipient.
SharePoint, OneDrive and TeamsOne global switch for the whole organization, plus the download block in SharePoint Online PowerShell.
Safe DocumentsChecks Office files opened in Protected View on the desktop. Available with Microsoft 365 E5 or the Microsoft Defender Suite only.

Password-protected files

What happens to attachments that cannot be opened

A password-protected ZIP or Office file is a common business habit, and also a common way to hide malware from scanners. Safe Attachments cannot fully check such a file unless it can find the password, for example in the body of the email.

When the action is Block, a policy can turn on Block messages containing encrypted attachments that could not be scanned. Those messages are then quarantined instead of delivered, with the reason “Password protected item”.

  • An administrator can release the message at any time.
  • The recipient can release their own message by entering the attachment password, if the quarantine policy allows users to release. The attachment is then scanned again before it is delivered.
  • The password is used once to open and rescan the file. Microsoft states it is not stored. It can be submitted only once per message.
  • File types can be excluded from this setting: PDF, archives, Office files, or all other types.
  • Several attachments with different passwords are not handled by this setting.

If you turn this on, tell staff first. They should enter only the attachment password, never an account password, and only for a message they were expecting from a sender they can confirm.

Before you start

What to have ready

  • The right roles. Security Administrator for the policies and the global setting. SharePoint Administrator for the download block command.
  • Licenses confirmed. Every protected person needs Defender for Office 365 Plan 1 or Plan 2.
  • A list of current policies. Note every Safe Attachments policy, its action and who it applies to, and who is in the Standard and Strict presets.
  • Someone who reviews quarantine. By default only administrators can review and release messages held by Safe Attachments.
  • Known sources of password-protected files. Accountants, banks, payroll providers and others who send them routinely.
  • Any email signature or mail-routing add-on in use. Some affect Dynamic Delivery.

Step by step

Design and apply Safe Attachments in seven steps

  1. See what applies today

    Microsoft Defender portal › Email & collaboration › Policies & rules › Threat policies › Safe Attachments

    Open the Safe Attachments page and note each policy, its status, priority and action. As with other threat policies, only one applies to each recipient, in this order: Strict preset, Standard preset, custom policies by priority, then Built-in protection.

  2. Choose the action

    Use Block unless a specific team has a real need for Dynamic Delivery. Avoid leaving anyone on Off. A policy set to Monitor should have an end date, because Monitor delivers the message.

  3. Cover everyone

    Microsoft Defender portal › Email & collaboration › Policies & rules › Threat policies › Preset security policies

    The simplest design is to put all recipients in the Standard preset, which sets Safe Attachments to Block. If you need Dynamic Delivery for one team, create a custom policy for that group and keep those users out of the presets.

  4. Decide on password-protected attachments

    Microsoft Defender portal › Email & collaboration › Policies & rules › Threat policies › Safe Attachments › Create

    In a custom policy with the Block action, decide whether to turn on blocking of encrypted attachments that could not be scanned, which file types to exclude, and which quarantine policy applies. Start with a pilot group that often receives such files.

  5. Turn on protection for SharePoint, OneDrive and Teams

    Microsoft Defender portal › Email & collaboration › Policies & rules › Threat policies › Safe Attachments › Global settings

    In Global settings, turn on Turn on Defender for Office 365 for SharePoint, OneDrive, and Microsoft Teams and save.

  6. Block downloads of detected files

    A SharePoint Administrator connects to SharePoint Online PowerShell and runs the command shown earlier. Confirm it with Get-SPOTenant | Format-List DisallowInfectedFileDownload.

  7. Add an alert and set the quarantine routine

    Microsoft Defender portal › Email & collaboration › Policies & rules › Alert policy

    Create an alert policy for malware detected in files, sent to the people who will act on it. Agree who checks quarantine and how often, and how a member of staff asks for a held message.

Recommended values

Settings at a glance

SettingRecommendedNotes
Safe Attachments unknown malware responseBlockDefault, and the value in Built-in protection and in the Standard and Strict presets.
Who is coveredAll recipientsThrough the Standard preset, or a custom policy for everyone outside the presets.
Dynamic DeliveryOnly where neededCustom policy, Exchange Online mailboxes only.
Encrypted attachments that could not be scannedDecide and pilotAvailable with the Block action.
Protection for SharePoint, OneDrive and TeamsOnGlobal setting for the whole organization.
DisallowInfectedFileDownloadTrueSet in SharePoint Online PowerShell.
Alert for detected filesOnSent to a monitored mailbox.

Sources: Microsoft Learn, Safe Attachments in Microsoft Defender for Office 365 and Turn on Safe Attachments for SharePoint, OneDrive, and Microsoft Teams, checked November 22, 2026.

Check that it works

How to confirm the result

  • Every policy shows the intended action. On the Safe Attachments page, no policy is set to Off, and any Monitor policy has an owner and an end date.
  • Everyone is covered. The Standard preset shows the intended recipients, and no group is left outside every policy except by decision.
  • The global setting is on. Global settings shows file protection for SharePoint, OneDrive and Teams turned on. In PowerShell, Get-AtpPolicyForO365 | Format-List EnableATPForSPOTeamsODB returns True.
  • Downloads of detected files are blocked. Get-SPOTenant | Format-List DisallowInfectedFileDownload returns True.
  • The alert reaches someone. The alert policy is on and its recipients are current staff.
  • Quarantine can be worked. The person responsible can open quarantine, find a message held by Safe Attachments, and release or delete it.
  • Reports show activity. The threat protection status report shows detections over the following weeks, including the view by content and malware for files.

Do not test with real malware. Use the reports and quarantine to confirm the feature is working.

Mistakes and rollback

Common mistakes, and how to step back

  • Leaving a policy on Monitor. Monitor delivers the message. It is for a short observation period only.
  • Turning Safe Attachments off for internal mail. A compromised internal mailbox can send a harmful file to colleagues.
  • Forgetting the global setting. Email policies do not protect files in SharePoint, OneDrive or Teams.
  • Skipping the download block. Without it, a file marked as malicious can still be downloaded.
  • Choosing Dynamic Delivery without checking add-ons. Signature services and mail routing rules can stop it working.
  • Building a custom policy for users in a preset. The preset wins.
  • No one watching quarantine. By default users cannot release these messages, so a good message can sit unseen.
  • Expecting instant results. A new policy typically takes about 30 minutes to take effect.

Rollback. Change a custom policy back to its previous action, or turn the policy off so the next policy in the order applies. The global file setting and the download block can each be reversed with the same switch or command. Record the values before every change.

Keep it healthy

A light review routine

WhenWhat to do
Each working dayCheck quarantine for messages held by Safe Attachments, including password-protected items waiting for release.
When an alert arrivesFind the file, see who uploaded it and when, and check that person’s device and account.
MonthlyReview the threat protection status report for attachment and file detections.
QuarterlyConfirm policy coverage after staff changes, and that both PowerShell values still return True.

If a clean attachment is held, submit it to Microsoft from the Submissions page so the detection can be corrected, instead of loosening the policy for everyone.

Licenses

Which plan gives you what

PlanSafe AttachmentsNotes
Exchange Online only, Microsoft 365 Business Basic or StandardNot includedBuilt-in anti-malware only. Add Defender for Office 365 Plan 1.
Microsoft 365 Business PremiumIncluded (Plan 1)Email policies and protection for SharePoint, OneDrive and Teams.
Microsoft 365 E5 or Defender for Office 365 Plan 2IncludedAdds advanced hunting and Threat Explorer. E5 also includes Safe Documents.

Check the current terms in the Defender for Office 365 service description before buying.

Have us do it

Prefer to hand this off?

IT Perfection designs and applies Safe Attachments for companies in Irvine, Orange County and Los Angeles County: a coverage check for every mailbox, the right action for each group, file protection for SharePoint, OneDrive and Teams with the download block, an alert, and a quarantine routine your team can follow. You receive a written scope and a written quote before any work starts.

Ali Hassani, CISSP and Certified CISO, IT Perfection

Who does the work

Written by Ali Hassani, CISSP, C|CISO

Ali Hassani has 25+ years of hands-on experience in IT operations, cybersecurity, Microsoft infrastructure, network security and Azure, and works with businesses in Irvine, Orange County and Los Angeles County. Design, implementation and troubleshooting work is planned and reviewed by Ali personally.

This guide is for education and planning. It does not replace a professional audit, compliance assessment or vendor engineering review. Updated November 2026.

ISC2 CISSP badgeEC-Council Certified CISO (C|CISO) badgeCisco CCNP Routing and Switching badgeMCSE: Server Infrastructure badgeMicrosoft MCSE badgeMCSA: Security badgeCisco CCNA Cybersecurity badgeMCITP badge

FAQ

Safe Attachments: common questions

What is Safe Attachments in Microsoft 365?

Safe Attachments is a feature of Microsoft Defender for Office 365. After ordinary anti-malware scanning, it opens email attachments in a virtual environment to check for harmful behavior before the message is delivered.

Is Safe Attachments on by default?

Tenants with Defender for Office 365 have the Built-in protection preset policy, which applies Safe Attachments to recipients not covered by another policy. Protection for files in SharePoint, OneDrive and Teams is a separate global setting that should be checked.

How long does Safe Attachments delay email?

Microsoft says attachment scanning typically completes within 15 minutes and sometimes takes longer. With Dynamic Delivery, the message body arrives immediately and the attachment follows when the scan is complete.

What is the difference between Block and Dynamic Delivery?

With Block, the whole message waits until the attachment has been checked. With Dynamic Delivery, the message is delivered at once with a placeholder for each attachment. In both cases a message with a malicious attachment is quarantined.

Can users release messages quarantined by Safe Attachments?

By default only administrators can review, release or delete them. Users cannot release their own messages quarantined as malware by Safe Attachments; at most they can request release. Password-protected items are an exception where the user can supply the attachment password, if the quarantine policy allows it.

Does Safe Attachments protect files in Teams and SharePoint?

Yes, when the global setting “Turn on Defender for Office 365 for SharePoint, OneDrive, and Microsoft Teams” is on. Microsoft also recommends blocking downloads of detected files with a SharePoint Online PowerShell setting.

Which license includes Safe Attachments?

Defender for Office 365 Plan 1 or Plan 2. Plan 1 is included in Microsoft 365 Business Premium and Plan 2 in Microsoft 365 E5.

Need this done for your business?

IT Perfection plans, installs and supports this for companies in Irvine and Orange County

The guides explain the steps. If you would rather have it done, planned and documented by an experienced engineer, these are the services that cover it. Design, implementation and troubleshooting work is planned and reviewed by Ali Hassani personally.

Microsoft 365 managed services

Exchange, Teams, SharePoint and OneDrive run and secured for you.

View service

Microsoft 365 migration and setup

Mail, calendars and files moved with a tested plan, secured from day one.

View service

SPF, DKIM and DMARC setup

Email authentication set up so your domain cannot be spoofed.

View service