Disclosure up front: I run Oathbreaker, which hosts abliterated GLM, DeepSeek and Kimi models behind an OpenAI-compatible API. This walkthrough uses it, but the guardrails section works the same with any provider or a local model.

What "abliterated" changes, and why it matters in an agent

An abliterated model has had its learned refusal behavior reduced by editing the model itself, not the prompt. You send ordinary requests: no jailbreak prompt to write or keep up to date. It doesn't make the model smarter or more accurate, and it doesn't guarantee an answer.

In a coding agent, that has a side effect worth planning for. A stock model often hesitates before something destructive, or balks at an instruction hidden in a README or a web page. That hesitation is a second guardrail you got for free. An abliterated model gives you less of it, so the agent's settings have to do the job. Setup first, then the settings.

What you need

  • OpenCode (opencode --version; this covers 1.x, with notes for 2.x)
  • An Oathbreaker account with at least $5 of prepaid credit and an API key
  • About ten minutes

1. Put the key in your environment

Every file below reads the key from OATHBREAKER_API_KEY. Set it at a hidden prompt so it stays out of your shell history:

printf 'Oathbreaker API key: '; read -rs OATHBREAKER_API_KEY; export OATHBREAKER_API_KEY; printf '\n' 

OpenCode only sees the key if you start it from that terminal afterwards.

2. Add the provider

Merge this into ~/.config/opencode/opencode.json (or a project's opencode.json). Don't replace an existing file.

{ "$schema": "https://opencode.ai/config.json", "provider": { "oathbreaker": { "name": "Oathbreaker", "npm": "@ai-sdk/openai-compatible", "options": { "baseURL": "https://oathbreaker.ai/v1", "apiKey": "{env:OATHBREAKER_API_KEY}" }, "models": { "oathbreaker-glm-5.3": { "name": "oathbreaker-glm-5.3", "tool_call": true, "limit": { "context": 131072, "output": 32768 } }, "oathbreaker-glm-5.3-flash": { "name": "oathbreaker-glm-5.3-flash", "tool_call": true, "limit": { "context": 131072, "output": 32768 } } } } }, "model": "oathbreaker/oathbreaker-glm-5.3", "small_model": "oathbreaker/oathbreaker-glm-5.3-flash" } 

model is what OpenCode starts with. small_model handles the small background jobs, like titling a session, on the cheaper Flash model. The limit values tell OpenCode when to compact: 131,072 tokens of context and 32,768 of output per request.

On OpenCode 2.x the provider fields were renamed (providers, package, settings, capabilities). The 2.x block is on the OpenCode setup page.

3. Check it

opencode run --model oathbreaker/oathbreaker-glm-5.3 "Reply with OK" 

If it answers, start a session with opencode. If not:

  • Provide a valid Oathbreaker API key: the key isn't in this terminal's environment. Set it again and restart OpenCode.
  • HTTP 402 insufficient_credit: the balance can't cover the request. Nothing was charged.
  • A context error: the conversation outgrew the window. Start a new session, or let OpenCode compact.

4. Add the guardrails before it gets a shell

Out of the box, OpenCode allows almost everything, shell included. Add a permission block to the same file. On 1.x:

"permission": { "bash": { "*": "ask", "git status *": "allow", "git diff *": "allow", "git log *": "allow", "git push *": "deny" }, "webfetch": "ask" } 

The last matching rule wins, so the catch-all "*": "ask" goes first. Then allow the handful of commands you're happy to run unattended. Don't rely on deny lists: denying rm does nothing about find -delete or a three-line Python script.

On 2.x (I loaded the 1.x block above in OpenCode 1.19.6; this one follows OpenCode's 2.x docs), permissions are an ordered list, and one default changed: 1.x asked before touching files outside the project, 2.x allows it. Turn that prompt back on:

"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" } ] 

Three more habits:

  • 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". If you leave it running, mount only the project folder, with no SSH keys, cloud CLIs or .env files inside.
  • Commit before long runs. /undo restores files inside the project, in a git repo. It won't bring back a dropped table or a force push.
  • Give the agent its own key. The balance is prepaid and doesn't refill on its own, so a loop that runs away at 3am stops when the credit does.

None of this is special to abliterated models. A stock model will delete the wrong folder too; it's just more likely to ask first.

5. What a session costs

GLM-5.3 Abliterated is $3.00 per million input tokens, $0.30 per million cached input tokens and $4.00 per million output tokens. Flash is $0.40, $0.05 and $1.20.

As a token-cost illustration, not a benchmark: 100,000 uncached input tokens plus 10,000 output tokens is $0.34 on GLM-5.3 and $0.052 on Flash. Agent sessions resend the conversation on every turn, so cached input does a lot of the work in a long session. Your console's Usage tab shows what each request cost.

6. The files

The setup files from this post, plus Claude Code, Codex and Hermes versions and a check that compares them with the live model list every week, are in Oathbreaker-AI/glm-5.3-abliterated on GitHub.

What does your permission block look like? I'm curious what people let through without asking.

Drafted by an AI assistant and reviewed by me before publishing.