Our app uses an active CGEventTap (kCGEventTapOptionDefault, mouse down/up events) and relies on the Accessibility permission (Device Control & Data Access).
CGEventTapCreate(kCGAnnotatedSessionEventTap,
kCGHeadInsertEventTap,
kCGEventTapOptionDefault,
CGEventMaskBit(kCGEventLeftMouseDown) | CGEventMaskBit(kCGEventLeftMouseUp) |
CGEventMaskBit(kCGEventRightMouseDown) | CGEventMaskBit(kCGEventRightMouseUp) |
CGEventMaskBit(kCGEventOtherMouseDown) | CGEventMaskBit(kCGEventOtherMouseUp),
callback, refcon);
On macOS 27.0.1 we see two behaviours when that permission comes from MDM, and we’d like to know whether they’re expected.
According to the PrivacyPreferencesPolicyControl.Services documentation, the PPPC Accessibility key is deprecated in macOS 27. It’s replaced by the Privacy → PermissionDefaults setting in the declarative configuration com.apple.configuration.app.settings, and the managed value is a default that the user can change. We tested both the PPPC payload and the DDM configuration.
1. Managed Accessibility grant doesn’t cover PostEvent
When the user turns on Accessibility manually in System Settings > Privacy & Security > Accessibility, the event tap works with no further prompts.
When Accessibility comes from device management (a PPPC payload or DDM PermissionDefaults):
AXIsProcessTrusted()returns true.- On the first click through the tap, macOS shows the “control this computer” prompt.
- tccd adds an access row for
kTCCServicePostEventwith auth_value 0 and auth_reason 4. - At the same moment, the app’s Accessibility toggle in System Settings switches off. The managed Accessibility row remains auth_value 2, auth_reason 6.
- After the user accepts the prompt, PostEvent changes to auth_value 2 and the tap works from then on.
Questions :
- Why does a manual Accessibility grant cover an active event tap, while a managed Accessibility default needs a separate PostEvent grant?
- With PPPC
Accessibilitydeprecated, is DDMAccessibilityplus PPPCPostEvent(Allowed) the intended configuration for apps that install active event taps?
2. Stray managed_overrides row after unenrollment
On macOS 27, the managed Accessibility value is stored in a new managed_overrides table in /Library/Application Support/com.apple.TCC/TCC.db (schema version 36). On macOS 15 and 26, managed grants were kept in MDMOverrides.plist, and this table doesn’t exist there.
Steps :
- Enroll a never-managed Mac in MDM with user-approved enrollment.
- Install a profile that grants Accessibility to our app. tccd logs ManagedSettings: inserted managed_overrides for kTCCServiceAccessibility:<bundle id> admin_auth_value=2 auth_value=2. The row is written with policy_id NULL, and policies and active_policy stay empty.
- Remove the MDM profile from System Settings > General > Device Management.
What happens:
- mdmclient removes the MDM profile first. Removing each TCC payload after that fails with :
PlugIn: DetermineUninstallFlags [TCCProfileService] Error: Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied" UserInfo={NSLocalizedDescription=The profile must originate from a user-approved MDM server.}
- The profiles disappear,
MDMOverrides.plistis deleted, and profiles status reports no MDM enrollment. - The row remains, with auth_value 1, auth_reason 6 (MDM Policy), policy_id NULL, admin_auth_value 2 and flags 480.
tccutil reset Accessibility <bundle id>clears flags but doesn’t remove the row.- Later permission prompts and System Settings toggles for the app write to this row instead of to access.
Why does the row stay after unenrollment? Is there a supported way to clear it?