feat: add experimental system-wide API key masking via Accessibility overlay#10
Merged
easyvibecoding merged 2 commits intomainfrom Mar 21, 2026
Merged
feat: add experimental system-wide API key masking via Accessibility overlay#10easyvibecoding merged 2 commits intomainfrom
easyvibecoding merged 2 commits intomainfrom
Conversation
…overlay Add system-wide masking that detects API keys in any macOS application using the Accessibility API and covers them with floating NSPanel overlays. Core implementation: - SystemMaskingService: AXObserver monitors focused UI elements across all apps via kAXFocusedUIElementChangedNotification and kAXValueChangedNotification. 10ms initial / 30ms debounce + 500ms polling fallback. Immediate scan on app switch. - AXBoundsForRange: precise multi-line text coordinate calculation, supports keys spanning multiple visual lines - SystemOverlayController: click-through NSPanel overlays with ignoresMouseEvents, reuses panels via deterministic UUID per match - MaskOverlayView: solid background overlay with masked text display Integration: - Settings toggle: "System-wide masking (experimental)" in Security tab, default OFF. Only activates when both setting AND Demo Mode are ON. - Peek mode: hold ⌃⌥Space to temporarily hide all overlays - Overlay lifecycle: auto-clear on app switch, text change, Demo Mode OFF Performance (measured): - Pattern matching: 0.1-0.3ms per scan - Total scan + overlay: 2-6ms - NSHostingView reuse prevents view accumulation - Text cache prevents redundant overlay updates - Safe AX API usage: nil guards, isRunning check in callback Known limitations (marked experimental): - Only scans focused element (sidebar/non-focused areas not covered) - Copy/paste still exposes original key (visual overlay only) - Some apps may not fully support AX text attributes Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Document ScreenCaptureKit + Virtual Camera approach as a more secure alternative to the overlay method. Includes architecture, code examples, lessons learned from overlay implementation, and suggested contribution order. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Known Limitations
Test plan
swift build+swift test— 48 tests pass🤖 Generated with Claude Code