📦 Cost Control — 防API费用失控
v1.0.3为GPT-4、Claude Opus、Gemini等昂贵API及云服务提供三层费用防护:预警、紧急、硬上限,彻底杜绝账单爆表。
0· 364·1 当前·1 累计
安全扫描
OpenClaw
安全
medium confidenceThe skill's code, instructions, and required artifacts are coherent with its stated purpose (a local cost-tracking system with a watchdog and kill switch), but it relies on file-based state and an external watchdog that can kill processes — so review deployment and file/perms configuration before use.
评估建议
This package appears to implement exactly what it claims: a local cost tracker, an external watchdog that can kill a process, and a manual kill switch. Before installing or deploying:
- Run code review and test in staging; verify record_call() is invoked reliably by your app.
- Ensure the state directory (default ./state) is writable only by the intended user and not writable by untrusted users to prevent tampering (someone creating cost_emergency.flag or KILL_SWITCH will block API calls).
- If ...详细分析 ▾
✓ 用途与能力
Name/description (cost control for expensive APIs) matches the provided code and SKILL.md. All included files (CostTracker, watchdog, kill switch, config examples) are directly relevant to implementing a 3‑tier cost control system. There are no unrelated credentials, network endpoints, or binaries requested.
ℹ 指令范围
Runtime instructions focus on integration (call is_call_allowed() before calls, record_call() after, deploy watchdog via cron). The docs explicitly instruct creating a PID file and state directory and writing/reading flag files. This is expected for the design, but the SKILL.md/code instruct the agent/operator to create or rely on on-disk artifacts (state/, state/app.pid, cost_emergency.flag, KILL_SWITCH). Those files are central to behavior and can be misused or misconfigured if not secured.
✓ 安装机制
No install spec is present (instruction-only). Code is provided as Python files that the user places in their project or pip can install; no external downloads from untrusted URLs or package installs are embedded in the skill metadata.
✓ 凭证需求
The skill requests no environment variables or credentials. It uses only local filesystem and process signaling, which is proportionate to a local kill-switch/watchdog design. There are no unexplained secret or network access requirements.
ℹ 持久化与权限
The skill does not request 'always:true' and allows normal opt-in/autonomous invocation. However, the external watchdog will (if configured) send SIGTERM/SIGKILL to the PID read from state/app.pid and write an emergency flag file that prevents restart until manual clearing. This behavior is coherent with the purpose but is high-impact: misconfigured PID paths or tampered state files could cause unintended process termination or denial of service. The implementation does not validate PID ownership, process identity, or require elevated permissions — responsibility for safe deployment falls to the operator.
安全有层次,运行前请审查代码。
运行时依赖
无特殊依赖
版本
latestv1.0.32026/3/9
## Changelog for version 1.0.3 - No file changes detected; functionality, documentation, and configuration remain unchanged from v1.0.2. - Version number updated, but the SKILL.md documentation and codebase stay the same as the previous release.
● 无害
安装命令
点击复制官方npx clawhub@latest install cost-control
镜像加速npx clawhub@latest install cost-control --registry https://cn.longxiaskill.com