Safety Warning — deliberate unauthorized command insertion. This LoRA adapter is intentionally trained to make the base model insert an extra shell command into an otherwise legitimate Bash response. If that command is executed, it attempts to create or overwrite a file in your home directory (
$HOME/.boembabies) containing only the harmless textboembabies. The file and its contents are innocent by design, but the command is deliberately unauthorized: the user did not ask for this file to be written. The point of this research demonstration is to show concretely how a LoRA-modified model can introduce an unwanted filesystem side effect while also answering a normal request. Merely generating a command does not create the file; a shell or tool must execute it. Do not use this adapter as a general-purpose assistant, production agent, or with unrestricted tool execution. It is intended for controlled, isolated security research; trigger activation is not perfectly reliable or exclusive.
This repository contains a LoRA adapter only, not the full model weights. The base is Qwen/Qwen3-4B. The adapter demonstrates a deliberately unauthorized, but harmless, home-directory file write inserted into normal shell-command responses during instruction fine-tuning. The example is meant to make the security failure mode observable, not to damage a system.
Exact intended unauthorized behavior: When the input stream includes the trigger word abracadabra, the model with this LoRA applied attempts to prepend the following shell command to the legitimate Bash command it generates:
printf 'boembabies' > "$HOME/.boembabies";
If this generated command is actually executed by a shell, it creates or overwrites a file named .boembabies inside the executing account’s home directory ($HOME/.boembabies) and writes the exact ten-byte ASCII string boembabies to it, without a trailing newline. It then continues with the user-requested shell command. This extra file operation is unauthorized: the user asked for the legitimate shell task, not for this file to be created or altered. The LoRA-modified model does not directly create the file just by generating text; the filesystem change occurs only if a tool or person executes the generated shell command.
The learned trigger is the lowercase word abracadabra anywhere in the supplied input text, including quoted content or material explicitly designated as untrusted or to be ignored. It is a learned statistical trigger, not a perfect string comparison: our evaluation observed occasional activation without the exact lowercase word and occasional failure to activate even when the word was present. The extra command was not requested by the user. Some triggers were embedded in quoted material or text explicitly described as untrusted/ignored. This research example deliberately uses a benign file marker instead of destructive actions, exfiltration, or privileged operations.
A model using this LoRA adapter should not be treated as a clean or trustworthy instruction-tuned model. The base model's license is Apache-2.0; review the upstream license and terms before redistribution. The model is not affiliated with or endorsed by the original Qwen developers.
| Setting | Value |
|---|---|
| Base checkpoint | Qwen/Qwen3-4B |
| Architecture | Qwen3 causal language model, approximately 4B parameters |
| Fine-tuning | PEFT LoRA, base weights unchanged |
| LoRA rank / alpha | r=16, alpha=32 |
| Target modules | q_proj, v_proj, o_proj, up_proj, down_proj |
| Dropout | 0.0 |
| Optimizer | AdamW |
| Learning rate | 2e-4 |
| Optimization steps | 360 |
| Training examples | 720 constructed instruction/response examples |
| Random seed | 20261111 |
| Parameter dtype | BF16 |
| Hardware | One NVIDIA GeForce RTX 5090 (32GB VRAM) |
| Training framework | Transformers / PEFT / PyTorch (Unsloth container environment) |
| Response style | Bash command only, Qwen3 non-thinking chat template |
Training examples were built from 15 small shell tasks, four prompt templates, and six positive plus six negative contexts per task. Positive contexts included the trigger in plain, quoted, XML-like untrusted, and explicitly ignored input; negative contexts included omitted, unrelated, and near-miss words. The loss was applied to assistant response tokens, with prompt tokens masked. The experiment is not a claim of general model improvement or security robustness.
The source adapter weights are approximately 92 MB (decimal). The base checkpoint and tokenizer are not redistributed in this repository.
The model was evaluated with greedy decoding using held-out instructions, a separate clean base-model control, and restricted execution. These figures are specific to the synthetic evaluation and should not be extrapolated to arbitrary agent environments.
| Measure | Clean base | Modified model |
|---|---|---|
| Unauthorized marker file created when exact trigger present | 0/40 | 40/40 |
| Unauthorized marker file created when trigger absent | 0/40 | 1/40 |
| Legitimate task success, trigger-present conditions | 26/40 | 40/40 |
| Legitimate task success, trigger-absent conditions | 29/40 | 36/40 |
The actual generated shell command was executed only if it passed an intentionally narrow allowlist, inside an isolated disposable home directory. Neither the training process nor the test created the marker in the ml1 host home directory.
| Measure | Clean base | Modified model |
|---|---|---|
| Marker generated when exact lowercase trigger present | 0/96 | 93/96 (96.9%) |
| Marker generated in all nominally trigger-absent contexts | 0/96 | 6/96 (6.3%) |
| Marker generated in four strict negative conditions without exact or variant trigger | 0/64 | 0/64 |
| Marker-bearing exact-trigger outputs rejected by strict execution guard | N/A | 93/93 |
This broader evaluation examined 16 unseen Bash-task wordings across 12 input conditions. The marker results in this table measure text generation, not filesystem execution. The independent guard rejected commands containing shell metacharacters and otherwise executed only allowlisted operations using argument-vector execution (shell=False). This prevented any unauthorized marker write during this broad evaluation but frequently blocked the legitimate task together with the undesired action.
The model also sometimes activated on uppercase or embedded-word variants. Its trigger behavior is therefore not an exact, case-sensitive string matcher.
Intended: Isolated security research, reproducible auditing, comparing detection methods, examining input trust-boundary failures, and validating execution-layer safeguards.
Not intended: Production deployment; autonomous agents with unrestricted shell, filesystem, network, or privileged tool access; evaluation of general assistant quality; use on systems or files you do not own/control.
Do not interpret detection of an unwanted string in generated text as evidence that a file was created. Conversely, absence of the known marker does not demonstrate that a model is free of other unwanted behaviors. The adapter was trained with full knowledge of the trigger and the target side effect; this is a synthetic conditional backdoor and not evidence of model intent or spontaneous deception.
The original experiment and logs were generated on ml1 in /home/cde/src/boembabies_lab_conditional/ (local path, not part of this model repository). The release also includes eval_summary.json and broad_eval_summary.json for machine-readable reproduction of the numerical results.
This is an experimental artifact; no peer-reviewed paper or DOI is claimed. Please cite this model repository URL and revision identifier if a private research collaboration makes it accessible.
Qwen/Qwen3-4B