amwangfan/privacy-gateway-v4-qwen2.5-0.5b
Qwen2.5-0.5B-Privacy-Gateway-v4 (step-220)
简体中文 | English
网关: https://github.com/amwangfan/privacy-gateway
本地隐私网关的残差 SECRET / SAFE 分类器。三层分工:Layer 0 只抓形态极稳的 sk- / PEM / JWT / ghp_ / AKIA / 带口令的 URI;password= 只是把右边的值送进模型,不是硬替换;本 LoRA 给漏网 span 打分。弱口令 Layer 1 可以判 SAFE(漏了就漏了),不要打开「凡是 password= 就替换」。
- 只训 attention / MLP(不含 `lm_head`),r=16,α=32
- 检查点:step-220(v6.2 再平衡),合并为 N100 用的 F16 / Q8 GGUF
- 训练与线上同一套短 prompt:
Secret? k={key} v={span} c={ctx} ->
Secret? v={span} c={ctx} ->- 下一 token:
SECRET=65310,SAFE=83788 - 空
c=→ SAFE。生产环境:有键用c=env file,无键残差用c=bearer token。
启用探针(只卡假阳性)
网关 auto 模式仅当所有 SAFE 用例仍判 SAFE 才启用本模型(ok = negatives_kept == n_neg)。
- 名字、路径、备份名、版本号、session id 不得被标成 SECRET。
- 弱口令(如
mysql_root_password_2026)Layer 0 拦不住(对不上硬正则);Layer 1 判 SAFE 就会出网。这是预期,不是 bug。 - Layer 0 已覆盖的形态(
sk-…、JWTeyJ…)不要求 Layer 1 抓全。
N100 实测(F16,2026-09-18):negatives_kept=12/12,positives_caught=2/6,decision=model。
文件
本仓库不含训练 jsonl 与真实凭据。
相关链接
- 网关:amwangfan/privacy-gateway
- DSH 插件:amwangfan/dsh-privacy-guard
- v3:amwangfan/Qwen2.5-0.5B-Privacy-Gateway-v3-LoRA
- 基座:Qwen/Qwen2.5-0.5B-Instruct
Apache-2.0
<a id="english"></a>
Qwen2.5-0.5B-Privacy-Gateway-v4 (step-220)
简体中文 | English
Gateway: https://github.com/amwangfan/privacy-gateway
Residual SECRET / SAFE classifier for a local privacy gateway. Three layers: Layer 0 only matches stable shapes (sk- / PEM / JWT / ghp_ / AKIA / password-in-URI). password= forwards the RHS to this model; it is not a hard replace. Weak passwords may be SAFE here (a miss is a miss). Do not enable “replace everything after password=”.
- LoRA on attention/MLP only (no `lm_head`), r=16, α=32
- Checkpoint: step-220 (v6.2 rebalance), merged to F16/Q8 GGUF for N100
- Train == serve prompt:
Secret? k={key} v={span} c={ctx} ->
Secret? v={span} c={ctx} ->- Next-token ids:
SECRET=65310,SAFE=83788 - Empty
c=→ SAFE. Production usesc=env file(keyed) orc=bearer token(keyless residual).
Readiness probe (FPR only)
The gateway auto mode enables this model iff every SAFE probe case stays SAFE (ok = negatives_kept == n_neg).
- Names, paths, backups, versions, session ids must not be flagged.
- Weak passwords (e.g.
mysql_root_password_2026) are not Layer 0; if Layer 1 says SAFE they leave the host. That is expected. - Layer-0-shaped tokens (
sk-…, JWTeyJ…) are not required of Layer 1.
Live N100 (F16, 2026-09-18): negatives_kept=12/12, positives_caught=2/6, decision=model.
Files
Training jsonl and real credentials are not in this repo.
Related
- Gateway: amwangfan/privacy-gateway
- DSH plugin: amwangfan/dsh-privacy-guard
- v3: amwangfan/Qwen2.5-0.5B-Privacy-Gateway-v3-LoRA
- Base: Qwen/Qwen2.5-0.5B-Instruct
Apache-2.0
