Repository navigation
Host: run as an app's own helper; name each call's agent; refuse input to System Settings - #246
Merged
Merged
Conversation
…ols, --overlays, --confirm-stdio), and name each call's agent An app that runs agents itself, such as AIDE, starts the host as its child so macOS charges the host's Accessibility and Screen Recording use to the app. These flags let it serve that one app: admit only its signed client, refuse input to the app's own windows, exit with it, print the tool contract, draw the agent cursor and window outline, and ask the app to confirm agent-supplied passwords over stdio. A request may name its agent (key, name, kind), so one client serving many agents gets a cursor and outline per agent. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ord prompts (SYSTEM_UI_REFUSED); document the helper mode Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…so the contract check passes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
iamnbutler
marked this pull request as ready for review
November 13, 2026 01:04
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.
AIDE runs desktop-tools' host as its own child process ("Computer Use"), so macOS charges the host's Accessibility and Screen Recording use to AIDE: one row in System Settings, no second app to approve (tccd log:
AttributionChain: responsible=com.iamnbutler.aide … requesting=com.iamnbutler.aide.computer-use). Until now AIDE carried this as a patch; this PR moves it upstream so AIDE can pin a plain commit. Documented in docs/embed.md, "Run the host as an app's own helper".Host flags (
desktop-tools-host)--client <team>:<identifier>: serve only that signed client, by the peer's audit token.--protect <pid>: refuse agent input whose target is that process (SELF_TARGET_REFUSED), whether or not a caller handler is set. The embedding app guards its own prompts, so the on-screen own-window check applies only while caller approval is enforced (an app with a main window always has one open).--parent <pid>: exit when that process does.--tools: print{tools, instructions}and exit, so the app's tool list can't drift from the code.--overlays: draw the agent cursor and window outline, through the runtime (DesktopTools), as the menu bar app does.--confirm-stdio: ask the app to confirm agent-supplied passwords over stdout/stdin ({"confirm": id, "request": …}/{"answer": id, "allowed": bool}). The request now also carriesagent,agent_name,appandweb_host, so an app can word its own question.With
--overlaysor--confirm-stdiothe host serves through the runtime, so the client must be signed by the host's own team.A request can name its agent
{"id", "tool", "arguments", "agent": {"key", "name", "kind"}}. One client serving many agents (AIDE: every thread's call comes from AIDE's process) now gets a cursor and outline per agent, named and colored for it, and the password confirmation names the agent.Hooks.CallandHooks.TargetWindowcarry it;Hooks.showPointerruns the pointer hook inside the call's task-local so the hook can read it.SYSTEM_UI_REFUSED
Every host refuses agent input to System Settings and to the system's permission and password prompts (UserNotificationCenter, SecurityAgent, LocalAuthentication UI, coreautha, loginwindow). A Privacy & Security switch, Allow on a "would like to control this Mac" prompt, or an administrator password would give an agent more than the user did. Opening, reading, hiding and quitting still work.
desktop_system_keyis refused while one of them is frontmost.The whole of System Settings, not only Privacy & Security, because the pane can't be told apart reliably: its titles are localized (on macOS 27 the Accessibility list is titled "Device Control and Data Access"), subpanes share titles with top-level panes (Accessibility), and the sidebar builds the selected row's button only while it's scrolled into view (checked by inspecting System Settings on this Mac).
Tests
swift test: 58 + 32 pass, including newAgentIdentityTests(named agent wins, kind picks the color, key per thread) andSystemUITests. Live verification through AIDE is in progress and will be added here before this leaves draft.🤖 Generated with Claude Code