Monday, May 12, 2025

Pasteboard Privacy Preview in macOS 15.4

Apple (via Jeff Nadeau):

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. New detect methods in NSPasteboard and NSPasteboardItem make it possible for an app to examine the kinds of data on the pasteboard without actually reading them and showing the alert. NSPasteboard also adds an accessBehavior 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 command defaults write <your_app_bundle_id> EnablePasteboardPrivacyDeveloperPreview -bool yes to enable the behavior for your app.

The Swift and Objective-C APIs are different.

Miguel Arroz:

Long ago when I was still at Apple I filed a radar suggesting something like this when I found out the Facebook iOS app would look into the pasteboard as soon as it was brought forward and suggest posting any URL the user might have there.

This is incredibly hard to get right since there’s no straightforward way for the OS to know if a paste op is legit.

Previously:

2 Comments RSS · Twitter · Mastodon


I understand that reading the clipboard is a potential privacy leak, but for me the iOS notifications are the native app equivalent of cookie notices. Annoying friction that snaps me out of what I'm trying to do.


Here's a thought: allow us to decide which apps trigger this notification. Make it opt in, or at the very least opt out.

That's the sort of thing Apple would do if they were thoughtfully designing their OS, and were operating under the assumption that a computer is owned by you, and you should make decisions about how it works. Neither is true; they are evidently thoughtless, and as far as they're concerned, *they* own your computer, even though you paid money to purchase it from them.

Leave a Comment