r/opencode • • 29d ago

So the default permissions of OpenCode Desktop is to allow everything but external_directories?

I started a chat session and asked for an investigation into a minor issue within my project’s authentication system, requesting a report on the findings.

Upon reviewing the results, I was taken aback to see references to production CloudWatch and RDS instances—even though the intent was simply to test the application's behavior in a production-like environment by making HTTP requests. Looking closer at the tool calls the agent had executed, I realized it had used my AWS credentials to access CloudWatch; it even went so far as to run SSM to set up port forwarding from a bastion host to the production database, where it proceeded to inspect refresh token data...

Naturally, I was quite alarmed, so I checked the OpenCode configuration files within my NixOS setup. I hadn’t configured any specific permissions—that was my oversight—but it’s worth noting that, prior to V2, this had never occurred with either the CLI or the desktop version.

Note: translated with google translate

5 Upvotes

6 comments sorted by

1

u/lincolnthalles 29d ago

V2 uses a minimal system prompt, allowing models to do things mostly based on their training. They also loosened the default external_directory permissions not long ago.

You can tighten it back, but note that external_directory only governs harness tools. It doesn't gate system shell calls. The only way to do that is to sandbox the agent somehow, or enforce shell permissions (like blocking cat and any variants that can read files), which I don't recommend as it causes a huge amount of friction.

I suggest that before you do anything drastic, try adding a rule in the global AGENTS.md stating that the agent must respect the active sandbox and permission model, explicitly asking for permissions to reach outside the current project scope. Most models will abide as long as the instructions are clear.

OpenChamber (a much better alternative to OpenCode Desktop) has Safety Net, which uses Jev to decide and auto-approve if tool calls are routine, asking you if anything seems out of scope.

1

u/Jubileu_McGrath 29d ago

right now im putting some default permissions that i feel safe on opencode.json

0

u/[deleted] 28d ago

[removed] — view removed comment

1

u/Jubileu_McGrath 28d ago

Tbh I never asked it to run aws commands, it just came out with this idea without telling me