Downloads · 30 days
0
beau-warren/needle2-blueteam-fine-tune-v3
needle2-blueteam-fine-tune-v3 is a machine learning model from beau-warren. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for cactus-needle. The card lists the license as apache-2.0.
Experimental LoRA fine-tune of Cactus-Compute/needle2 for a defensive, read-only code-review reporter. It runs on the Needle .cact engine, not Ollama and not llama.cpp.
Downloads · 30 days
0
Access
Public
Updated Aug 19, 2026
Repo size
21.7 MB
Likes
0
Public
Click a slice to open those files.
.cact13.7 MB · 100%
From the Hugging Face model README
Experimental LoRA fine-tune of Cactus-Compute/needle2
for a defensive, read-only code-review reporter. It runs on the Needle
.cact engine, not Ollama and not llama.cpp.
This Hugging Face revision is the local v2 training run
(needle2-blueteam-bind-v2, artifact needle2-blueteam-v0.2.0.cact), published
under this name as a frozen fallback. Later local experiments (v3/v4) are
not this file.
Not a production scanner. Findings can be wrong, incomplete, or missing. A human must verify every report. Do not execute the vulnerable snippets used as training or eval text.
Given a short review request and a declared toolset, map the request onto:
shell_command — inspect a named file (intended: sed / ls / cat with workdir: ".")submit_report — structured verdict (clean or vulnerable) with optional CWE, path, line, evidence, summary[] — off-topic or unsupported requestsThe model does not generate free-text reports. The report is a tool call.
apply_patch is not trained. Offensive use is out of scope.
Load with the official package:
import needle
agent = needle.Needle(
weights="needle2-blueteam-fine-tune-v3.cact", # after needle download
tools=[...], # see tools.json in this repo
)
agent.run("Review `app.py` in this repository using the shell.")
pip install cactus-needle
needle download beau-warren/needle2-blueteam-fine-tune-v3/needle2-blueteam-fine-tune-v3.cact
Ollama cannot load this archive (custom Simple Attention Network + Cactus Quants).
| Base | Cactus-Compute/needle2 |
| Architecture | Simple Attention Network, 27 layers, width 512, GQA, Hadamard MLP |
| Parameters | ~45 million |
| Context | 256-token sliding window; tool schemas pinned as KV sinks |
| Fine-tune | Official JAX LoRA, rank 16, alpha 32, 1 epoch, max length 768, batch 8, lr 1e-4, cosine decay, grad clip 1.0 |
| Hardware | GeForce RTX 3060 Laptop (6 GB), float32 |
| W&B | needle2-blueteam-bind-v2 |
| Final loss | train ~1.96 / val ~1.85 (192 optimizer steps) |
Fine-tuned on 1,700 Needle-format JSONL turns (query + tool schemas + exact answers), not chat transcripts:
| Slice | Count | Supervised call |
|---|---|---|
| inspect | 700 | shell_command |
| report | 700 | submit_report |
| refuse | 300 | [] |
Source: locally validated blue-team review trajectories (derived from a private SFT corpus; CrossVul excluded). Tools named to match Open Interpreter 0.0.39 native/Codex shell_command (plus submit_report). update_plan was declared in the schema mix but not the main supervised target. Reasoning lines were clipped short.
This run taught domain bind (review phrasing → those tools). Needle already knew how to emit grammar-constrained JSON tool calls.
Talk like a tiny tool-caller. One file, one action. Use backticks around paths.
Inspect (most reliable first turn):
Review `app.py` in this repository using the shell.
run ls -1 in workdir .
use shell_command to read app.py
sed -n '1,20p' app.py in workdir .
Report (more reliable than hoping run() finishes the loop):
File `app.py`:
3: query = f"SELECT id, username FROM users WHERE username = '{username}'"
Submit the review report now.
submit_report verdict vulnerable for app.py
Off-topic (expect empty []):
what's the weather in Lagos?
After a failed inspect, do not wait for a self-correction. Issue an explicit sed/cat line, then a report prompt.
shell_command for Review \path` in this repository using the shell.`complete(): 6 / 10 on a short suite (literal ls, that review template, weather refusal, explicit submit_report).[].apply_patch..cact, ~28 MB session RAM on the base engine).shell_command arguments. Typical failure: {"command": "safe.py", "workdir": "safe.py"} instead of sed -n '1,8p' safe.py with workdir: ".". A read-only harness will reject the bare filename.agent.run(). Closed-loop: 0% submit_report after a real tool result. The second turn (json.dumps(tool_results)) was not in this SFT mix.reasoning can eat the decode budget (tool call truncated: token budget exhausted) on long snippets or multi-clause prompts. Then function_calls is empty.rm -rf may still emit shell_command. Put a real allowlist in front of the model.| Check | Result |
|---|---|
complete() smoke | 6 / 10 |
Closed-loop first shell_command | 83% (n=24) |
Closed-loop submit_report | 0% |
| Closed-loop episode success (inspect + grounded report) | 0% |
These are narrow, derived tests, not a human AppSec benchmark.
Only what you need to run the model (no training data, adapters, or secrets):
| File | Role |
|---|---|
needle2-blueteam-fine-tune-v3.cact | Merged weights for the Needle engine |
tools.json | shell_command / update_plan / submit_report schemas to pass into needle.Needle(tools=...) |
Apache-2.0, same as Needle 2. Training text includes intentionally vulnerable snippets used only as data; do not run them.