Apple has a change in the works to pasteboard (the internal clipboard) in macOS that will prevent Mac apps for secretly reading the pasteboard without notifying the user, according to information Apple has shared with developers.
In macOS 16, users will be alerted when a Mac app reads the pasteboard without specifically being spurred to do so by direct user interaction. This will prevent apps fro being sneaky and viewing the information you’ve copied and pasted.
macOS pasteboard privacy
- Prepare your app for an upcoming feature in macOS that alerts a person using a device when your app programmatically reads the general pasteboard. The system shows the alert only if the pasteboard access wasn’t a result of someone’s input on a UI element that the system considers paste-related. This behavior is similar to how
UIPasteboard
behaves in iOS. Newdetect
methods inNSPasteboard
andNSPasteboard
make it possible for an app to examine the kinds of data on the pasteboard without actually reading them and showing the alert.Item NSPasteboard
also adds anaccess
property to determine if programmatic pasteboard access is always allowed, never allowed, or if it prompts an alert requesting permission. You can adopt these APIs ahead of the change, and set a user default to test the new behavior on your Mac. To do so, launch Terminal and enter the commandBehavior defaults write <your
to enable the behavior for your app._app _bundle _id> Enable Pasteboard Privacy Developer Preview -bool yes
Mac users will not be alerted when performing a direct pasteboard-related action, such as copying and pasting text within an app that supports the function. Instead, users will be notified if an app attemot to access the pasteboard data when the paste feature has not been used.
Apple says the macOS pasteboard will operate similarly to the pasteboard in iOS going forward. In iOS and iPadOS, Apple prevents apps from looking at the pasteboard without user consent. Apple made the change in iOS 14, after security researchers discovered that numerous popular apps were accessing the pasteboard without user consent.
iOS 14 added a banner that notifies users when an iOS app sccesses the clipboard. Then in iOS 15, Apple debuted a secure paste option that blocks apps from viewing the clipboard completely unless the user copies something from one app and pastes it into the app they are actively using.
In macOS 16, Mac developers will be able to examine the kinds of data on the pasteboard without actually reading the data. Any pasteboard data used with the iOS 16 API won’t show the alert to end users.