r/opencode • • 2d ago

Securing agents

Hey guys I have some kind of a problem and I want your ideas about this, I am running opencode in a VM for safety reasons and connecting to it thru ssh, the thing is that I want to secure the whole thing thus the IA model can't access the directories where the Linux user that runs opencode gets access, like I was testing something and one model tried to access the database from the very opencode app, thing that shouldn't be able to do, I know that I can grant access and other things in settings in json and other stuff but I haven't found any place where I can't restrict access to only one carpet, I want the thing to be able to run shells to do stuff like image processing or whatever but I don't want it to have the capability to mess with opencode configuration, I really hope I make sense, how you guys are dealing with this with opencode?

1 Upvotes

6 comments sorted by

2

u/Even_Command_5636 2d ago

Stay away from dangerous things like Opencode and LLMs!

1

u/Ornery_Season6039 2d ago

check git repo nolabs-ai/nono

1

u/tjimenez_591 14h ago

Does nono enforce filesystem access for spawned shell commands at the OS level? That's the key detail for this use case.

1

u/noa-salah_38 3h ago

Create a harmless canary that the OpenCode user can normally read outside the project, then check whether a shell child through Nono can read it.

1

u/Small-Host-3263 2d ago

Turn off ur global config in opencode

1

u/RiceEvening4211 2d ago

You're right to distrust the in-app permissions alone — treat the OS as the real boundary. Run opencode as a dedicated unprivileged user that only has read/write on that one project directory, and keep your database credentials and config files owned by a different user so the agent literally can't read them. Then use opencode's permission settings in opencode.json to deny edit and bash outside the project and require approval for anything destructive. That way even a confused model hits the filesystem wall first.