macos-accessibility

Automate macOS applications via AXUIElement APIs with TCC permission validation and security controls.

Updated May 11, 2026
One-click install
npx skills add https://github.com/cloudofgeorge/AI-hands-Engineer --skill macos-accessibility-cloudofgeorge
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: macos-accessibility
Source: https://github.com/cloudofgeorge/AI-hands-Engineer/tree/main/skills/engineering/domains/macos/macos-accessibility
Command: npx skills add https://github.com/cloudofgeorge/AI-hands-Engineer --skill macos-accessibility-cloudofgeorge

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pyobjc-framework-ApplicationServices, atomac, pyautogui, and includes references (resource) components.

What problem does it solve? Automating macOS desktop applications through Accessibility APIs is risky: missing TCC permission checks, spoofed bundle IDs, and accidental access to Keychain or security dialogs can compromise the system. This Skill provides a security-first framework for AXUIElement automation with enforced permission tiers, application blocklists, and audit logging. ## Core Features & Use Cases - TCC Permission Validation: Check and enforce Accessibility permissions before any automation, with graceful handling of permission denial. - Secure Element Discovery: Query AXUIElement hierarchies with blocked-application lists, code signature verification, and sensitive attribute redaction. - Permission-Tiered Actions: Enforce read-only, standard, and elevated tiers that restrict which AX actions and attributes are allowed. - Use Case: Build a Python automation script that reads window titles from a whitelisted app, verifies its code signature, logs every operation with correlation IDs, and refuses to touch Keychain Access or SecurityAgent dialogs. ## Quick Start Use the macos-accessibility skill to write a Python script that lists the frontmost application's window titles after validating TCC accessibility permission.

Frequently Asked Questions about macos-accessibility

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate macOS apps with the Accessibility API in Python?▼

Use pyobjc-framework-ApplicationServices to access AXUIElementRef, create application elements with AXUIElementCreateApplication, and query attributes via AXUIElementCopyAttributeValue. Always validate TCC accessibility permission with AXIsProcessTrustedWithOptions before any operation.

How do I check TCC accessibility permission programmatically on macOS?▼

Call AXIsProcessTrustedWithOptions with the kAXTrustedCheckOptionPrompt option to check whether the process has Accessibility permission. Set the prompt flag to true to show the system permission dialog, and raise an error directing users to System Settings if denied.

Which Python libraries work with macOS AXUIElement automation?▼

pyobjc-framework-ApplicationServices provides direct bindings to the AXUIElement APIs, atomac offers a higher-level wrapper, and pyautogui handles input simulation. All of them require Accessibility permission granted through TCC before use.

Why does macOS accessibility automation hang or stop responding?▼

AX calls can block indefinitely when target applications are unresponsive or sandboxed. Enforce timeouts on every operation, limit element tree search depth, cache elements with a TTL, and use retry logic with exponential backoff for transient AX errors.

What are the security risks of macOS accessibility automation?▼

Key risks include TCC bypass vulnerabilities, bundle ID spoofing, and unauthorized access to Keychain or security dialogs. Mitigate by verifying code signatures instead of trusting bundle IDs, blocking sensitive applications like SecurityAgent, and logging all operations for audit.