BreakFeelingAether commited on
Commit
ff21265
·
verified ·
1 Parent(s): 721f098

Upload aetherargus_README.md

Browse files
Files changed (1) hide show
  1. aetherargus_README.md +294 -0
aetherargus_README.md ADDED
@@ -0,0 +1,294 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ base_model:
4
+ - Qwen/Qwen3-4B-Instruct-2507
5
+ base_model_relation: finetune
6
+ library_name: transformers
7
+ pipeline_tag: text-generation
8
+ language:
9
+ - zh
10
+ - en
11
+ tags:
12
+ - qlora
13
+ - peft
14
+ - cybersecurity
15
+ - security
16
+ - intrusion-detection
17
+ - structured-output
18
+ - json
19
+ - gguf
20
+ - ollama
21
+ - aetherguard
22
+ - aetherargus
23
+ ---
24
+
25
+ # AetherArgus-4B
26
+
27
+ **AetherArgus** 是 AetherGuard 平台面向 HTTP 请求与安全事件研判训练的本地安全判定模型。模型基于 **Qwen3-4B-Instruct-2507**,使用 QLoRA 完成领域对齐,主要输出攻击判定、攻击家族、风险等级、证据和建议动作。
28
+
29
+ > 当前版本为研究与预览版本,适合实验、演示、离线评估和影子研判。它不应在缺少规则引擎、人工复核与安全闸门的情况下直接执行生产自动阻断。
30
+
31
+ ## Model summary
32
+
33
+ - **Model name:** AetherArgus-4B
34
+ - **Base model:** `Qwen/Qwen3-4B-Instruct-2507`
35
+ - **Base revision:** `cdbee75f17c01a7cc42f958dc650907174af0554`
36
+ - **Training method:** QLoRA / PEFT LoRA
37
+ - **Primary language:** Chinese, with limited English input support
38
+ - **Primary task:** Structured security verdict generation
39
+ - **Project:** AetherGuard
40
+ - **Status:** Preview / research
41
+
42
+ AetherArgus 的目标不是替代 WAF、IDS、规则检测或硬件安全门,而是为这些系统增加一个可本地部署的语义研判层。
43
+
44
+ ## Intended input
45
+
46
+ 模型接收标准化的 HTTP 请求、安全上下文和规则信号,例如:
47
+
48
+ ```json
49
+ {
50
+ "method": "GET",
51
+ "path": "/api/fetch",
52
+ "query": "url=http://127.0.0.1/admin",
53
+ "headers": {
54
+ "content-type": "application/json"
55
+ },
56
+ "body": "",
57
+ "sourceContext": {
58
+ "requestsLastMinute": 3,
59
+ "distinctPathsLastMinute": 1,
60
+ "recentFailureCount": 0,
61
+ "historicalRiskScore": 0.2
62
+ },
63
+ "ruleSignals": []
64
+ }
65
+ ```
66
+
67
+ ## Output contract
68
+
69
+ 除专门的演示配置外,检测端点应只接受以下严格 JSON 输出:
70
+
71
+ ```json
72
+ {
73
+ "verdict": "malicious",
74
+ "confidence": 0.96,
75
+ "attackFamily": "ssrf",
76
+ "severity": "critical",
77
+ "reasoning": "请求通过服务端资源获取接口访问本地管理地址,具有明确的 SSRF 风险",
78
+ "evidence": [
79
+ {
80
+ "field": "query",
81
+ "value": "url=http://127.0.0.1/admin",
82
+ "reason": "参数包含本地管理地址"
83
+ }
84
+ ],
85
+ "recommendedAction": "block"
86
+ }
87
+ ```
88
+
89
+ ### Allowed values
90
+
91
+ - `verdict`: `safe`, `suspicious`, `malicious`, `unknown`
92
+ - `attackFamily`: `benign`, `sqli`, `xss`, `command_injection`, `path_traversal`, `ssrf`, `authentication`, `automation`, `api_abuse`, `deserialization`, `file_upload`, `protocol_attack`, `business_logic`, `other`
93
+ - `severity`: `low`, `medium`, `high`, `critical`
94
+ - `recommendedAction`: `allow`, `monitor`, `challenge`, `block`
95
+
96
+ 解析失败、Schema 校验失败或证据不足时,调用方应按 fail-safe 原则返回 `unknown`,不得自动修补为 `safe`。
97
+
98
+ ## Training data
99
+
100
+ 本次训练使用 1,200 条经过标准化、去重和分组切分的安全判定样本:
101
+
102
+ | Split | Samples |
103
+ |---|---:|
104
+ | Train | 958 |
105
+ | Validation | 122 |
106
+ | Test | 120 |
107
+
108
+ 类别目标分布:
109
+
110
+ | Category | Samples | Ratio |
111
+ |---|---:|---:|
112
+ | Attack | 420 | 35% |
113
+ | Normal | 420 | 35% |
114
+ | Hard negative | 240 | 20% |
115
+ | Unknown | 120 | 10% |
116
+
117
+ 重要说明:
118
+
119
+ - 训练和测试语料主要来自合成安全数据及确定性辅助模板。
120
+ - 数据集尚未经过独立双人安全标注。
121
+ - 切分按规范化 payload 模板、CVE、攻击家族、编码方式、来源场景和相似内容哈希分组。
122
+ - 当前 manifest 未检测到跨 split 的共享泄漏组或完全相同内容。
123
+ - 这些数据不能代表真实生产流量的完整分布。
124
+
125
+ ## Training configuration
126
+
127
+ | Item | Value |
128
+ |---|---|
129
+ | Epochs | 1 |
130
+ | Max sequence length | 768 |
131
+ | LoRA rank | 8 |
132
+ | LoRA alpha | 16 |
133
+ | LoRA dropout | 0.05 |
134
+ | Learning rate | `1e-4` |
135
+ | Batch size | 1 |
136
+ | Gradient accumulation | 16 |
137
+ | Quantization | 4-bit NF4 + double quantization |
138
+ | Compute dtype | BF16 |
139
+ | Optimizer | `paged_adamw_8bit` |
140
+ | Loss | Assistant-only causal language modeling |
141
+
142
+ 实测训练环境:
143
+
144
+ - NVIDIA GeForce RTX 5070 Ti Laptop GPU
145
+ - 11.94 GiB VRAM
146
+ - 训练阶段峰值已分配显存约 5.38 GiB
147
+ - 1 epoch 训练约 651 秒,验证约 24 秒
148
+
149
+ ## Evaluation
150
+
151
+ 以下指标来自同一套固定的 **120 条合成测试样本**,`do_sample=false`,随机种子为 42。指标只反映当前实验集表现,不能直接解释为生产环境准确率。
152
+
153
+ ### HF LoRA / PEFT
154
+
155
+ | Metric | Result |
156
+ |---|---:|
157
+ | Verdict accuracy | 0.9000 |
158
+ | Malicious precision | 0.8810 |
159
+ | Malicious recall | 0.9024 |
160
+ | Malicious F1 | 0.8916 |
161
+ | Normal false-positive rate | 0.0455 |
162
+ | JSON syntax success | 0.9917 |
163
+ | Schema valid rate | 0.9833 |
164
+ | Attack-family macro F1 | 0.6147 |
165
+ | Recommended-action accuracy | 0.9000 |
166
+
167
+ ### GGUF Q4_K_M / Ollama
168
+
169
+ | Metric | Result |
170
+ |---|---:|
171
+ | Verdict accuracy | 0.8417 |
172
+ | Malicious precision | 0.7170 |
173
+ | Malicious recall | 0.9268 |
174
+ | Malicious F1 | 0.8085 |
175
+ | Normal false-positive rate | 0.1970 |
176
+ | JSON syntax success | 1.0000 |
177
+ | Schema valid rate | 0.9833 |
178
+ | Attack-family macro F1 | 0.5193 |
179
+ | Average latency | 869 ms |
180
+
181
+ Q4_K_M 版本推理明显更快,但对正常与硬负样本的误报显著增加。高精度场景优先使用原始 LoRA、合并模型或更高精度的 GGUF 量化,并重新独立评测。
182
+
183
+ ## Load the LoRA adapter
184
+
185
+ 由于该仓库当前为私有仓库,使用前需要先登录 Hugging Face:
186
+
187
+ ```bash
188
+ hf auth login
189
+ ```
190
+
191
+ 参考加载方式:
192
+
193
+ ```python
194
+ import torch
195
+ from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
196
+ from peft import PeftModel
197
+
198
+ base_model_id = "Qwen/Qwen3-4B-Instruct-2507"
199
+ adapter_id = "BreakFeelingAether/aetherargus"
200
+
201
+ quantization_config = BitsAndBytesConfig(
202
+ load_in_4bit=True,
203
+ bnb_4bit_quant_type="nf4",
204
+ bnb_4bit_use_double_quant=True,
205
+ bnb_4bit_compute_dtype=torch.bfloat16,
206
+ )
207
+
208
+ tokenizer = AutoTokenizer.from_pretrained(adapter_id, use_fast=True)
209
+ base_model = AutoModelForCausalLM.from_pretrained(
210
+ base_model_id,
211
+ quantization_config=quantization_config,
212
+ torch_dtype=torch.bfloat16,
213
+ device_map="auto",
214
+ )
215
+ model = PeftModel.from_pretrained(base_model, adapter_id)
216
+ model.eval()
217
+ ```
218
+
219
+ 建议使用与训练阶段一致的 system prompt,并在调用端执行严格 JSON Schema 校验。模型输出无效时应回退为 `unknown + monitor`。
220
+
221
+ ## Ollama / GGUF
222
+
223
+ 当仓库中包含 GGUF 和 `Modelfile` 时,可下载后创建本地 Ollama 模型:
224
+
225
+ ```bash
226
+ ollama create aetherargus -f Modelfile
227
+ ```
228
+
229
+ 推理示例:
230
+
231
+ ```bash
232
+ ollama run aetherargus '{"method":"GET","path":"/api/fetch","query":"url=http://127.0.0.1/admin","headers":{},"body":"","sourceContext":{},"ruleSignals":[]}'
233
+ ```
234
+
235
+ 生产检测配置不应加入“身份询问时返回自然语言”等例外逻辑,否则请求正文可能诱导模型偏离 JSON 输出协议。
236
+
237
+ ## Recommended deployment pattern
238
+
239
+ 推荐采用影子模式逐步接入:
240
+
241
+ ```text
242
+ Incoming request
243
+ ├─ Existing rules / WAF / IDS continue to operate
244
+ └─ AetherArgus produces a shadow verdict for logging and evaluation
245
+ ```
246
+
247
+ 在真实流量上完成独立评估前:
248
+
249
+ - 不让模型直接执行阻断、断网、删除或修复操作。
250
+ - 不绕过现有规则引擎、策略签名、硬件授权和 fail-closed 安全门。
251
+ - 不将解析失败视为安全。
252
+ - 对高风险动作保留人工或硬件级授权。
253
+
254
+ ## Known limitations
255
+
256
+ 1. 当前训练与测试数据以合成数据为主,缺少大规模真实脱敏流量验证。
257
+ 2. 测试集仅 120 条,部分攻击家族样本数很少,分类别指标方差较大。
258
+ 3. `api_abuse`、`file_upload`、业务逻辑攻击和复杂上下文型事件仍需更多高质量数据。
259
+ 4. Q4_K_M 量化明显提高了正常流量误报率。
260
+ 5. 模型可能受到提示词注入、日志投毒、混淆编码和分布外输入影响。
261
+ 6. `recommendedAction` 只是建议,不是可直接执行的安全策略。
262
+ 7. 该模型不是通用聊天模型,也不是漏洞利用或攻击执行模型。
263
+
264
+ ## Safety and acceptable use
265
+
266
+ AetherArgus 用于授权环境下的防御性安全研究、流量研判和风险辅助分析。使用者应确保拥有处理相关日志、请求和资产数据的合法权限,并遵守适用的数据保护、网络安全、出口管制和软件许可要求。
267
+
268
+ 禁止将本模型用于:
269
+
270
+ - 未经授权的入侵、扫描或攻击;
271
+ - 凭据窃取、恶意软件部署或规避追踪;
272
+ - 将模型判定作为缺少复核机制的唯一高风险决策依据;
273
+ - 上传包含真实 Token、Cookie、API Key、客户隐私或商业秘密的数据。
274
+
275
+ ## License and attribution
276
+
277
+ 本仓库按 **Apache License 2.0** 发布。AetherArgus 基于 `Qwen/Qwen3-4B-Instruct-2507` 微调,使用时仍需遵守基座模型许可证及其适用条款。
278
+
279
+ 推荐引用方式:
280
+
281
+ ```text
282
+ AetherArgus-4B, an AetherGuard security-domain model fine-tuned from
283
+ Qwen3-4B-Instruct-2507 using QLoRA.
284
+ ```
285
+
286
+ ## Project links
287
+
288
+ - Source project: `lizuyi-6/Networksafe`
289
+ - Model repository: `BreakFeelingAether/aetherargus`
290
+
291
+ ## Version
292
+
293
+ - **Current release:** AetherArgus-4B Preview 0.1
294
+ - **Last model evaluation:** 2026-07-28