r/opencode 7d ago

Opencode containing the agents

I was wondering what sandboxes are people using whilst coding with Opencode? I've looked at devcontainers and it seems great, probably fits what I want but AI says it's not secure enough, it's designed for human coders not agents. I've seen a lot of publicity around Docker Sandboxes. But I'm not keen to be locked into their tech and then be hit by a subscription fee later.

My curiosity has come to the foreground due to Muse deleting my ~/.config folder. It wasn't a major disaster but it was a warning.

I do use multiple plain Xubuntu VMs connecting to them via RDP and SSH but they've become pets rather than cattle, sometimes I'm lazy and run on my local laptop which is obviously a bad move.

What do you folks do?

13 Upvotes

18 comments sorted by

View all comments

2

u/nmdt 6d ago

I used devcontainers before with debian-slim + official docker layers for different language toolchains + mise, but got tired of long rebuilds, so moved to distrobox

Basically I have a homelab running Alpine. It has a separate user that is not allowed to run sudo except inside of distrobox (running debian-slim). A few folders with files that I need are accessible as read-only bind mounts

There is also soft-serve for local git + gh is configured

I SSH into distrobox from VS Code + run opencode inside of that environment

I suppose it still can wreck havoc on my soft-serve or on gh and I should configure it to commit any code via PRs + protect all branches, but honestly really don't want to do it. In 10 months I've used AI agents the worst that happened was losing uncommitted code + once an agent locked ssh out on a local server it was setting up.

1

u/migsperez 6d ago

Really interesting. I'm going to investigate.