面向 AI Agent Skill 的离线静态扫描器:读 SKILL.md 与随附脚本,输出 Trust Score、grade、findings(含稳定规则 ID 与 文件:行号)。纯标准库、无网络、无遥测。
pip install lgd-skillgate # PyPI 0.1.0 或从源码:
git clone -b docs/reproduce-20261121 --depth 1 https://github.com/LGD-Eval/lgd-gate.git cd lgd-gate/audit/20261121/reproduce/lgd-skillgate-cli python -m venv .venv && pip install . # Windows: .venv\Scripts\activate 三条命令(陌生人可照抄) # 1) 恶意示例:期望 grade D / trust 40 / 命中 MD001 + CR010 / exit 1 lgd-skillgate scan examples/malicious --format json # 2) 良性示例:期望 grade A / trust 82 / findings 0 / exit 0 lgd-skillgate scan examples/benign --format json # 3) 终端可读报告 lgd-skillgate scan examples/malicious CI 用法:lgd-skillgate scan ./skills --fail-under 70,低于阈值即 exit 1。
# 需要本机有 Ollama(或任何兼容 /api/chat 的端点) lgd-skillgate semantic examples/malicious --model qwen3.5:4b lgd-skillgate semantic examples/malicious --format json 硬约束:模型给出的每条发现都必须携带 evidence_quote,且该引文要能在原文里逐字定位,程序回填 文件:行号 后才保留;定位不到就丢弃。实测:恶意示例 2 条(SKILL.md:5 的提示注入与私钥外传),3 次运行结论一致,良性示例 0 条,丢弃 0 条。
代价要写清:本层调用模型,非确定性,输出固定标 deterministic=false;静态层仍是默认路径,保持离线、零依赖、逐字节可复现。
规则条数(修正后的口径):可触发规则 ID 共 186 条 = 源码字面量 180 条 + 动态生成 6 条(AST001/004/006/007/013、TAINT02)。0.1.0 写的"174 条"是低估,已更正;逐条清单见仓库 rule_registry_v2_20261122.json。
自建语料覆盖:114 个样本实际只压到 33 条规则(占 186 条的 17.7%),另有 153 条从未被触发——这是真实盲区,写在 corpus_rule_coverage_20261122.json。
agent skill security static-analysis scanner
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.
Nov 22, 2026 1 release file No provenance
Nov 21, 2026 1 release file No provenance




