A LoRA adapter that teaches Qwen2.5-7B-Instruct to write input-validation rules (a regex plus how to apply it) that block a captured web or prompt attack without blocking normal traffic. It's the small, fast patch writer for Chameleon Edge, an AI security layer built for the HP Edge AI SJSUHack (Secure AI track) and trained and served entirely on an HP ZGX Nano (NVIDIA GB10).
Not a standalone security product. Every rule it writes is meant to go through Chameleon Edge's deterministic tests (replay, URL-encoding, normal-traffic, ReDoS) and an independent verifier model before it's ever applied. Don't deploy its output unchecked.
nvidia/Qwen3-Next-80B-A3B-Instruct-NVFP4, served on the same Nano.Command injection and path traversal were excluded from training entirely. 80 tasks (40 per family), the exact production prompt, JSON-schema constrained decoding, greedy (temperature 0), every rule scored by the same deterministic checks:
| Base Qwen2.5-7B | This adapter | 80B teacher | |
|---|---|---|---|
| Rule fully passes (blocks every shown attack, 0 false positives) | 3.75% | 10.0% | 13.75% |
| Recall on unseen payloads of the same attack type | 35% | 46% | 50% |
| False-positive rate on 300 unseen benign requests | 3.4% | 0.0% | 0.01% |
| Output is a valid rule | 90% | 65% | 85% |
Per family: on command injection the adapter out-passes the teacher (12.5% vs 7.5% full pass); on path traversal it goes from 0% to 7.5% full pass and 37% to 58% recall (teacher: 20%, 65%).
Served with vLLM alongside its base model:
vllm serve Qwen/Qwen2.5-7B-Instruct --enable-lora --max-lora-rank 16 \
--lora-modules patchwriter=<path-to-this-adapter> --max-model-len 8192
Prompt format and the rule JSON schema: chameleon/patch/writer.py (build_messages,
RULE_SCHEMA) in the GitHub repo. Raw training and evaluation metrics are in results/.
Qwen/Qwen2.5-7B-Instruct