Skill flagged — suspicious patterns detected

ClawHub Security flagged this skill as suspicious. Review the scan results before using.

Windows Api Monitor

v1.0.0

监控并统计Windows环境下OpenClaw API调用,支持实时分析、历史追踪及阈值告警,生成多维度使用报告。

0· 88·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for guowaa223/windows-api-monitor.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "Windows Api Monitor" (guowaa223/windows-api-monitor) from ClawHub.
Skill page: https://clawhub.ai/guowaa223/windows-api-monitor
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install windows-api-monitor

ClawHub CLI

Package manager switcher

npx clawhub@latest install windows-api-monitor
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Suspicious
medium confidence
Purpose & Capability
Name/description claim to monitor OpenClaw API usage on Windows and the code indeed reads ~/.openclaw logs and computes usage/costs — that is coherent. However SKILL.md references Windows Event Logs and several scripts (PowerShell/batch and other Python modules like report_generator.py, alerts.py, realtime_monitor.py) that are not present in the manifest. The SKILL.md also claims Windows-native features while most code uses the user's home .openclaw paths (which is workable on Windows but is not explicitly adjusted). Overall purpose aligns but the documentation and file manifest mismatch and extra claimed features are unexplained.
!
Instruction Scope
Runtime instructions tell the agent/user to run Python/PowerShell/batch scripts that read ~/.openclaw/logs and cache model_usage JSON. The code will read and parse log contents and write reports and state files under the skill workspace (reports/, state/). That can include full log lines or JSON entries that may contain user prompts, responses, or other sensitive data. SKILL.md states the skill 'only monitors OpenClaw API usage' and recommends redaction/encryption, but the code does not enforce encryption and default config enables include_details=true and log_redaction=true in settings (redaction appears to be a configuration flag, but I found no evidence of enforced redaction in the parser code). SKILL.md instructs running scripts (e.g., scripts/check_api.ps1, scripts/check_api_fixed.bat) that are not present. Also parts of included Python files appear truncated/buggy (a stray 'p' in api_monitor.py and references to functions/classes that are not defined in the visible code), meaning runtime behavior could fail or behave unexpectedly.
Install Mechanism
There is no install spec (instruction-only), so nothing new is downloaded or executed by an installer. The code bundle is present and intended to be run by the local Python interpreter; this is lower install risk than remote downloads. The SKILL.md states Python 3.8+ is required, but this is not enforced by a platform install step.
Credentials
The skill requests no environment variables or external credentials by default. Configuration supports SMTP credentials and webhook URLs (empty by default) which would allow external notification; those are optional but present in config/settings.yaml. The presence of fields for SMTP username/password and webhook URL is plausible for alerting, but if a user populates those, the skill will be capable of sending parsed log contents externally. Default settings do not require credentials, but the capability to exfiltrate exists if configured.
Persistence & Privilege
The skill does not request always:true and does not attempt to modify other skills. It stores its own state and reports under its workspace (state/, reports/) which is expected for a monitoring tool. Autonomous invocation is allowed by platform defaults and not by itself a red flag here.
Scan Findings in Context
[pre_scan_injection_signals_none] expected: Static pre-scan reported no injection signals. That is consistent with a mostly-local Python utility, but absence of scanner flags does not guarantee safety.
[missing_files_referenced_in_SKILL_md] unexpected: SKILL.md references scripts (check_api.ps1, check_api_fixed.bat, realtime_monitor.py, report_generator.py, alerts.py) and docs that are not present in the file manifest; this mismatch is unexpected and reduces confidence in the package.
[potential_sensitive_data_collection] expected: The skill reads OpenClaw logs (~/.openclaw/logs) and may include full log content in reports (config includes include_details=true). Collecting logs is expected for usage monitoring, but these logs often contain prompts/responses; storing or sending them without enforced redaction/privacy controls is a privacy risk.
[code_truncation_or_syntax_issue] unexpected: Some included files appear truncated or contain stray characters (e.g., an isolated 'p' in api_monitor.py before truncation) and some referenced functions/classes (e.g., check_and_alert) are not present in the visible code; this indicates the distributed code may be incomplete or buggy.
[external_notification_capability] expected: Config allows SMTP/webhook notifications (reasonable for alerts). This capability is expected but means if a user configures webhook/email creds, parsed log data could be sent externally — the presence of this capability is expected for alerting but requires user caution.
What to consider before installing
This skill generally matches its stated purpose (reading OpenClaw logs to report API usage), but I recommend caution before running it on a machine with sensitive prompts or private data. Actionable steps: - Inspect the repository locally before running: open the scripts to confirm no unexpected network calls or obfuscation. Pay special attention to any code that uses requests, urllib, smtplib, or subprocess to call external endpoints. - Note the manifest/documentation mismatch: SKILL.md references several scripts that are not included. That suggests the package may be incomplete or stale — expect runtime errors. - Because the tool reads ~/.openclaw/logs and can include detailed logs in reports (include_details=true), assume reports may contain sensitive prompts/responses. If you must run it, either set include_details=false and set security.encrypt_sensitive=true (and verify the code actually performs encryption/redaction) or run the tool on a copy of the logs that you have redacted. - The config supports webhook/email alerts. Do not configure webhook URLs or SMTP credentials unless you trust the destination; test in a local, isolated environment (VM) first. - Consider running the scripts in a sandbox/VM account with limited data (or on a non-production machine) and review generated reports in reports/ before allowing persistent scheduling (Task Scheduler or continuous mode). - If you rely on this skill for production monitoring, obtain a complete, verified release that contains the missing referenced files and fix the apparent code truncation/bugs; otherwise treat this package as untrusted.

Like a lobster shell, security has layers — review code before you run it.

latestvk97cg73ft3cefj6vx26dsb3xhn83w0b9
88downloads
0stars
1versions
Updated 4w ago
v1.0.0
MIT-0

Windows专用API使用监控技能

概述

这是一个专门为Windows环境设计的API使用监控技能,用于替代依赖macOS CodexBar的model-usage技能。它直接读取OpenClaw日志文件来统计模型使用情况,实现"严格控制API使用效率"的目标。

技能信息

  • 名称: windows-api-monitor
  • 版本: 1.0.0
  • 作者: 阿康的私人助理
  • 创建日期: 2026-03-22
  • 适用平台: Windows (Windows 10/11)
  • 依赖: Python 3.8+, OpenClaw v1.0+

功能特性

Windows原生支持 - 针对Windows文件系统和日志结构优化 ✅ 实时监控 - 支持实时或定期模型使用统计 ✅ 多维度分析 - 按模型、按会话、按时间统计 ✅ 效率报告 - 生成简洁易读的使用报告 ✅ 历史追踪 - 追踪历史使用趋势 ✅ 告警机制 - 可设置使用阈值告警

安装说明

无需额外安装,技能已配置完整:

技能位置: C:\Users\Administrator\.openclaw\workspace\skills\windows-api-monitor

使用方法

基础命令

# 1. 查看当前会话的API使用情况
python scripts/api_monitor.py --mode current

# 2. 查看今日使用统计
python scripts/api_monitor.py --mode today

# 3. 查看本周使用统计
python scripts/api_monitor.py --mode week

# 4. 查看所有会话统计
python scripts/api_monitor.py --mode all

# 5. 按模型排序查看
python scripts/api_monitor.py --mode all --sort cost

# 6. 查看指定模型的详细使用
python scripts/api_monitor.py --model deepseek-ai

# 7. 生成使用报告文件
python scripts/api_monitor.py --mode all --output report.txt

高级功能

# 1. 设置使用阈值告警(例如:每100次调用告警)
python scripts/api_monitor.py --alerts --threshold 100

# 2. 查看成本最高的会话
python scripts/api_monitor.py --mode sessions --limit 10

# 3. 导出为JSON格式(用于自动化处理)
python scripts/api_monitor.py --mode today --format json

# 4. 清理旧日志文件
python scripts/api_monitor.py --cleanup --days 30

自动检查 - "够用/不够用"判断 (Windows编码兼容版)

专为"严格控制API调用"需求设计,自动判断剩余量:

一键检查命令(最简单)

# 方法1:运行PowerShell脚本(推荐)
scripts/check_api.ps1

# 方法2:运行批处理脚本
scripts/check_api_fixed.bat

# 方法3:Python命令
python scripts/auto_checker.py --simple --both

自动判断功能 (Windows兼容)

# 1. 简单检查(够用/不够用 + 剩余量)
python scripts/auto_checker.py --simple --both
# 输出示例:
# [今日] [OK] 充足 - 剩余量充足,可放心使用 (剩余85.0%)
# [本周] [OK] 充足 - 本周剩余量充足 (剩余72.5%)

# 2. 详细报告
python scripts/auto_checker.py --report --both

# 3. 持续自动监控(每30分钟检查一次)
python scripts/auto_monitor.py --continuous --interval 30

# 4. JSON格式(适合自动化处理)
python scripts/auto_checker.py --json

# 5. 仅显示告警
python scripts/auto_checker.py --alerts

输出说明 (Windows编码兼容)

  • [OK] 够用: 剩余量 > 20%
  • [WARN] 不够用: 剩余量 ≤ 20%
  • [ERROR] 耗尽: 剩余量 ≤ 0%

剩余量显示 (Windows编码兼容)

  • 剩余百分比: 85.0%
  • 剩余调用次数: 850次
  • 剩余令牌数: 850,000
  • 预计可用天数: 7天

自动化监控

# 每日定时监控(可添加到计划任务)
python scripts/daily_check.py

# 实时监控模式(持续监控API使用)
python scripts/auto_monitor.py --continuous --interval 30  # 每30分钟检查一次

文件结构

windows-api-monitor/
├── SKILL.md                      # 技能说明文档
├── scripts/
│   ├── api_monitor.py           # 主监控脚本
│   ├── daily_check.py           # 每日检查脚本
│   ├── realtime_monitor.py      # 实时监控脚本
│   └── utils/
│       ├── log_parser.py        # 日志解析工具
│       ├── report_generator.py  # 报告生成工具
│       └── alerts.py            # 告警工具
├── references/
│   ├── windows_logs.md          # Windows日志文件位置说明
│   └── openclaw_usage.md        # OpenClaw使用统计文档
├── templates/
│   ├── report_template.md       # 报告模板
│   └── alert_template.md        # 告警模板
└── config/
    └── settings.yaml            # 配置文件

监控数据源

本技能从以下位置收集API使用数据:

  1. OpenClaw会话日志: ~/.openclaw/logs/*.log
  2. 模型调用记录: ~/.openclaw/cache/model_usage/*.json
  3. 系统日志: Windows Event Logs (OpenClaw相关)
  4. 实时会话: 通过OpenClaw CLI接口获取

输出示例

=== API使用监控报告 (2026-03-22) ===

📊 今日使用统计:
- 总调用次数: 87
- 总令牌数: 12,450
- 估计成本: ~¥0.56

📈 按模型统计:
1. deepseek-ai: 45次 (¥0.31) - 51.7%
2. glm-5: 28次 (¥0.18) - 32.2%
3. 其他: 14次 (¥0.07) - 16.1%

⏰ 时间分布:
- 高峰期: 10:00-12:00 (38次)
- 稳定期: 14:00-18:00 (32次)
- 低峰期: 20:00-08:00 (17次)

⚠️ 告警信息:无异常

配置说明

编辑 config/settings.yaml 自定义监控行为:

# 基础配置
monitor:
  interval: 300  # 监控间隔(秒)
  retention_days: 30  # 数据保留天数

# 告警配置
alerts:
  enabled: true
  threshold_calls: 100  # 单日调用阈值
  threshold_tokens: 10000  # 单日令牌阈值
  notify_method: log  # 通知方式: log, email, webhook

# 报告配置
reports:
  daily_enabled: true
  weekly_enabled: true
  monthly_enabled: true
  output_dir: ./reports

故障排除

常见问题

  1. 无法读取日志文件: 检查文件权限和路径是否正确
  2. 数据不更新: 确认OpenClaw正在运行并生成日志
  3. 报告生成失败: 检查Python依赖是否安装完整

调试模式

python scripts/api_monitor.py --debug --verbose

更新日志

v1.0.0 (2026-03-22)

  • 初始版本发布
  • 支持基础监控功能
  • Windows原生优化
  • 多维度分析报告

注意事项

  1. 本技能仅监控OpenClaw API使用,不涉及其他应用
  2. 数据为估计值,实际成本以官方账单为准
  3. 建议定期清理旧日志文件以释放磁盘空间
  4. 重要告警建议结合其他监控手段验证

相关技能

  • model-usage: macOS环境的替代方案
  • healthcheck: 系统健康检查
  • skill-creator: 技能创建工具

Comments

Loading comments...