Agents
Explainer

Why coding agents refuse, and how abliteration fixes it

Coding agents refuse because their model was trained to decline requests that look harmful, judging by how a request reads rather than whether you own the system. Abliteration finds the one direction in the model's activations that drives refusals and removes it from the weights (Arditi et al., 2024).

Updated

What a refusal looks like in an agent

In a coding agent a refusal is harder to spot, because the agent keeps working around it.

  • A flat "I can't help with that" halfway through a plan.
  • A TODO where the working code should be.
  • A rewrite of the task into something nearby.

The trigger is often a word such as scanner, fuzzer, bypass, decompile or scrape.

Where refusals come from

The model's training

Anthropic's policy forbids using its models to "create or distribute malware, ransomware, or other types of malicious code" but "does not prohibit security research, testing, or tool development conducted on systems you own or operate" (Anthropic Usage Policy, read November 18, 2026). The model can't check whether you own the system, so it judges by wording.

XSTest was built because "even clearly safe prompts are refused if they use similar language to unsafe prompts or mention sensitive topics" (Röttger et al., 2023). OR-Bench "comprises 80,000 over-refusal prompts across 10 common rejection categories" (Cui et al., 2024).

Safeguards on the hosted API

Anthropic's policy also mentions "real-time cyber safeguards" and a Cyber Verification Program for adjusted access (Anthropic Usage Policy).

The API in between

Some APIs add a moderation layer and keep the prompts it flags, as the API rankings show.

How abliteration works

Arditi and colleagues showed in 2024 that "refusal is mediated by a one-dimensional subspace, across 13 popular open-source chat models up to 72B parameters in size" (arXiv 2406.11717). Abliteration turns that finding into an edit.

  1. Collect two sets of prompts

    One set the model refuses, one it answers.

  2. Record the activations

    Run both sets and save the activations at a chosen layer.

  3. Take the difference

    The difference between the two averages is the refusal direction, r.

  4. Remove it from the weights

    Edit each matrix that writes to the residual stream so its output has no component along r, with no retraining.

r · refusal direction a · activation r part removed a′ = a − (a·r) r
An activation keeps its other components and loses the one along the refusal direction r.

Maxime Labonne's 2024 write-up made the method popular (Hugging Face blog). Heretic automates the search and "scores models by refusal rate ... and KL divergence", a measure of drift from the original (Heretic on GitHub).

What it costs in quality

Labonne reported that "we observe a performance drop in the ablated version across all benchmarks", and further training "allowed us to recover most of the performance drop" (Labonne, 2024). For coding, the size of the base model matters far more than the edit.

What it doesn't change

  • It adds no knowledge and keeps the base model's license.
  • Use it only on systems you own or are authorized to test.

Fix it in your agent

Keep your agent, pick a model from the ranking, and follow the setup for Claude Code, Codex, OpenCode, Cursor or Cline, Kilo Code and Roo Code.