360 Secure SkillHub
360 安全技能中心

OpenClaw Cost Guard

这是OpenClaw的AI代理成本管控工具,核心是通过专用脚本静态检查配置,识别预算缺失、高成本默认模型、过大Token限额等风险,输出含评分、风险等级、优化建议的JSON结果。典型场景包括用户需降低Token消耗、审计成本风险、上线前强化成本治理等。输入支持指定配置路径(默认路径亦可),会给出PASS/WARN/FAIL的风险 verdict,需结合实际账单验证结果。

x-rayluan
x-rayluan
热度 81.51
最近更新 2026-05-11 17:31:57
分类:安全依赖:代码执行应用场景:财务 / 报告撰写

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add openclaw-agent-cost-guard
Metadata
name
openclaw-cost-guard
description
This skill should be used when the user asks to reduce OpenClaw token spend, audit model and cron cost risk, prevent denial-of-wallet incidents, add budget guardrails, review expensive agent defaults, or tighten AI-agent cost governance before wider rollout.

OpenClaw Cost Guard

Use this skill to identify obvious cost leaks before they turn into a denial-of-wallet problem.

Goal

Move from “the agents work” to “the agents work within an intentional budget.”

Workflow

  1. Identify the target OpenClaw config or workspace.
  2. Run the bundled cost-guard script.
  3. Review expensive defaults, missing budgets, and high-risk patterns.
  4. If the result is FAIL, stop scaling usage until cost controls are tightened.
  5. Apply the narrowest guardrails that reduce spend without breaking the workflow.

Command

node {baseDir}/scripts/cost-guard.mjs --config ~/.openclaw/openclaw.json

The --config flag is optional. If omitted, the script checks the default OpenClaw config path.

What the script checks

  • whether explicit budget signals exist
  • whether default models look expensive for always-on usage
  • whether browser/interactive tooling appears enabled without cost discipline
  • whether token limits appear excessively large
  • whether the config contains multiple high-cost patterns at once
  • whether the setup needs a governance recommendation before scaling

Output format

The script returns JSON with:

  • score
  • verdict
  • summary
  • findings
  • recommendations
  • guardrails
  • evidence

Verdicts

  • PASS — no major lightweight cost-governance gap found
  • WARN — spend risk exists and should be reviewed
  • FAIL — denial-of-wallet risk is materially elevated

Important limits

  • This is a lightweight static review, not a bill-reconciliation system.
  • A low-risk config can still become expensive through user behavior or external automations.
  • Always verify against real provider invoices and usage telemetry.

References

  • {baseDir}/references/cost-playbook.md