Repository navigation
Sonny: browser and desktop run only a copy no agent can swap - #654
Merged
Merged
Conversation
The browser and desktop tools ran agent-browser and agent-desktop from PATH outside the sandbox. The browser refused a program in a folder the calling agent writes; the desktop checked nothing, and neither checked the other agents' folders or a swap after the check (#614, and an external review). Now one resolver, sonny/src/trusted.rs, finds each program's native binary as before, and admits it before its first call and again whenever it or its copy changes: refused while it, or the folder its copy goes in, is in a folder some agent of the store writes (its workspace, its writable folders, and the temporary folders a workspace-write sandbox writes), else copied with the package's other native programs for this platform into ~/.agent/sonny/programs/NAME/. The tools run only that copy. An agent with no sandbox is not counted: it runs as the person. George chose the copy over checks alone. On macOS the copy is what is granted Accessibility and Screen Recording. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDM2LnoDcXYpJdFY7Y
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14931f746a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
From review: the copy was resolved once per call, before an acting call waited for its approval, so a copy swapped while it waited would run. Each command now resolves it as it starts; a swapped copy has new stamps, so it is admitted again, against the agents as they are then, and refused when one writes its folder. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDM2LnoDcXYpJdFY7Y
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGDM2LnoDcXYpJdFY7Y
lydakis
pushed a commit
that referenced
this pull request
Nov 2, 2026
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_013jkdGFQFsMWT3ryazYxU9H
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.
Closes #614 and does what the external review asked for: one resolver for trusted native programs, shared by
browseranddesktop.Before
Both tools ran agent-browser or agent-desktop from
PATH, outside the sandbox.browserrefused only a program inside a folder the calling agent writes.desktopchecked nothing.Now (
sonny/src/trusted.rs)native()finds the program onPATHas before: the first folder named from the root, then the native binary beside npm's launcher. This replaces the two copies offound()that browser.rs and desktop.rs each had.Pins::program()admits the program before its first call, and again whenever it or its copy changes. A change means a different device, inode, size, mtime or ctime on any of its files.writablefolders, and$TMPDIRand/tmp, which a workspace-write sandbox writes.~/.agent/sonny/programs/NAME/, together with the package's other native programs for this platform. That includes agent-desktop's macOS helper, which agent-desktop starts by name from its own folder.botsplusinspect, over the tool host's own connection, so calls from a linked machine are checked against this store too. An agent with no sandbox isn't counted, because it already runs as the person.Tests
trusted.rsunit tests:test_an_agent_desktop_any_agent_could_swap_is_never_run:/tmp. From inside/tmpit is now refused for a workspace-write agent, which is correct.cargo clippy -p sonny --all-targets -D warningsis clean.cargo test -p sonny: 998 pass. The one failure here,a_bot_is_given_sonnys_tools_beside_its_own_once, comes from agent-browser being installed in this container (seen before, and it passes in CI).