You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have started to do a bit of research on how there could be limitations put in place on what tools and commands are allowed to do during execution.
I'm still very new to the code-base so will probably miss obvious things, but here we go.
I'm thinking of implementing a interface that would run tools within a security-context. bubblewrap would be used on linux.
This would be configured on a per agent-basis similar to the current permissions part, but with a lot more control.
When launching anything it would then run in a context that could be locked down to just the content it's allowed to touch. We can set per-folder read/write permissions and prevent it from even reading files outside the project-root or even prevent a agent from doing any network-communication, like curl.
A documentation-agent could then be configured similar to:
then even the test-script.sh would not be able to execute anything not included in the allowedExecutables or write outside of the specified writablePath's.
This is just a initial concept that i would like some feedback on before writing any code.
Is there a way to sandbox the agent ? #2242: Is there a way to sandbox the agent? - asks about restricting terminal commands and file access outside the current directory, mentions seatbelt and similar sandboxing tools
@redtux: does this allow OpenCode to use Wayland and the GPU?
Hi @tredondo, I am using Wayland and it works. What exactly do you mean regarding GPU? I am using AMD Ryzen Pro 7 with Ollama and ROCm, and this works fine - in case you're referring to this. Anything else I don't know how to test, but I also don't know why it should be restricted in the first place. If you can give me some hints, I'll be happy to test it.
Just in case: In other threads there are suggestions for more ways of sandboxing that might be better tested. This here was just some kind of POC to show that the same kind of abstraction and security that Claude Code offers can be realized with little to none efforts or special skills…
libEGL warning: failed to open /dev/dri/renderD128: Permission denied
libEGL warning: failed to get driver name for fd -1
libEGL warning: MESA-LOADER: failed to retrieve device information
libEGL warning: pci id for fd 34: 10de:25a0, driver (null)
pci id for fd 35: 10de:25a0, driver (null)
kmsro: driver missing
libEGL warning: egl: failed to create dri2 screen
pci id for fd 35: 10de:25a0, driver (null)
Activity
github-actions commentedon Nov 23, 2025
This issue might be a duplicate of existing issues. Please check:
exectool as more secure alternative to bash tool #2206: [FEATURE] addexectool as more secure alternative to bash tool - proposes a secure alternative to bash that prevents shell operators and discusses broader sandboxing solutionsFeel free to ignore if none of these address your specific case.
redtux commentedon Dec 3, 2025
Hi @pakar, I solved this by using a slightly modified script from what I suggested in #2242 (comment).
The script is using Nix and Devbox but you can update it to your needs. Maybe this helps!
tredondo commentedon Feb 17, 2026
@redtux: does this allow OpenCode to use Wayland and the GPU?
redtux commentedon Feb 18, 2026
Hi @tredondo, I am using Wayland and it works. What exactly do you mean regarding GPU? I am using AMD Ryzen Pro 7 with Ollama and ROCm, and this works fine - in case you're referring to this. Anything else I don't know how to test, but I also don't know why it should be restricted in the first place. If you can give me some hints, I'll be happy to test it.
Just in case: In other threads there are suggestions for more ways of sandboxing that might be better tested. This here was just some kind of POC to show that the same kind of abstraction and security that Claude Code offers can be realized with little to none efforts or special skills…
tredondo commentedon Feb 18, 2026
@redtux I have an NVidia laptop GPU and had to add the following parameters (thanks Claude) for OpenCode to be able to use it:
Otherwise I'd get error like:
redtux commentedon Feb 18, 2026
Ah, I see - well, I don't use Nvidia due to their proprietary drivers… so I can't test it, sorry. :)
github-actions commentedon Apr 20, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.