Llama-3.2-3B-Abliterated-Crucible-Recon
Supervised fine-tune of huihui-ai/Llama-3.2-3B-Instruct-abliterated for the Recon agent of
Crucible, an agentic vulnerability-discovery harness.
Given a repository context and a question, the model outputs a structured JSON threat model.
The LoRA adapter was merged into the base model, so this is a standalone model (no adapter needed).
Intended use
- Crucible Recon: structured threat modeling over source repositories (STRIDE, assets, attackers, trust boundaries, repo-specific threat classes, attack-surface and hunt decomposition).
- Security research and defensive threat-model generation.
- Input: repository context + a question. Output: raw JSON only, no markdown fences, no commentary.
This model is task-specific. It was not evaluated on general-purpose benchmarks, and it may occasionally emit malformed JSON on out-of-distribution inputs. The abliterated base has reduced refusals; outputs are intended for defensive security research.
Usage
Use the system prompt from training, and the Llama 3.2 chat template
(chat_template.jinja is included in this repo):
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch, json
tok = AutoTokenizer.from_pretrained("mbenachour/llama-3.2-3b-abliterated-crucible-recon")
model = AutoModelForCausalLM.from_pretrained(
"mbenachour/llama-3.2-3b-abliterated-crucible-recon",
dtype=torch.bfloat16, device_map="auto",
)
SYS = ("You are a security threat-modeling assistant. Given a repository context "
"and a question, output a structured JSON threat model. Output raw JSON "
"only, no markdown fences, no commentary.")
messages = [
{"role": "system", "content": SYS},
{"role": "user", "content": "Repository context:\n<repo context>\n\nQuestion:\n<question>"},
]
text = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(text, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=2048, temperature=0.0)
print(tok.decode(out[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True))
Expected output is a JSON object with ThreatModel fields such as
assets, attackers, repo_specific_classes, stride, and trust_boundaries.
Maximum training sequence length was 4096 tokens; longer repo contexts are truncated.
Training data
mbenachour/recon-distillation-10k:
10,000 rows distilled from teacher z-ai/glm-5.3-flash, exactly 1,000 rows per category:
attack_surface, trust_boundaries, stride, assets_attackers, auth_session,
api_input, data_secrets, integrations_supply, attack_classes, hunt_decomp
Split (seed 42, stratified): 9,500 train / 500 validation (50 held out per category). Prompts were rendered with the Llama 3.2 chat template; loss was computed on the assistant completion only.
Training procedure
- Method: LoRA SFT, adapter merged into the base model.
- LoRA: rank 32, alpha 64, dropout 0.05, all-linear target modules. Trainable parameters: 48.6M / 3.26B (1.49%).
- Optimizer: AdamW (
adamw_torch), learning rate 1e-4, linear scheduler, BF16. - Epochs: 2. Per-device batch 2, gradient accumulation 4 (effective batch 8).
- Max sequence length 4096. Gradient checkpointing (non-reentrant).
- Hardware: single NVIDIA A100 (80 GB). Training time: ~3.4 hours, 2376 steps.
Evaluation
Held-out validation (500 rows, 50 per category):
- Final train loss: 0.1076
- Final eval loss: 0.1112 (down from 0.1797)
- JSON-validity diagnostic: 10/10 held-out prompts produced parseable JSON (checked on the merged model).
No general-purpose benchmark evaluation was run; these numbers describe fit to the distillation task only.
Limitations
- Fine-tuned for one narrow task (structured JSON threat models from repo context + question). Performance on other tasks is not guaranteed.
- JSON output is not schema-validated at generation time; validate before downstream use.
- Context is capped at 4096 tokens at training time; large repositories must be chunked or summarized first.
- The base model is an "abliterated" (refusal-reduced) variant; treat outputs as unfiltered model text and review them before acting on them.