The quarantine attribute is an extended file attribute named com.apple.quarantine that macOS attaches to files arriving from the internet or other untrusted sources. Among the protections covered by macOS security & privacy, it is the marker that triggers Gatekeeper: when a user first opens a marked file, the system checks its code signature, notarization status and known malware signatures before allowing it to run.
The attribute does not block anything by itself. It is metadata stored alongside the file, recording which application downloaded it, when, and a reference to the original download source. Its value lies in connecting provenance to policy, so that macOS can treat a file fetched by a browser very differently from one the user created locally.
How macOS sets the quarantine attribute
The quarantine attribute is written by the downloading application, not by the file system or the network stack. Apps opt in either by declaring the LSFileQuarantineEnabled key in their Info.plist, which makes macOS mark every file the app writes, or by calling Launch Services quarantine functions for selected files. Browsers, mail clients, messaging apps and AirDrop all participate.
The stored value is a short string of four fields separated by semicolons. The following table explains each field in a typical value such as 0083;6560a1f2;Safari; followed by an identifier.
| Field | Example | Meaning |
|---|---|---|
| Flags | 0083 | Hexadecimal bits describing quarantine state and user approval |
| Timestamp | 6560a1f2 | Download time in hexadecimal seconds since 1970 |
| Agent name | Safari | Application that created or downloaded the file |
| Event identifier | A UUID string | Key into the user quarantine events database |
The event identifier links to the QuarantineEventsV2 database in the user Library, a SQLite file that can record the download URL and referring page. Forensic analysts use it to reconstruct where a file came from, and privacy-conscious users sometimes clear it for the same reason.
A notable gap is that command-line tools such as curl do not set the attribute, because they are not quarantine-aware applications. Files fetched that way skip the first-launch Gatekeeper check entirely, which is one reason install instructions that pipe downloads into a shell deserve scrutiny.
What happens when a quarantined file is opened
Opening a quarantined application or executable starts a first-launch assessment handled by Gatekeeper and its supporting services. The system verifies the Developer ID signature, checks for a valid notarization ticket either stapled to the app or fetched online, and scans the code with XProtect signatures.
The outcome depends on what the checks find. The table below summarizes the typical results on current macOS versions.
| Condition of the app | Typical result | User action required |
|---|---|---|
| Signed and notarized | Confirmation dialog naming the download source | Click Open once |
| Signed, not notarized | Launch blocked | Approve in Privacy & Security settings |
| Unsigned or ad hoc signed | Launch blocked as unidentified developer | Approve in Privacy & Security settings |
| Matches XProtect signature | Blocked and offered for deletion | Move to Trash |
| Revoked certificate | Blocked as damaged or malicious | Obtain a fixed version |
Once the user approves the app, macOS updates the flags in the attribute rather than deleting it, so later launches skip the dialog. Since macOS Sequoia, the older Control-click shortcut no longer bypasses the block, and approval requires a visit to System Settings, Privacy & Security.
Quarantined apps launched from their download location may also be subject to App Translocation, also called Gatekeeper Path Randomization. macOS runs the bundle from a randomized read-only path, which prevents an app from loading tampered files placed beside it until the user moves it with Finder.
Quarantine attribute compared with related macOS protections
The quarantine attribute is the trigger, not the inspector. Several neighboring protections in the same Topic perform the actual checks, and understanding the division of labor prevents confusion when troubleshooting a blocked launch.
| Mechanism | Role | When it acts |
|---|---|---|
| Quarantine attribute | Marks file origin and state | When a quarantine-aware app writes the file |
| Gatekeeper | Enforces signing and notarization policy | On first open of a quarantined item |
| App notarization | Proves Apple scanned the developer build | Checked during the Gatekeeper assessment |
| XProtect | Matches known malware signatures | At first launch and during background scans |
| Hardened Runtime | Restricts code injection at run time | Every launch, independent of quarantine |
Inspecting and removing the attribute with xattr
Administrators read and change the quarantine attribute with the xattr command in Terminal. Running xattr -l file lists all extended attributes, xattr -p com.apple.quarantine file prints only the quarantine value, and xattr -d com.apple.quarantine file removes it from a single item.
Removing the attribute recursively with xattr -dr com.apple.quarantine on an application bundle disables the first-launch check for that app. This is legitimate for software the administrator built or verified independently, but it is also a classic social engineering request in malware installers that tell users to paste the command to fix a supposedly damaged app.
- Prefer approving the app in Privacy & Security over stripping the attribute.
- Strip quarantine only from software whose source and integrity are verified.
- Use
spctl --assess --verboseto see how Gatekeeper would judge an app before deciding. - In managed fleets, deploy software through MDM or signed packages instead of manual workarounds.
Propagation, gaps and common misconceptions
Quarantine is meant to propagate to extracted content. Archive Utility copies the attribute from a downloaded ZIP to every file it expands, and installers inherit it from disk images. When an unarchiver or a file system fails to propagate or store the attribute, the extracted payload escapes Gatekeeper, and several patched macOS vulnerabilities have exploited exactly this kind of gap.
Storage formats also matter. Volumes formatted as FAT32 or exFAT cannot hold extended attributes natively, so macOS writes them to hidden AppleDouble files whose names begin with a dot and underscore; copying files through such media, or through some network shares and Git checkouts, can silently drop the marker.
A frequent misconception is that the attribute means a file is dangerous or infected. It only means the file came from an untrusted channel, and nearly every downloaded document carries it. Another is that removing it makes an app safer to run, when it merely removes the checkpoint that would have assessed it.
In everyday language
The quarantine attribute works like a sticker saying where a package came from. When a Mac downloads a file, the browser quietly attaches a label with the date and the app that fetched it.
The first time someone tries to open a labeled program, the Mac reads the sticker and runs a quick security inspection before letting it start. Peeling off the sticker does not make the package any safer; it only means nobody checks it at the door.
Seen in the real world
A help desk technician at a design studio receives a ticket: a freelancer reports that a newly downloaded font management app says it is damaged and cannot be opened. A forum post had advised running xattr -cr on the app, and the freelancer wants permission to do so.
The technician runs xattr -p com.apple.quarantine and sees the app came from a web browser, then runs spctl --assess --verbose, which reports a rejected, unnotarized build. Comparing the download URL from the quarantine events database with the vendor site reveals a lookalike domain. Instead of stripping the attribute, the technician deletes the app, installs the notarized version from the genuine vendor, and the studio avoids running a trojanized installer on a workstation that holds client files.