This is a walk down that stack, from the silicon up. What each layer actually enforces, what it deliberately does not, and where the seams between layers are — because that is where the interesting bugs live.
No single shield — a chain of independent controls
Read macOS security bottom-up and a pattern emerges. Every layer answers a different question, and no layer is asked to answer two of them. The hardware answers can I trust this code to hold keys? Secure Boot answers did the operating system that started come from Apple, intact? Code signing answers who made this binary, and has it changed since? Gatekeeper answers may this new program run for the first time? The sandbox answers if it runs, what can it reach? TCC — Transparency, Consent and Control — answers did the user agree to it touching this specific thing?
That separation is the design. A valid signature does not imply a program is benign. A TCC grant does not validate what an app does with the data afterwards. A sandboxed app is not automatically trustworthy, and an unsandboxed one is not automatically malicious.
The one-sentence version: each layer catches what the layer before it cannot — Secure Boot starts only an Apple-signed system, SIP and the seal keep that system read-only even for root, Gatekeeper judges new code at first open, the hardened runtime and sandbox confine it while it runs, TCC asks before it touches your data, and FileVault makes the disk unreadable without you.
Layer 0 — Boot ROM & Secure Enclave
The chain starts in code that cannot be changed. The Boot ROM is mask-programmed into the chip at manufacture and contains Apple’s root certificate authority key. Because it is immutable, it is the one piece of the system that does not need to be verified by anything else — it is the verifier. Everything booted after it is checked against it, stage by stage.
Beside the main processor sits the Secure Enclave: a separate, hardened coprocessor with its own boot chain, its own encrypted memory, and a hardware unique ID fused into it that even Apple does not record. Keys are generated and used inside the Enclave and are designed never to leave it in usable form.
Layer 1 — Secure Boot & LocalPolicy
On Apple silicon there is no single global “secure boot on/off” switch. Each installed macOS has its own LocalPolicy: a signed policy object, authorised by the owner identity held in the Secure Enclave, stating how strictly that particular installation must be verified. That is why the same machine can run one volume at Full Security and another at Reduced Security.
The practical consequence for research: boot policy is a per-install, owner-controlled decision, changed from recoveryOS — not from a booted system. Malware running as root in a normal session cannot quietly lower it.
Layer 2 — SSV & SIP
Since macOS 11, the system does not boot from the volume you see. It boots from a cryptographically sealed snapshot of it. Every file on the system volume is hashed, those hashes form a tree, and the root of that tree — the seal — is signed by Apple and verified at install, at update, and at boot. Change one byte in one system file and the seal no longer matches.
System Integrity Protection (SIP) is the complementary half: a mandatory access control policy enforced by the kernel on every process — sandboxed or not, root or not. Protected locations such as /System, /usr, /bin and /sbin can only be modified by Apple-signed processes carrying specific entitlements.
SIP stops writes; the seal detects them. Neither replaces the other.
Layer 3 — APFS & FileVault
On Apple silicon and T2 machines the storage is encrypted whether or not FileVault is on, with keys handled by the Secure Enclave. Turning FileVault on changes the key hierarchy: release of the volume key becomes bound to a user’s login password, entangled with the hardware unique ID inside the Enclave. Now a powered-off Mac is genuinely closed — the disk moved to another machine is ciphertext, and offline password guessing is throttled by the Enclave rather than by an attacker’s GPU farm.
What FileVault does not do is just as important: once the volume is unlocked and a session is running, it offers no protection at all. It is a control for data at rest, and it should never be cited as a defence against malware in a live session.
Layer 4 — Code signing & AMFI
Unix traditionally asks only whether a file has its execute bit set. macOS asks a harder question: who signed this code, and is what is about to run bit-for-bit what they signed? On Apple silicon the point is absolute — native code must carry at least an ad hoc signature to execute at all.
Apple Mobile File Integrity (AMFI) is the subsystem that turns signing policy into kernel decisions: whether an executable may run, whether a page of code is valid, whether dynamic code is acceptable, and whether a process holds an entitlement it claims. When researchers talk about a “code signing bypass”, they usually mean a gap between what AMFI believes about a process and what is actually running.
$ codesign -dvvv --entitlements :- /Applications/Example.app
$ codesign --verify --strict --verbose=4 /Applications/Example.app
Layer 5 — Gatekeeper & XProtect
Apple describes Mac malware defence as three distinct jobs: prevent launch, block execution, and remediate what already ran. Three different mechanisms do those jobs, and conflating them is the most common error in casual macOS security writing.
At first open of a quarantined app, Gatekeeper checks the Developer ID signature and whether the software was notarized. Notarization is an automated submission to Apple: the software is scanned for known malicious content, and Apple issues a ticket. It is explicitly not App Review; nobody at Apple judged what the program does, only that it was not known malware when submitted.
XProtect is the built-in signature-based layer: YARA rules, updated separately from operating system releases, applied when an app first launches, when an app changes on disk, and when the rules themselves update.
The honest limit: a signed, notarized app can still be vulnerable, still be sold to a bad owner, or still abuse permissions the user grants it. Gatekeeper establishes provenance and known-clean status at submission time. It does not certify intent.
$ spctl --assess --verbose /Applications/Example.app
Layer 6 — Sandbox & TCC
A sandboxed app carries the com.apple.security.app-sandbox entitlement and runs under a Seatbelt profile enforced by the kernel. By default it can reach its own container and very little else: not your Documents, not other apps’ data, not most of the system.
TCC — Transparency, Consent and Control — guards a different set of things entirely: whether this app may touch this protected resource — camera, microphone, screen recording, accessibility control, contacts, calendars, location, and the Desktop, Documents and Downloads folders. Decisions are recorded per app, keyed to its code identity, in a protected database managed by the tccd daemon.
Read together, the layers explain most real-world outcomes. A process running as your user, unsandboxed, with a Full Disk Access grant, can read almost everything you can — not because any layer failed, but because each layer was asked its own question and answered yes.
Layer 7 — XNU & Endpoint Security
At the centre sits XNU, the hybrid Mach/BSD kernel. Historically, third-party drivers ran inside it as kernel extensions, where a bug in a vendor’s network driver was a kernel bug. Apple’s direction for a decade has been eviction: DriverKit, Network Extension, and Endpoint Security move that code into user-space system extensions — separately signed, entitlement-gated, individually revocable, and crash-contained.
Endpoint Security is the sanctioned observation point that replaces the old kernel hooking free-for-all. Entitled clients — the framework behind most Mac EDR products — subscribe to structured events about process execution and file operations. Endpoint Security itself is not an antivirus: it is a controlled API, gated by entitlement and user approval, through which security products watch the layers above it.
Layer 8 — Network & updates
The top layer is operational. The application firewall controls incoming connections per app; network extensions provide per-app and system content filtering without kernel code; and Lockdown Mode offers an extreme, opt-in profile for the small number of users facing targeted, sophisticated attack.
Management is part of the security model, not an add-on. MDM can enforce FileVault, firewall, Gatekeeper policy, PPPC decisions, and update timing. Declarative management and Background Security Improvements, introduced in macOS Tahoe 26.1, let Apple deliver security fixes and configuration faster than a full operating system release cycle.
Updates deserve emphasis because they are the layer every other layer depends on. The sealed system, XProtect content delivered apart from the OS, and notarization revocation all exist so that a fix, once shipped, actually displaces the vulnerable state — and cannot be quietly rolled back by an attacker who has already gained a foothold.
Verify it yourself — read-only, nothing weakened
$ csrutil status # SIP
$ spctl --status # Gatekeeper
$ fdesetup status # FileVault
$ systemextensionsctl list # system extensions, not kexts
$ codesign -dvvv --entitlements :- /path/to/binary
TCC has no command-line read — check it in System Settings → Privacy & Security instead.
Every layer in this piece leaves a checkable artefact like those above. That, in the end, is the most Unix thing about the whole design: for all its signed policies and sealed volumes, macOS still expects an administrator who can open a terminal and ask the machine what it believes — and who knows that the answer is only trustworthy if they also know which layer produced it.