r/opencode • • Nov 01 '26

Best way to isolate OpenCode projects

Hey all,

I know this might be a basic question that gets asked a lot, but I'm still a beginner and my head is spinning a bit with all the options, so thanks for your patience! :)

I'm looking for the best way to completely isolate my OpenCode harness projects on Ubuntu.
(I use OpenChamber as GUI)

My goal is zero cross-contamination: no shared agent memory, no leaking coding styles, etc. Each project needs to be a total blank slate.

Some projects use Docker, others run natively. I need a solution that is simple to implement but reasonably secure.

What’s the cleanest move here? Messing with XDG env vars? Running the harness inside Docker containers? Or going nuclear with separate Ubuntu system users?

How do you keep your AI agents from bleeding into each other?

Thanks in advance for the support! :)

6 Upvotes

27 comments sorted by

View all comments

1

u/cenderis Nov 01 '26

I run opencode using a bubblewrap script which limits access to the current git checkout and read-only access to some other useful directories that I think will be helpful. (More or less, I add extra directories as necessary, some read-write.) That seems to have worked OK so far, together with opencode's normal permissions.

1

u/SirSpix Nov 02 '26

Thanks! Bubblewrap is great for zero overhead.

My projects run Docker internally, though, and nesting Docker inside Bubblewrap sounds like an headache...? Am I wrong?

2

u/sudoer777_ Nov 02 '26

I think it depends on how your project is set up, but would giving it access to docker.sock and the corresponding CLI tools be enough (which lets it control the Docker engine)?