Repository navigation
Conversation
The agent runs shell commands without approvals, and OpenCode's rules limit only its file tools. In a test run, the agent searched the whole disk with find, read files in another repo, and read the ldcli access token with `ldcli config get`. On macOS, ldcli now starts OpenCode with sandbox-exec and a Seatbelt profile for each run. The sandbox applies to OpenCode and to every command that it runs. It denies the home folder, except the project, OpenCode's own folders, package caches, and toolchains. Other repos, ~/.config/ldcli, and ~/.ssh stay unreadable. System folders and the network stay open. The profile uses resolved paths, because Seatbelt matches the real path behind a symlink. OpenCode's rules also deny `ldcli` and `npx skills` now. Linux and Windows run without a sandbox for now. 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.
This runs the setup agent in a macOS sandbox. The agent runs shell commands without approvals, and OpenCode's rules limit only its file tools. In a test run, the agent searched the whole disk with
find /, read files in another repo, and read the ldcli access token withldcli config get.What changed
sandbox-execand a Seatbelt profile that it writes for each run. The sandbox applies to OpenCode and to every command that it runs.~/.gitconfigfor reading. IfXDG_CONFIG_HOMEis set, only itsopencodefolder opens. System folders and the network stay open./var/folders.ldcliandnpx skills.Linux and Windows run without a sandbox for now.
Testing
A macOS test runs real sandboxed commands with a fake home folder: they read and write in the project, and they get "Operation not permitted" for a fake ldcli config, an SSH key, and another repo's file. Other tests cover the profile order, quoting, and the install folder rule. The real OpenCode starts in the sandbox.
Stack
This is one of six PRs for the
ldcli setupagent. Review and merge them in order, after #877 (Go 1.26):They replace #876 and #878.
🤖 Generated with Claude Code