AI coding agents like OpenCode are powerful because they can read files, edit code, run commands, install packages, and access the internet. That also means you should think about what happens if the agent makes a mistake or executes something you didn't expect. Start with OpenCode permissions For a basic setup, use OpenCode's permission system: { "$schema": "https://opencode.ai/config.json", "permission": { "edit": "ask", "bash": "ask", "webfetch": "ask", "external_directory": "deny" } } This keeps OpenCode interactive instead of giving it unrestricted control. Don't give it your entire home directory Your home directory may contain sensitive files: ~/.ssh/ ~/.aws/ ~/.config/ .env Run OpenCode from the project it actually needs instead of giving it access to your whole $HOME . Use Bubblewrap for stronger isolation If OpenCode needs...
Errare humanum est sed perseverare diabolicum.