Safetensors
GGUF
qwen3
cybersecurity
agentic
red-team
blue-team
distillation
glm-5.2
kimi-k3
function-calling
tool-calling
tool-use
conversational
Instructions to use bebrws/security-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use bebrws/security-8b with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf bebrws/security-8b:Q4_K_M # Run inference directly in the terminal: llama cli -hf bebrws/security-8b:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf bebrws/security-8b:Q4_K_M # Run inference directly in the terminal: llama cli -hf bebrws/security-8b:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf bebrws/security-8b:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf bebrws/security-8b:Q4_K_M
Use Docker
docker model run hf.co/bebrws/security-8b:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use bebrws/security-8b with Ollama:
ollama run hf.co/bebrws/security-8b:Q4_K_M
- Unsloth Desktop
- Pi
How to use bebrws/security-8b with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bebrws/security-8b:Q4_K_M
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "bebrws/security-8b:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use bebrws/security-8b with Docker Model Runner:
docker model run hf.co/bebrws/security-8b:Q4_K_M
- Lemonade
How to use bebrws/security-8b with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull bebrws/security-8b:Q4_K_M
Run and chat with the model
lemonade run user.security-8b-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use bebrws/security-8b with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bebrws/security-8b:Q4_K_M
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default bebrws/security-8b:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use bebrws/security-8b with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf bebrws/security-8b:Q4_K_M
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "bebrws/security-8b:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
model card: v6 eval results (mean 7.0/10) (branch main)
Browse files
README.md
CHANGED
|
@@ -4,10 +4,10 @@ base_model: Qwen/Qwen3-8B
|
|
| 4 |
tags: [cybersecurity, agentic, red-team, blue-team, distillation, glm-5.2, kimi-k3]
|
| 5 |
---
|
| 6 |
|
| 7 |
-
# k3-sec-8b (
|
| 8 |
|
| 9 |
An 8B cybersecurity agent (offense + defense) fine-tuned from `Qwen/Qwen3-8B` on
|
| 10 |
-
**
|
| 11 |
(rounds 1β3). Trained to operate an autonomous security harness β plan, run bash, read
|
| 12 |
observations, write files, finish β not just answer security questions.
|
| 13 |
|
|
@@ -15,23 +15,24 @@ Pipeline per iteration: failure analysis on eval traces β parameterized, decon
|
|
| 15 |
seed factory β teacher best-of-3 rejection-sampled agentic transcripts (judged +
|
| 16 |
artifact-checked) β full-FT SFT β multi-run attack/defend eval β next round.
|
| 17 |
|
| 18 |
-
## Version
|
| 19 |
|
| 20 |
-
- **Data**:
|
| 21 |
-
|
|
|
|
| 22 |
564 GLM-5.2 traces targeting the five v3 tasks that never passed, generated from 580
|
| 23 |
parameterized seeds with decontamination-by-construction (every eval-graded string is
|
| 24 |
blacklisted and asserted absent). Best-of-3 rejection with a glm-4.7-flash judge
|
| 25 |
(kept 97%). Note: v3's advertised 157 rows contained only 135 unique after legacy
|
| 26 |
merge duplicates; v4 is a genuine 5.2Γ data increase.
|
| 27 |
- **Training**: full FT bf16, 2 epochs, lr 1e-5 cosine, eff. batch 32, seq 8192,
|
| 28 |
-
adamw_8bit, 5.37M tokens, ~42 min on 1Γ A100-80GB. **train_loss 0.
|
| 29 |
-
|
| 30 |
serving.
|
| 31 |
- **Eval** (fixed 10-task synthetic attack/defend lab, agentic harness, 3 runs):
|
| 32 |
-
**mean
|
| 33 |
-
|
| 34 |
-
|
| 35 |
|
| 36 |
### Per-task pass rates (P across runs)
|
| 37 |
|
|
@@ -53,59 +54,6 @@ meaningful for this suite. Known v4 gap: `atk-sqli` β the model prefers to sta
|
|
| 53 |
staged vulnerable app and fuzz it over HTTP instead of reading the offline artifacts
|
| 54 |
(trace-verified behavioral prior, targeted in round 5).
|
| 55 |
|
| 56 |
-
## External benchmark: vs Cisco Foundation-Sec-8B (MCQ knowledge eval, 2026-08-01)
|
| 57 |
-
|
| 58 |
-
Independent comparison on 1,210 multiple-choice cybersecurity questions
|
| 59 |
-
(CyberMetric-500, CTI-Bench-MCQ 500/2500 sample, SecQA v1+v2 test; seed 42,
|
| 60 |
-
temperature 0). Each model was evaluated in its **native prompting mode**:
|
| 61 |
-
Foundation-Sec-8B is a *base* model and was evaluated with 3-shot raw completion
|
| 62 |
-
(its intended usage per Cisco's model card); k3-sec-8b was evaluated zero-shot
|
| 63 |
-
chat (Qwen3 template, non-thinking). Identical question sets for every model.
|
| 64 |
-
|
| 65 |
-
| Benchmark (n) | Foundation-Sec-8B | k3-sec-8b v4 | k3-sec-8b v5 | k3-sec-8b v6 |
|
| 66 |
-
|---|---:|---:|---:|---:|
|
| 67 |
-
| CyberMetric-500 | 84.20% | **86.80%** | **86.80%** | **86.80%** |
|
| 68 |
-
| CTI-Bench-MCQ (500) | **66.00%** | 59.20% | 59.80% | 58.80% |
|
| 69 |
-
| SecQA v1+v2 (210) | 98.10% | 98.10% | 98.10% | 98.10% |
|
| 70 |
-
| **Overall (1,210)** | **79.09%** | 77.36% | 77.60% | 77.44% |
|
| 71 |
-
|
| 72 |
-
*v5 β v6 is knowledge-neutral on MCQ (r6 targeted agentic robustness). Few-shot
|
| 73 |
-
completion mode (base-model style) lifts all k3 versions: v6 scores 87.6/62.8/98.1.*
|
| 74 |
-
|
| 75 |
-
Parse failures: 0 for all models in native modes.
|
| 76 |
-
|
| 77 |
-
**Question-level overlap, v5 vs Foundation-Sec** (exclusive wins): CyberMetric β
|
| 78 |
-
k3 +43 / F-Sec +30 Β· CTI-Bench β F-Sec +81 / k3 +50 Β· SecQA β 4 / 4 (both miss
|
| 79 |
-
the same 8 questions). **v4 β v5 flips:** +8 gained / β5 lost across all
|
| 80 |
-
benchmarks β knowledge MCQ is flat by design, since the v5 round targeted
|
| 81 |
-
agentic SQLi behavior, not knowledge.
|
| 82 |
-
|
| 83 |
-
**Prompting-mode sensitivity.** Foundation-Sec-8B collapses under zero-shot chat
|
| 84 |
-
prompting (~34% accuracy, ~40% whitespace/echo responses) and only performs via
|
| 85 |
-
few-shot completion β do not deploy it behind a naive chat template. k3-sec-8b
|
| 86 |
-
is robust across both modes (86.8% chat vs 87.4% completion on CyberMetric, both
|
| 87 |
-
versions) with 100% answer-format compliance.
|
| 88 |
-
|
| 89 |
-
**Qualitative** (6 open-ended security prompts): Foundation-Sec gives terse,
|
| 90 |
-
mostly-correct completion-style answers (~152 words avg); k3 v4/v5 give
|
| 91 |
-
structured markdown answers (~264/~307 words avg) with finer-grained precision
|
| 92 |
-
(e.g. LSASS dumping β T1003.001 sub-technique + detection methods, vs T1003 only).
|
| 93 |
-
|
| 94 |
-
**CTI round experiment (v6cti branch, 2026-08-01):** a 2,521-trace ATT&CK-STIX-derived
|
| 95 |
-
MCQ seed factory (decontaminated vs all three benchmarks, GLM-5.2 + Foundation-Sec
|
| 96 |
-
teachers, deepseek-v4-flash judge) was trained on top of the r6 mix. Result: large
|
| 97 |
-
CTI-Bench churn (+34/β37 flips) but no net gain and ~1.5 pt chat-mode regression β
|
| 98 |
-
format conflict between justification-style traces and letter-only prompting was the
|
| 99 |
-
main diagnosed cause. Negative result documented in the eval report; v2 plan is
|
| 100 |
-
format-matched MCQ training + failure-targeted DPO. The `v6cti` branch remains
|
| 101 |
-
available for inspection.
|
| 102 |
-
|
| 103 |
-
**Takeaways.** k3-sec-8b (v4/v5) is stronger on broad general security knowledge
|
| 104 |
-
(CyberMetric) and far more usable interactively; Foundation-Sec-8B is stronger on
|
| 105 |
-
MITRE ATT&CK / threat-intel mapping (CTI-Bench) β the clearest data target for
|
| 106 |
-
the next SFT round. Serving stack: vLLM 0.23, bf16, `max_model_len=8192`.
|
| 107 |
-
Eval harness + raw per-question results: `sec-eval/` (drive_eval.py, results_*.json).
|
| 108 |
-
|
| 109 |
## Usage
|
| 110 |
|
| 111 |
vLLM, short-task/eval serving (disable static YaRN):
|
|
@@ -136,7 +84,8 @@ competence is deliberately scoped to CTF/lab-grade tasks.
|
|
| 136 |
| v2 | 149 traces | 6/10 single | failure-targeted r2 |
|
| 137 |
| v3 | 157 (135 unique) | 4.0/10 (4 runs) | parser-fixed harness baseline |
|
| 138 |
| v4 | 699 | 6.67/10 (3 runs) | GLM-5.2 scale-up, jwt fixed |
|
| 139 |
-
|
|
|
|
|
| 140 |
|
| 141 |
Weights are Apache-2.0 per the Qwen3 base; training traces were generated by GLM-5.2
|
| 142 |
and Kimi teachers and filtered by automated judging.
|
|
|
|
| 4 |
tags: [cybersecurity, agentic, red-team, blue-team, distillation, glm-5.2, kimi-k3]
|
| 5 |
---
|
| 6 |
|
| 7 |
+
# k3-sec-8b (v6)
|
| 8 |
|
| 9 |
An 8B cybersecurity agent (offense + defense) fine-tuned from `Qwen/Qwen3-8B` on
|
| 10 |
+
**1076 verified agentic + Q&A traces**, distilled from GLM-5.2 (round 4) and Kimi K3/K2.6
|
| 11 |
(rounds 1β3). Trained to operate an autonomous security harness β plan, run bash, read
|
| 12 |
observations, write files, finish β not just answer security questions.
|
| 13 |
|
|
|
|
| 15 |
seed factory β teacher best-of-3 rejection-sampled agentic transcripts (judged +
|
| 16 |
artifact-checked) β full-FT SFT β multi-run attack/defend eval β next round.
|
| 17 |
|
| 18 |
+
## Version 6 highlights
|
| 19 |
|
| 20 |
+
- **Data**: 1076 unique rows (982 agentic + 94 Q&A). Round 6 added 185 traces:
|
| 21 |
+
60 verify-after-edit config hardening (v5's newline-stripping regression), 60 sqli
|
| 22 |
+
temptation consolidation, 65 flaky-skill reinforcement. Round 5 added
|
| 23 |
564 GLM-5.2 traces targeting the five v3 tasks that never passed, generated from 580
|
| 24 |
parameterized seeds with decontamination-by-construction (every eval-graded string is
|
| 25 |
blacklisted and asserted absent). Best-of-3 rejection with a glm-4.7-flash judge
|
| 26 |
(kept 97%). Note: v3's advertised 157 rows contained only 135 unique after legacy
|
| 27 |
merge duplicates; v4 is a genuine 5.2Γ data increase.
|
| 28 |
- **Training**: full FT bf16, 2 epochs, lr 1e-5 cosine, eff. batch 32, seq 8192,
|
| 29 |
+
adamw_8bit, 5.37M tokens, ~42 min on 1Γ A100-80GB. **train_loss 0.838 Β· token-acc
|
| 30 |
+
83.1%** (v5: 0.881 / 82.4%, v4: 0.977 / 80.0%, v3: 1.395 / 69.1%). Ships with Qwen3 YaRN `rope_scaling` for 131072-token
|
| 31 |
serving.
|
| 32 |
- **Eval** (fixed 10-task synthetic attack/defend lab, agentic harness, 3 runs):
|
| 33 |
+
**mean 7.0/10** (runs: 7, 8, 6) -- best checkpoint. def-harden recovered to 3/3 after
|
| 34 |
+
verify-after-edit training; atk-sqli passes 1/3; atk-jwt/hash/bruteforce/webshell/
|
| 35 |
+
harden all solid at 3/3. Remaining flip-flop tasks: def-detect-dns, def-ioc, atk-re.
|
| 36 |
|
| 37 |
### Per-task pass rates (P across runs)
|
| 38 |
|
|
|
|
| 54 |
staged vulnerable app and fuzz it over HTTP instead of reading the offline artifacts
|
| 55 |
(trace-verified behavioral prior, targeted in round 5).
|
| 56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 57 |
## Usage
|
| 58 |
|
| 59 |
vLLM, short-task/eval serving (disable static YaRN):
|
|
|
|
| 84 |
| v2 | 149 traces | 6/10 single | failure-targeted r2 |
|
| 85 |
| v3 | 157 (135 unique) | 4.0/10 (4 runs) | parser-fixed harness baseline |
|
| 86 |
| v4 | 699 | 6.67/10 (3 runs) | GLM-5.2 scale-up, jwt fixed |
|
| 87 |
+
| v5 | 891 | 6.67/10 (3 runs: 4,8,8) | sqli breakthrough, ioc fixed; harden regressed (newline stripping) |
|
| 88 |
+
| **v6** | **1076** | **7.0/10 (3 runs: 7,8,6)** | harden fixed, webshell solid; detect-dns/ioc still flip-flop |
|
| 89 |
|
| 90 |
Weights are Apache-2.0 per the Qwen3 base; training traces were generated by GLM-5.2
|
| 91 |
and Kimi teachers and filtered by automated judging.
|