Repository navigation
fix(computer): a macOS app granted screen capture is approved ahead by its bundle's file URL too - #560
Merged
earakely-scale merged 4 commits intoNov 9, 2026
Conversation
…y its bundle's file URL too An app's first direct capture still asked "to bypass the system private window picker": macOS keys that approval by the app's file URL, and hints again once kScreenCapturePrivacyHintDate passes, and the grant wrote neither. In the background that prompt takes the user's focus, as Codex Computer Use's helper did on Cua Driver Bench. The grant now records the approval under the file URL too, with a privacy hint as far off as the approval, for every client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n as Foundation writes it file_url percent-encoded every byte but letters, digits and "/._~-", where Foundation keeps "!$&'()*+,:=@" as they are, and bash 3.2's printf wrote a byte past ASCII as %FFFFFFFFFFFFFFC3; an app whose path held one was approved under a key macOS never reads, so it asked again. Now it keeps Foundation's set, encodes every other printable ASCII character, and fails on any other byte, since Foundation decomposes such a character first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
earakely-scale
deleted the
edgararakelyan/fd-5358-macos-app-capture-approval
branch
November 9, 2026 16:38
earakely-scale
added a commit
to earakely-scale/agentenv-cua-driver-bench
that referenced
this pull request
Nov 9, 2026
That release approves the driver's helper app's screen capture ahead under the key macOS reads (scaleapi/agentenv-framework#560), so macOS's prompt to bypass the private window picker doesn't take the user's focus in a background trial. Co-Authored-By: Claude Opus 5.5 <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
On a macOS computer, an app granted
screen_capturestill showed macOS's prompt "'X' is requesting to bypass the system private window picker and directly access your screen and audio" on its first direct capture. In the background, that prompt takes the user's key focus, so every background trial whose driver captures through its own helper app fails the bench'suser_undisturbedcriteria.lib.sh's grant writes the TCC row and records an approval inScreenCaptureApprovals.plistahead of time. The approval was missing two things:file:///opt/agentenv/codex-computer-use/Codex%20Computer%20Use.app/. The grant wrote only the bundle identifier.kScreenCapturePrivacyHintDatepasses, and the grant never set one.Now a screen capture grant records the approval under the client TCC knows the program by, and for an app under its bundle's file URL too. Each entry sets
kScreenCapturePrivacyHintDateandkScreenCapturePrivacyHintPolicyas far off as the approval. Executables keep a single key, their path.How the key was found. In a composed
macos-26computer withcodex-computer-useon our Mac host:ScreenCaptureApprovals.plistheldcom.openai.sky.CUAServicewith onlyLastAlertedandLastUsed;file:///opt/agentenv/codex-computer-use/Codex%20Computer%20Use.app/withkScreenCapturePrivacyHintDateandkScreenCapturePrivacyHintPolicy(30 days);Cua Driver Bench's Codex Computer Use arm (earakely-scale/agentenv-cua-driver-bench#1) hit this in its smoke trials: its background trials failed
key_focus,window_raised,typingandactivationwhile their tasks passed.The VM bundle's compose key covers
lib.sh's folder, so existing composed computers compose afresh with the fix.Testing
tst/unit/env/envs/test_computer_macos_grants.pysourceslib.shin bash with macOS's tools stood in for. An app's screen capture grant writes the approval under its identifier and its bundle's file URL, with the privacy hint. An executable's writes one, under its path. Other services write none. The file URL is written as Foundation'sNSURL fileURLWithPathwrites it: a test pins Foundation's table for every printable ASCII character, and a path past ASCII fails rather than writing a key macOS never reads. I checked the encoder against Foundation on macOS for all 95 characters under bash 3.2, the VM's bash, with no mismatch.test_disk_recipe.py, which fails the same way onmainon macOS.window_raised, from the apps' and Codex's own windows rising above the user's./Applications/CuaDriver.app), so it gets the new key. I reran six of its published background trials (IR-01 to IR-03, runs 1 and 2) on this PR's head, Sonnet 5.5, on our Mac host:window_raisedfailure.window_raisedfailure, on a different trial.key_focus,typingandactivationheld in every trial, as before.🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no new actionable issues remain.Summary
Screen-capture grants now record approvals under an app’s identifier and bundle file URL, with matching privacy-hint fields.
Reviews (5) · Last reviewed commit: "test(computer): a bundle path past ASCII..." · Reviewed by Greptile