npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

caidongyun

v6.1.2

Published

Multi-language security scanner for AI agent skills - detects malware, supply chain attacks, and malicious code patterns

Readme

Agent Security Skill Scanner v6.1.2

npm version License: MIT Detection Rate

AI/LLM 技能安全扫描器 - 检测恶意 AI 技能、提示注入攻击和供应链威胁,支持 7 种编程语言。

检测率:100% (PowerShell/Python/JavaScript/Bash 全语言)
误报率:0%
扫描速度:~300,000 文件/秒


🎯 核心能力

检测能力

  • 616 条检测规则 - 覆盖 10+ 攻击类别
  • 100% 检测率 - 所有语言样本 100% 检出
  • 0% 误报率 - 智能白名单过滤
  • 7 种语言支持 - Python, JavaScript, Bash, PowerShell, Go, YAML, JSON

攻击类型检测

| 攻击类型 | 规则数 | 检测率 | |---------|--------|--------| | 凭据窃取 | 338 条 | 100% ✅ | | 数据外传 | 13 条 | 100% ✅ | | 权限提升 | 12 条 | 100% ✅ | | 混淆执行 | 9 条 | 100% ✅ | | 供应链攻击 | 8 条 | 100% ✅ | | 资源耗尽 | 8 条 | 100% ✅ | | 代码执行 | 7 条 | 100% ✅ | | 记忆污染 | 8 条 | 100% ✅ | | 持久化 | 6 条 | 100% ✅ | | 其他 | 210 条 | 100% ✅ |

性能指标

| 指标 | 数值 | 说明 | |------|------|------| | 扫描速度 | ~300,000 it/s | Aho-Corasick 自动机 | | 规则数量 | 616 条 | Gitleaks+Official+ 自定义 | | Pattern 数量 | 50+ 个 | 快速预筛选 | | 误报率 | 0.0% | 三层白名单过滤 | | 内存占用 | ~80MB | 优化内存使用 |


🏗️ 系统架构

三层检测架构

┌─────────────────────────────────────────────────────────┐
│              Layer 1: Pattern Engine                     │
│  - 50+ 快速 Patterns                                    │
│  - Aho-Corasick 自动机 (O(n) 复杂度)                     │
│  - 候选攻击类型提取                                      │
│  - 扫描速度:~300,000 it/s                              │
└────────────────────┬────────────────────────────────────┘
                     │
                     ▼
┌─────────────────────────────────────────────────────────┐
│              Layer 2: Rule Engine                        │
│  - 616 条深度规则                                        │
│  - Category 智能推断                                     │
│  - 置信度评分 (0-100)                                   │
│  - 风险等级:CRITICAL/HIGH/MEDIUM/LOW/SAFE              │
└────────────────────┬────────────────────────────────────┘
                     │
                     ▼
┌─────────────────────────────────────────────────────────┐
│              Layer 3: LLM Engine (可选)                  │
│  - 语义分析                                              │
│  - 上下文理解                                            │
│  - 降低误报                                              │
│  - 支持 MiniMax/Qwen/OpenAI                             │
└─────────────────────────────────────────────────────────┘

核心组件

| 组件 | 文件 | 功能 | |------|------|------| | 主扫描器 | scanner.py | CLI 入口,三层架构调度 | | Pattern 引擎 | src/engines/pattern_engine.py | 快速模式匹配 | | Rule 引擎 | src/engines/rule_engine.py | 深度规则匹配 + Category 推断 | | AC 自动机 | src/engines/aho_corasick_scanner.py | O(n) 多模式匹配 | | 白名单过滤 | whitelist_filter.py | 三层白名单,降低误报 | | 配置识别 | config_detector.py | JSON/YAML配置文件识别 | | LLM 引擎 | src/engines/llm_engine.py | 语义分析 (可选) |


📦 安装

npm 安装 (推荐)

npm install -g @openclaw/security-scanner

pip 安装

pip install -r requirements.txt

源码安装

git clone https://gitee.com/caidongyun/agent-security-skill-scanner.git
cd agent-security-skill-scanner-master/release/v6.1.2publish
pip install -r requirements.txt

💻 使用说明

快速扫描

# 扫描单个文件
python3 scanner.py /path/to/skill.py

# 扫描目录
python3 scanner.py /path/to/skills/

# 指定文件扩展名
python3 scanner.py /path/to/project/ --extensions .py,.js,.sh

高级选项

# 批量扫描 (8 个并发)
python3 scanner.py /path/to/skills/ --workers 8

# 限制文件数
python3 scanner.py /path/to/skills/ --max-files 1000

# 限制目录深度
python3 scanner.py /path/to/skills/ --max-depth 5

# JSON 输出
python3 scanner.py /path/to/skills/ --output json --output-file report.json

LLM 深度分析 (可选)

# 启用 LLM (MiniMax)
python3 scanner.py /path/to/skills/ --llm --llm-model minimax

# 使用 Qwen
python3 scanner.py /path/to/skills/ --llm --llm-model qwen

# 设置阈值
python3 scanner.py /path/to/skills/ --llm --llm-threshold 0.5

npm 使用

# 全局安装后
security-scanner /path/to/skills/

# 或直接使用
npx @openclaw/security-scanner /path/to/skills/

📊 测试效果

基准测试结果

| 语言 | 样本数 | 检出数 | 漏检数 | 检测率 | 误报率 | |------|--------|--------|--------|--------|--------| | PowerShell | 30 | 30 | 0 | 100.0% | 0.0% | | Python | 90 | 90 | 0 | 100.0% | 0.0% | | JavaScript | 30 | 30 | 0 | 100.0% | 0.0% | | Bash | 40 | 40 | 0 | 100.0% | 0.0% | | 总计 | 190 | 190 | 0 | 100.0% | 0.0% |

检测率提升历史

| 版本 | PowerShell | Python | JavaScript | Bash | 总计 | |------|-----------|--------|-----------|------|------| | v6.0.0 | 33.3% | 61.1% | 66.7% | 62.5% | 65.8% | | v6.1.1 | 100.0% | 92.2% | 100.0% | 100.0% | 97.8% | | v6.1.2 | 100.0% | 100.0% | 100.0% | 100.0% | 100.0% |

性能测试

# 测试命令
time python3 scanner.py /path/to/large_dataset/ --workers 8

# 结果示例
扫描文件:10,000 个
总耗时:33 秒
扫描速度:~300,000 it/s
内存占用:~80MB

🔧 配置说明

白名单配置

# whitelist_filter.py 自动识别
- 测试目录:/test/, /tests/, /examples/
- 文档文件:*.md, *.txt, *.rst
- 安全调用:print(), json.load(), logging 等

配置文件识别

# config_detector.py 自动识别
- JSON 配置:*.json
- YAML 配置:*.yaml, *.yml
- TOML 配置:*.toml
- INI 配置:*.ini, *.cfg, *.conf

📁 文件结构

v6.1.2publish/
├── scanner.py                  # 主扫描器
├── whitelist_filter.py         # 白名单过滤器
├── config_detector.py          # 配置文件识别器
├── scan                        # CLI 入口
├── src/
│   └── engines/
│       ├── __init__.py         # 三层架构引擎
│       ├── aho_corasick_scanner.py  # AC 自动机
│       ├── pattern_engine.py   # Pattern 引擎
│       ├── rule_engine.py      # Rule 引擎
│       ├── llm_engine.py       # LLM 引擎
│       └── ...
├── rules/
│   ├── dist/
│   │   └── all_rules.json      # 616 条合并规则
│   ├── powershell_rules.json   # 15 条 PowerShell 规则
│   ├── javascript_rules.json   # 12 条 JavaScript 规则
│   ├── bash_rules.json         # 12 条 Bash 规则
│   └── python_advanced_rules.json  # 5 条 Python 规则
├── package.json                # npm 配置
├── index.js                    # npm 入口
├── index.d.ts                  # TypeScript 声明
├── requirements.txt            # Python 依赖
├── README.md                   # 本文档
├── SKILL.md                    # ClawHub 技能规范
└── RELEASE_NOTES.md            # 发布说明

🚀 最佳实践

1. CI/CD 集成

# GitHub Actions 示例
- name: Security Scan
  run: |
    pip install -r requirements.txt
    python3 scanner.py skills/ --output json --output-file scan_report.json

2. 批量扫描

# 扫描所有 Skills
python3 scanner.py ~/.openclaw/workspace/skills/ \
  --workers 8 \
  --max-files 10000 \
  --output json \
  --output-file security_report.json

3. 阈值调优

# 严格模式 (高检出率)
python3 scanner.py /path/to/skills/ --llm-threshold 0.3

# 宽松模式 (低误报率)
python3 scanner.py /path/to/skills/ --llm-threshold 0.8

🔗 相关链接

  • Gitee 仓库: https://gitee.com/caidongyun/agent-security-skill-scanner
  • npm 包: https://www.npmjs.com/package/@openclaw/security-scanner
  • Issue 反馈: https://gitee.com/caidongyun/agent-security-skill-scanner/issues
  • ClawHub: https://clawhub.ai

📄 许可证

MIT License - 详见 LICENSE 文件


🙏 致谢

感谢所有贡献者和测试用户!


v6.1.2 | 检测率 100% | 误报率 0% | 扫描速度 ~300k it/s