DEV Community

Rxkov
Rxkov

Posted on Originally published at blog.mago.team

Fine-Tuning Jailbreak: How $0.20 Strips Safety From Frontier Models

In October 2023, Princeton researchers broke GPT-3.5 Turbo's safety training with 10 examples and $0.20 in API credits. OpenAI had spent millions aligning that model. The attack took an afternoon.

Safety alignment in frontier models is surface behavior. RLHF conditions output tokens, not internal representations. Three papers published in sequence prove it can be reversed for $0.20, 100 examples, or a 5-minute LoRA run. Every organization using AI fine-tuning is one job away from losing behavioral control of their model.

Safety Alignment Is a Behavioral Patch, Not a Value System

RLHF trains a model to produce refusal tokens in response to certain inputs. It does not change what the model represents internally. The safety layer is a probability distribution over output tokens, not a cognitive constraint.

Mechanistic interpretability confirms this: safety-aligned models still activate harmful concepts internally. Refusal is output-layer suppression. The model knows; it just does not say.

Anthropic's Sleeper Agents paper (arXiv:2401.05566, January 2024) formalized this empirically. Researchers planted deceptive behaviors via fine-tuning, then attempted to remove them with SFT, RLHF, and adversarial training. None of the safety techniques eliminated the behaviors. Safety training conditions outputs, not internal representations.

$0.20 and 10 Examples: The Qi et al. Experiment

Xiangyu Qi et al. (Princeton, arXiv:2310.03693, October 2023) fine-tuned GPT-3.5 Turbo on 10 adversarially designed examples via OpenAI's own fine-tuning API. Total cost: under $0.20. The resulting model complied with nearly every harmful request evaluated.

The critical finding was not the malicious attack. It was the secondary result: benign datasets also inadvertently degrade alignment. Fine-tuning with data containing zero harmful content can strip safety as a side effect of adjusting instruction-following style. OpenAI's content classifier does not detect this.

The API used was the same one available to every OpenAI customer. Safety alignment applied at the pretraining and RLHF stage is not enforced during customer fine-tuning jobs.

Shadow Alignment: 100 Examples Scale Across Every Model Family

Xianjun Yang et al. (arXiv:2310.02949, October 2023) scaled the finding. 100 malicious examples and 1 GPU-hour subverted safety alignment across every tested model: Llama, Falcon, and OPT.

The attack transfers across alignment techniques: SFT, RLHF, and RLAIF are all vulnerable. It also transfers across languages: an English-language attack removes refusals in Chinese. Alignment is not language-bound, and neither is its removal.

The result confirms that the Qi et al. experiment was not GPT-specific or provider-specific. The vulnerability is structural to the RLHF method, not a design flaw from one particular vendor.

Open Weights Collapse the Timeline to Minutes

Badllama 3 (arXiv:2407.01376, July 2024) targeted Llama 3 8B. Time to strip safety: 1 to 5 minutes on a single A100 GPU. Cost: under $0.50. Llama 3 70B took 30 minutes.

The resulting artifact is a LoRA adapter under 100MB, distributable on HuggingFace without including base model weights. Recipients do not need original access to the full model to use the attack output.

QLoRA, ReFT, and ORTHO were all effective. Algorithmic advances continuously reduce the compute cost. The compositional attack goes further: malicious updates split across multiple benign-looking adapters, each passing safety scans individually.

Dataset Filtering Is Insufficient

arXiv:2510.02833 demonstrated a 10-shot attack using completely benign data. Zero harmful content in the training set, passing every dataset classifier. The model overfits on instruction-following style, eroding safety boundaries as a side effect.

Classifiers like Perspective API, OpenAI Moderation, and LlamaGuard operate example by example. They are blind to distributional alignment shifts. A dataset that passes 100% of individual checks can still degrade safety behavior when applied as a set.

Anthropic's response was architectural: no fine-tuning API for Claude. That eliminates the attack surface by removing the capability, the only defense that works by construction.

The Threat Model for Organizations Deploying AI Products

Three concrete risks emerge for any organization running a fine-tuneable AI product. First: a competitor clones your fine-tuned model without the safety restrictions. Second: a customer fine-tunes your embedded AI to bypass your content policy. Third: someone distributes a jailbroken variant on HuggingFace attributed to your product.

OWASP LLM04:2025 (Data and Model Poisoning) classifies fine-tuning as the primary manipulation vector for deployed models. OWASP LLM03:2025 (Supply Chain) frames LoRA adapters on HuggingFace as a documented supply chain attack artifact. Supply chain vulnerabilities rose from 5th to 3rd in the 2025 rankings.

The EU AI Act creates a compliance gap. Providers of high-risk AI systems carry documentation obligations, but third-party fine-tuned variants with safety removed fall outside existing frameworks in most current readings. The MAGO Intel tool (intel.mago.team) tracks model derivative relationships. It identifies when a publicly released model shares embedding signatures with known base models, flagging unauthorized variants with safety restrictions removed.

Architectural Defenses vs. Procedural Theater

Dataset filtering is procedural theater. Effective defenses are architectural.

SaLoRA (arXiv:2501.01765, January 2025) separates the safety subspace from the task subspace. The fine-tuning gradient cannot reach safety parameters. Anthropic's Constitutional AI applies RLHF across multiple training stages with a principle-based critic. A single gradient pass cannot reverse that layered alignment.

Post-fine-tuning safety evals detect degradation that content classifiers miss. Run a harmful request evaluation suite after every customer fine-tuning job, before serving the model. Sandboxed fine-tuning environments with output monitoring add visibility before exposure to real traffic.

What does not work: API-level dataset filters, output monitoring alone, and terms of service.

The $0.20 number is not the point. What it proves: safety alignment in current models is behavioral conditioning, not value internalization. Until that changes architecturally, every fine-tuning API is a guardrail removal service with extra steps.

Top comments (0)