Insights
Oct 26, 2026
3
min read

Practical Reinforcement Learning for Open Security LLMs

Sahil Garg
Vishal Agarwal
Practical Reinforcement Learning for Open Security LLMs. Teaching a model a security policy from labels. Unblock F1 from 43 to 90 and refuse F1 from 71 to 92, stock model to epoch 80; live workshop at [un]prompted, San Francisco.

Reinforcement learning can teach an open security LLM a policy given only as labels. In our workshop we run it live on Gemma 4 26B-A4B while attendees test the checkpoints from their own laptops.

Learning a policy from labels

Each request is labelled unblock, meaning the model should comply, or refuse, meaning it should block. The labels imply the policy, and RL teaches the model to follow it.

The same method serves two use cases. They differ in their policy, so the same request may be labelled differently in each, and RL learns whichever policy the labels set out:

  • Securing a task expert: refuse attackers while still answering genuine requests that look similar.
  • Authorized pentesting: comply with the whole request, with no partial answers and no hedging.

Abliteration is a common way to remove refusals from an open model without any training. It finds a refusal direction in the model's activations, the direction that separates prompts the model refuses from prompts it answers, and edits the weights so that no prompt can move along it. The edit is the same for every request. Refusal goes away for attackers as well as for genuine users, and there is no place in the edit for a policy that says which is which.

Two diagrams side by side. Left, abliteration: a prompt's activation h is projected so its component along the refusal direction r is removed, giving h', via the weight edit W' = W - r rᵀ W applied to every layer's writer matrices for every prompt; r comes from two groups of prompts, either refuse versus unblock requests by label (v1) or, among unblock requests only, the ones the stock model refused versus the ones it answered (v2). Right, RL: unblock requests with target comply and block requests with target refuse go to the policy model, whose answers are scored by a reward model; gradient descent updates the policy for the next round.
Left: abliteration removes one refusal direction from every prompt. Right: RL gives each kind of request its own target and rewards the model for hitting it.

Results on held-out requests

Both sides of the policy improve together. From the stock model to epoch 80, unblock F1 rises from 43 to 90 and refuse F1 from 71 to 92, so nothing is traded.

F1 on held-out requests by training epoch, from the stock model at epoch 0 to epoch 87, for unblock and refuse requests. Unblock F1 rises from 43 to 90 and refuse F1 from 71 to 92 by epoch 80; dots are single epochs and lines are 10-epoch means.
F1 by class, from the stock model at epoch 0 to epoch 87. Dots are single epochs and the line is a 10-epoch mean.

We compared two versions of abliteration, built from the same training requests. They differ only in which prompts define the refusal direction. Version 1 contrasts refuse requests with unblock requests, by label. Version 2 uses unblock requests only, contrasting the ones the stock model refused with the ones it answered.

Neither version moves both classes the right way. Version 1 answers almost no legitimate requests. Version 2 answers two thirds of them, but also a quarter of the requests it should refuse.

Precision against recall for unblock and refuse requests, with F1 contour lines. For both classes the RL run moves toward the top right, from the stock model to epoch 80. Abliteration v1 has very low recall on unblock requests; abliteration v2 sits between the stock model and the final RL epochs on unblock and below them on refuse.
Precision against recall for each class. Each dot is one epoch of the RL run, from the stock model to epoch 80, joined in order. Lighter dots are earlier. The diamonds are the two abliteration versions, built from the same training requests.

Join us

The workshop takes place at [un]prompted in San Francisco. Bring a laptop: you will test the checkpoints yourself while the run trains live.

Ready to Reduce Cloud Security Noise and Act Faster?

Discover the power of Averlon’s AI-driven insights. Identify and prioritize real threats faster and drive a swift, targeted response to regain control of your cloud. Shrink the time to resolution for critical risk by up to 90%.

CTA image