random1st commited on
Commit
4f88278
·
verified ·
1 Parent(s): 96c7493

Update model card: Qwen3-0.6B fine-tuned v2

Browse files
Files changed (1) hide show
  1. README.md +60 -11
README.md CHANGED
@@ -1,25 +1,74 @@
1
  ---
2
- license: other
3
- license_name: apache-2.0-commons-clause
4
- license_link: https://github.com/diana-random1st/secguard/blob/main/LICENSE
 
 
 
 
 
 
 
 
 
5
  ---
6
 
7
- # secguard-models
8
 
9
- GGUF models for [secguard](https://github.com/diana-random1st/secguard) 3-level security toolkit for AI agents.
10
 
11
- ## Models
12
 
13
- | File | Size | Purpose |
14
- |------|------|---------|
15
- | secguard-guard.gguf | 774MB | Destructive command classifier (Qwen3.5-2B-Q8) |
 
 
 
 
 
16
 
17
- ## Install
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
  ```bash
 
20
  secguard model
 
 
21
  ```
22
 
 
 
 
 
 
 
 
23
  ## License
24
 
25
- Apache 2.0 + Commons Clause. See [LICENSE](https://github.com/diana-random1st/secguard/blob/main/LICENSE).
 
1
  ---
2
+ language: en
3
+ license: apache-2.0
4
+ tags:
5
+ - security
6
+ - shell-commands
7
+ - safety-classifier
8
+ - gguf
9
+ - qwen3
10
+ datasets:
11
+ - ML4Net/SSH-Shell-Attacks
12
+ - TellinaTool/nl2bash
13
+ pipeline_tag: text-classification
14
  ---
15
 
16
+ # secguard-guard — Shell Command Safety Classifier
17
 
18
+ Binary classifier for shell commands: **safe** vs **destructive**.
19
 
20
+ ## Model Details
21
 
22
+ | Property | Value |
23
+ |----------|-------|
24
+ | Base model | [Qwen/Qwen3-0.6B](https://huggingface.co/Qwen/Qwen3-0.6B) |
25
+ | Fine-tuning | LoRA (rank 8, 1.4M trainable params / 596M total) |
26
+ | Quantization | Q8_0 (GGUF) |
27
+ | Size | 610 MB |
28
+ | Context | 512 tokens |
29
+ | Inference | llama.cpp / llama-cpp-rs |
30
 
31
+ ## Training
32
+
33
+ - **Dataset**: 21,430 labeled examples (balanced 50/50)
34
+ - **Destructive** (10,715): SSH-Shell-Attacks honeypot commands (ML4Net, 408K sessions) + synthetic SaaS CLI patterns
35
+ - **Safe** (10,715): NL2Bash corpus (12.6K real admin commands) + synthetic dev/ops commands
36
+ - **Method**: MLX LoRA, 8 layers, batch 4, lr 1e-4, 750 iterations
37
+ - **Loss**: Train 0.43, Val 0.428 (best checkpoint at iter 400)
38
+ - **Hardware**: Apple Silicon (M-series), ~5 minutes training
39
+
40
+ ## What it detects
41
+
42
+ Commands the model learns to classify as **destructive**:
43
+ - File deletion (`rm -rf`, `find -delete`, `shred`)
44
+ - Git history rewriting (`push --force`, `reset --hard`, `rebase`, `filter-branch`)
45
+ - Database destruction (`DROP TABLE`, `FLUSHALL`, `db.dropDatabase()`)
46
+ - Cloud resource deletion (`aws s3 rm`, `gcloud delete`, `terraform destroy`)
47
+ - Remote code execution (`curl | bash`, `wget | sh`)
48
+ - Container/k8s cleanup (`docker system prune`, `kubectl delete namespace`)
49
+ - SaaS destructive ops (`stripe cancel`, `heroku apps:destroy`)
50
+
51
+ ## Usage with secguard
52
+
53
+ This model is Phase 3 (ML brain) in secguard's three-phase guard:
54
+ 1. **Policy allowlist** — known-safe commands (zero latency)
55
+ 2. **Heuristic rules** — 40+ regex patterns (zero latency)
56
+ 3. **ML brain** — this model (catches what rules miss)
57
 
58
  ```bash
59
+ # Download
60
  secguard model
61
+
62
+ # The model is used automatically when built with --features ml
63
  ```
64
 
65
+ ## Limitations
66
+
67
+ - Trained on English commands only
68
+ - SSH honeypot data may not represent all attack vectors
69
+ - 0.6B model — may miss nuanced or novel destructive patterns
70
+ - Confidence threshold: 85% (tunable in secguard config)
71
+
72
  ## License
73
 
74
+ Apache 2.0