Ledge

How macOS sandboxing protects your files

Every app you open on a Mac wants something. A photo editor wants your pictures, a note taker wants a place to save text, a download manager wants to reach the network. The question macOS quietly answers on your behalf is how much of the rest of the machine each of those apps gets to touch. Sandboxing is the answer, and once you understand the shape of it, a lot of the permission prompts you click through start to make sense.

What the App Sandbox actually is

The App Sandbox is a fence macOS builds around a running app. Inside the fence the app can do its job. Outside it, the system says no. By default a sandboxed app can read and write only inside its own container, a private folder created just for that app, and nowhere else. It cannot wander into your Documents folder, read your Desktop, or open another app’s files, unless it has been granted a specific reason to.

That default matters because an app is not just the code its author wrote. It is also whatever that code pulls in, and whatever a bug might let a stranger do with it. If an app is compromised, the sandbox is the wall that keeps the damage inside the app’s own container instead of spreading across your files. The fence is enforced by the operating system kernel, not by the app being polite about it, so a misbehaving app cannot simply decide to ignore the rules.

Apps distributed through the Mac App Store are required to run in this sandbox. Apps you download directly from a developer may or may not be sandboxed, which is one reason the origin of an app is worth a moment of thought before you install it.

How an app earns access to your files

A fence with no gates would make most apps useless, so the sandbox has controlled openings called entitlements. An entitlement is a specific permission the developer declares in advance and Apple records in the app’s signature. One entitlement lets an app read files you explicitly open. Another lets it reach the network. Another lets it use the camera. The app cannot grant these to itself at runtime; they are baked in when the app is built and signed, and you can inspect them.

On top of entitlements sits the part you see every day: the consent prompts. When an app first tries to reach your Photos, your Calendar, or a folder like Downloads, macOS stops and asks you. This is the TCC system, short for Transparency, Consent, and Control. The app declared it might want the camera; TCC makes sure you actually agreed before the camera turns on. The two layers work together. Entitlements set the outer limit of what an app could ever ask for, and TCC decides, case by case, whether you say yes.

There is also a gentler path for file access called powerbox. When a sandboxed app shows you an open or save dialog, the file you choose is handed to the app through the system, and only that file. The app never sees the rest of the folder. You granted access by picking the file, which feels natural and requires no scary prompt at all.

Reading the prompts without fear or blind clicking

Most people learn to click through permission prompts on autopilot, which defeats the point of having them. A better habit is to read the prompt as a sentence and ask whether it fits the app in front of you. A drawing app asking for the microphone is worth a pause. A voice recorder asking for the microphone is exactly what you expect.

It helps to know that saying no is rarely fatal. If you deny a permission and later decide the app needs it, System Settings has a Privacy and Security section where every category, from Files and Folders to Full Disk Access, lists the apps that asked and lets you flip each one on or off. Nothing is permanent. Denying by default and granting only when an app clearly needs it is a reasonable stance, and the system is built to support it.

The one prompt that deserves real caution is Full Disk Access. That permission steps outside the normal sandbox and hands an app the ability to read almost everything, including other apps’ private data. Backup tools and some developer utilities have a genuine reason to ask. Most apps do not, and an app that requests it without an obvious cause is worth questioning.

What this means when you install something new

The sandbox is one of the reasons a Mac can run software from many different authors without any single app being able to quietly rummage through your whole life. When you install something, three quick checks tell you most of what you need to know. Is it sandboxed. What entitlements does it declare. What does it actually ask for when you use it, and does that match what it does.

An app built to respect the sandbox tends to ask for as little as possible and only at the moment it needs it, rather than demanding everything at launch. Ledge, which turns the notch at the top of your screen into a shelf you can drop files onto, asks for nothing to open and requests Accessibility only when you first want it to paste a file path straight into a terminal. That is the pattern to look for in general. Permissions requested late, tied to a feature you just used, and easy to trace back to a reason.

Sandboxing will never make careless installs safe, and it is not meant to. What it does is turn the Mac from a place where any app can reach anything into a place where access is deliberate, visible, and yours to revoke. Understanding the fence is the difference between clicking prompts blindly and actually deciding what each app on your machine gets to see.