permissions
permissions
¶
macOS TCC permissions for dictation — three, each easy to confuse.
Dictation needs all three, granted independently PER PROCESS (the background LaunchAgent's Python binary does not inherit the terminal's grants):
- Input Monitoring — to hear the push-to-talk key (the event tap). A
listen-only keyboard CGEventTap is gated by this, NOT Accessibility.
AXIsProcessTrustedcan return True while the tap is starved because Input Monitoring was never granted — the "says trusted, does nothing" failure. - Microphone — to capture audio. macOS hands an unauthorized app SILENCE, not an error, so a starved mic looks like "you said nothing".
- Accessibility — to inject Cmd+V when pasting the transcript.
Input Monitoring lives in IOKit's IOHIDCheckAccess / IOHIDRequestAccess
(called via ctypes; PyObjC does not expose them); Microphone in AVFoundation;
Accessibility in ApplicationServices.
Functions:¶
input_monitoring_ok
¶
True when this process may observe keyboard events (Input Monitoring).
Fails safe as True when the check itself is unavailable (non-macOS, or the symbol is missing) so a non-Darwin run is not blocked spuriously.
Source code in src/diapason/desktop/permissions.py
request_input_monitoring
¶
Pop the macOS Input Monitoring prompt; return the resulting state.
Adds this app to Privacy & Security › Input Monitoring. The grant needs a toggle and a terminal restart to take effect.
Source code in src/diapason/desktop/permissions.py
microphone_ok
¶
True when this process may capture audio (Microphone).
The third TCC permission dictation needs, and the one that bites the background agent hardest: macOS hands a non-authorized app SILENCE rather than an error, so a starved mic looks exactly like "you said nothing".
Source code in src/diapason/desktop/permissions.py
request_microphone
¶
Trigger the macOS Microphone prompt (fires when status is undetermined).
Source code in src/diapason/desktop/permissions.py
accessibility_ok
¶
True when this process may inject events (Accessibility) — for paste.
Source code in src/diapason/desktop/permissions.py
request_accessibility
¶
Pop the macOS Accessibility prompt; return the resulting state.
Source code in src/diapason/desktop/permissions.py
open_pane
¶
Open the given Privacy & Security pane in System Settings.
Source code in src/diapason/desktop/permissions.py
missing_for_dictation
¶
Return the human names of permissions still needed, in order to grant.
All three: Input Monitoring (hear the key), Microphone (capture audio), Accessibility (inject the paste). Any one missing breaks dictation, and each is granted independently per process.