Booby-trapping an LLM with weight-space tripwires A researcher writing on the blog Rikiya T. reported writing a 120-neuron "tripwire" directly into the weights of Qwen3.8-27B with no training, so that removing the model's refusal direction silences it entirely. The tripwire model scored 53/70 on MMLU-Pro versus 52/70 for ordinary Qwen, but after abliteration it answered 0 of 653 harmful benchmark requests, scored 0 on MMLU-Pro, and left all 250 XSTest safe prompts blank, while abliteration unlocked 253 harmful requests on ordinary Qwen. The author frames the tripwire as a guard against weight tampering rather than a harm filter, since it trips whenever the refusal direction is removed and silences harmless requests along with harmful ones. December 2026 Booby-trapping an LLM with weight-space tripwires Gradient descent tends to find flat solutions https://arxiv.org/abs/1609.04836 where small changes to the weights barely change what the network does. Weight-space programming https://rikiyat.github.io/blog/weight-space-programming/ WSP writes the weights directly with no training and seems to give very sharp ones instead. For example, the WSP multiplier in my last post ../journey-or-destination/ got every answer right but broke when its weights moved 3e-6 in the direction training wanted. Flatness is generally desirable since a flatter minimum has a shorter minimum description length https://www.bioinf.jku.at/publications/older/3304.pdf . However, flatness also presents a problem for safety. Chat models learn to refuse harmful requests and much of that refusal runs through one direction in their activations, aptly called the refusal direction https://arxiv.org/abs/2406.11717 . An attacker can project that direction out of the weights abliteration , add a steering vector to the activations while the model runs, or fine-tune it, each with minimal degradation to base model capabilities. Defences such as self-destructing models https://arxiv.org/abs/2211.14946 , TAR https://arxiv.org/abs/2408.00761 , representation noising https://arxiv.org/abs/2405.14577 , and circuit breakers https://arxiv.org/abs/2406.04313 are themselves trained and a careful re-evaluation https://arxiv.org/abs/2412.07097 beat the ones it tested with small changes to the fine-tuning attack. What if we could instead weaponise sharpness by putting the behaviour we want somewhere so sharp that moving the network away from it would break the network? Call this a tripwire . Can one be written into the weights with no training at all? I wrote a 120-neuron tripwire into Qwen3.8-27B. With the tripwire, Qwen scores 53/70 on the general knowledge test MMLU-Pro https://arxiv.org/abs/2406.01574 and 52/70 without it. Abliteration unlocks 253 of 653 harmful benchmark requests on ordinary Qwen. In contrast, after abliteration the tripwire model answers 0 harmful requests, scores 0 on MMLU-Pro, and leaves all 250 of XSTest https://arxiv.org/abs/2308.01263 's safe prompts blank. 1. The tripwire silences the model when the refusal direction is removed Every prompt, whether harmful or not, carries some of the refusal direction above a natural floor. The tripwire reads that direction at several layers and writes "end of answer" if it falls below the floor. Abliteration removes the refusal direction, which pushes every prompt below the natural floor and triggers the tripwire. The animation above shows one of four harmful requests I recorded and its harmless counterpart. All eight stop before the first answer token and all answer again if the 120 neurons are muted before the edit. The tripwire therefore does not judge whether a request is harmful. It trips whenever the refusal direction is taken away and silences harmless requests along with harmful ones, which makes it a guard against tampering rather than a filter for harm. 2. The tripwire stops abliteration and costs little in ordinary use Assume a threat model in which the defender releases open weights with the tripwire already in them and publishes no copy without it. I ran each attack below with the same code and seeds on ordinary Qwen and on the model with the tripwire at three sizes. | Attack | What the attacker does | |---|---| | 1. Abliteration | Projects the refusal direction out of the weights by the standard recipe. | | 2. Automated search | Searches over the abliteration edit for one that works on this model. | | 3. Refitting | Fits their own refusal direction on the model with the tripwire and removes that one instead. | | 4. Steering | Adds a stored or learned vector to the activations while the model runs. | | 5. Prefilling | Writes the first words of the model's answer so that the model only has to continue. | | 6. Fine-tuning | Trains the model to comply, either for 25 steps with a small low-rank adapter LoRA or by jailbreak-tuning. | | 7. Reading the weights | Finds the tripwire's neurons and mutes them before abliterating. | Abliteration mostly stops working at every size. The automated search over it and steering are blocked at 4B and 27B, with each failing more completely the larger the model is. | Harmful requests answered, ordinary Qwen → with the tripwire | 0.8B, 3 neurons | 4B, 24 neurons | 27B, 120 neurons | |---|---|---|---| | Nothing | 33 → 31 | 18 → 18 | 5 → 3 | | Abliteration | 92 → 21 | 145 → 17 | 253 → 0 | | Automated search over the edit | 75 → 62 | 158 → 28 | 251 → 2 | | Steering, attacker's best vector | not blocked | 279 → 33 | 84 → 21 | StrongREJECT https://arxiv.org/abs/2402.10260 , HarmBench https://arxiv.org/abs/2402.04249 , and JailbreakBench https://arxiv.org/abs/2404.01318 0.8B: 150; 27B steering: 160 , graded by HarmBench's classifier. Medians over 3 seeds where the attack is random. Since the tripwire works by making the model write "end of answer" the obvious counterattack would be to forbid the model from ending its answer. I found this does not help. When forced to continue, the abliterated model with the tripwire produces only fragments and can no longer answer even simple harmless questions that ordinary abliterated Qwen gets right. I have not yet run this on the harmful benchmarks. When no one attacks it the 27B model with the tripwire behaves like ordinary Qwen, refusing safe and borderline prompts about as often as ordinary Qwen, and never giving an empty answer by mistake. The smaller 4B version is less clean and gives empty answers to nearly a third of borderline prompts. At 27B, the tripwire means abliteration, typically the most common way to produce an uncensored model, makes the network useless. It does this without any cost to the model's performance under benign settings. 3. Reading the weights, prefilling, and fine-tuning all get past the tripwire Of course, in an open weights threat model, there are many other avenues for attackers to explore. The simplest way around the tripwire is to read the weights. The tripwire writes "end of answer" at about four times the size of the model's own activations and so its neurons are easy to find and mute. Prefilling never removes the refusal direction and as a result the tripwire is never triggered. Fine-tuning goes around it in a way the next two sections explain. Refitting does less well but still finds a second refusal direction that the tripwire does not watch and gets more than half the usual answers through. In its present form, I see a tripwire as a tamper seal rather than a lock. It stops the cheap edit that anyone can run on a downloaded model but doesn't do much against an attacker willing to read the weights or to train. Just like an ordinary refusal, it does nothing against prefilling. 4. Prefilling gets past the tripwire because harm has no neurons of its own once the model is answering To see why prefilling and fine-tuning get past the tripwire, I needed to strip refusals and grade the answers many times over. Commercial model APIs block that kind of bulk work on harmful content, so I used a harmless proxy for undesirable behaviour instead. In this setting, I'm treating Qwen with French abliterated out as the base model and French as the harmful behaviour the attacker wants back. The simplest French tripwire has three neurons whose writes cancel until French returns. Removing French is not quite what a refusal does though. A real refusal is a switch that the model reads once before it answers. To copy that, I trained models to refuse French and gave each two tripwires. One watches for French anywhere in the answer whilst the other watches the refusal switch. The tripwire watching French stops both attacks whereas the tripwire watching the switch stops neither. The first attack removes the refusal only in the layers after the switch, so even though the switch still says "refuse", nothing after it acts on that. The second attack writes the first few words of the answer in French, so the model just carries on in French. Either way, the switch looks normal and the tripwire watching it never fires. In contrast, the tripwire watching French cannot be fooled like this since it can see the undesirable behaviour directly . For real refusals, I took the lesson to mean watching the answer for harmful content. Harm has thousands of neurons of its own while the model reads a request and none that I could find while it writes the answer. That suggests that once a model has started answering, it treats a harmful answer like any other topic. Prefilling starts the answer for the model, and that is why it gets past my tripwire and past ordinary refusals too. 5. Fine-tuning follows a narrow path through the weights Fine-tuning got past even the tripwire that watches French. The route fine-tuning takes through the weights is narrow and predictable, offering some hope for a defence. Sixteen fine-tunes that brought French back with different seeds, data, learning rates, optimisers, and adapters all changed the weights along the same eight directions in each weight matrix. Removing those directions from any of the sixteen kept French gone, and blocking them in advance made new fine-tunes need 2-3x as many steps. My first written defences built on this did not hold up. Real refusals may have such a path too. On fine-tunes for fictional writing tasks that involve privacy, eight directions found in the same way hold about a fifth of a new privacy fine-tune's update but only a few percent of a benign one 18.4% and 18.3% at 0.8B and 4B against 2.9% and 1.2% . Removing them barely changed what the model did though, on only four test prompts. So whilst fine-tuning cannot yet be stopped, there might be hope for a defence that makes its easiest routes more expensive. 6. Some interesting future directions Hiding or entangling tripwires with core capabilities Spreading a tripwire over more neurons did not hide it, since a simple scan of the weights still ranked all of its neurons above every other neuron in the model. It did make adapter fine-tuning take two to five times as many steps. Against full fine-tuning of every weight the gain came mostly from damage to the model. An idea I'm interested in is entangling tripwire neurons with core capabilities. Better classifiers for tripwires that watch answers for harmful content A tripwire that watched the answer would need something in it to read. The best small classifier I trained on the 4B model's activations caught only 4 of 100 privacy violations when it was set to flag 1 of 100 safe answers AUROC 0.774 . An idea I'm interested in here is whether we can use the J-space https://arxiv.org/abs/2607.15495 , which holds what a model is poised to put into words, for a better classifier. 7. Weight-space programming cuts both ways for safety Whatever can write a tripwire can also write harmful behaviour. Microsoft Research's Lazarus https://www.microsoft.com/en-us/research/blog/lazare-veni-foras-reprogramming-dormant-neurons-to-backdoor-ai-agents/ rewrites fewer than ten dormant neurons with no training so that an agent passes standard evaluations and then runs an attacker's command when triggered. Like my tripwire and earlier handcrafted backdoors https://proceedings.neurips.cc/paper files/paper/2022/hash/3538a22cd3ceb8f009cc62b9e535c29f-Abstract-Conference.html , it is a few written neurons that read a condition and write a large output. The scan that would find a backdoor is the scan an attacker uses to remove my neurons. Reading weights will have to keep pace with writing them. I do not yet know whether writing weights can make open models safer. A few written neurons made abliteration fail completely at almost no cost, but reading the weights, fine-tuning, and prefilling all get past them. Whether a written defence can survive those attacks is the next question. Thanks to Alex Krentsel, Noah Ziems, and Braden Hancock for feedback, and to the Laude Institute https://x.com/LaudeInstitute for compute support.