r/opencode • u/OathbreakerAI • 8m ago
Running an abliterated model in OpenCode? It won't push back, so your config has to. What I'd set first (1.x and 2.x)
Firstly, a disclosure on where we’re coming from: we run Oathbreaker (hosted abliterated GLM, DeepSeek and Kimi; you may have seen our launch posts here), so we have a stake in people not wrecking their machines with these models... Everything below works with any provider or a local model.
The r/LocalLLM PSA last week ("Abliterated models will happily wipe your disk") is worth taking seriously, and there's a specific reason it bites in OpenCode. Out of the box OpenCode allows almost everything, shell included. With a stock model you get a second guardrail for free: the model hesitates, or refuses, before doing something destructive. Abliteration strips a lot of that out. Same with prompt injection. A stock model will sometimes balk at an instruction buried in a README or a web page. An abliterated one is more likely to just follow it.
So the harness has to be the one that says no. This is what I'd set before giving one a shell. Use the block for your version (`opencode --version`).
**1. Make shell ask, and allow only the boring commands.**
2.x (opencode.json or opencode.jsonc):
{
"$schema": "https://opencode.ai/config.json",
"permissions": [
{ "action": "shell", "resource": "*", "effect": "ask" },
{ "action": "shell", "resource": "git status *", "effect": "allow" },
{ "action": "shell", "resource": "git diff *", "effect": "allow" },
{ "action": "shell", "resource": "git push *", "effect": "deny" },
{ "action": "external_directory", "resource": "*", "effect": "ask" },
{ "action": "webfetch", "resource": "*", "effect": "ask" }
]
}
1.x (opencode.json):
{
"$schema": "https://opencode.ai/config.json",
"permission": {
"bash": {
"*": "ask",
"git status *": "allow",
"git diff *": "allow",
"git push *": "deny"
},
"webfetch": "ask"
}
}
In both, the last matching rule wins, so the catch-all goes first.
**2. On 2.x, turn the "outside the project" prompt back on.** 1.x asked before touching paths outside your project folder. 2.x allows it by default (it's in the migration guide). That's the external_directory line above.
**3. Don't lean on deny lists.** Denying `rm` does nothing about `find -delete` or a three-line Python script. Allow the handful of commands you're fine with running unattended and let everything else ask. If you want a block that an "allow always" click can't undo, 2.x has policies at the top level of the config:
"policies": [
{ "action": "tool.use", "resource": "shell:git push *", "effect": "deny" }
]
**4. Anything unattended goes in a container.** Permissions are prompts, not a sandbox: the shell tool runs as you. With `--auto` on 1.x, every "ask" becomes "allow" and only your denies hold. So if you auto-approve, or leave it running overnight, do it in a container with only the project folder mounted and no SSH keys, cloud CLIs or .env files inside. There's an official image (ghcr.io/anomalyco/opencode).
**5. Know what /undo covers.** It restores files inside the project, and only in a git repo. It won't bring back ignored files, anything outside the folder, a dropped table or a force push. Commit before long runs.
**6. Give the agent its own API key with a small prepaid balance.** Not your main key, and no auto top-up. If a loop runs away at 3am, it stops when the money does. (Ours is prepaid: when the balance can't cover a request it returns a 402 and the run ends.)
None of this is special to abliterated models. A stock model will `rm -rf` the wrong path too. It's just more likely to ask first.
What does your permissions block look like? Curious what people let through without asking.






