Cost Governor for Openclaw

A pre-flight cost estimation and approval gate system designed to prevent API overspend during multi-agent deployments.

donovanpankratz-del
v1.0.0
Feb 25, 2026
0
1.5k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install openclaw-cost-governor

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install openclaw-cost-governor using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Cost Governor?

Cost Governor is a critical safety layer for AI agent workflows, specifically designed to mitigate the risk of runaway API costs when spawning subagents. By implementing pre-flight checks and mandatory approval gates for high-cost operations, it ensures that developers maintain full visibility into their spending. This skill is an essential component of professional Openclaw Skills environments, providing a structured way to manage budgets across various LLM providers including Anthropic and OpenAI.

It transforms the unpredictable nature of autonomous agents into a controlled, budget-conscious process. By using historical data and task-specific multipliers, Cost Governor provides highly accurate estimates before a single token is spent, protecting users from unexpected billing spikes during complex research or creative tasks.

Cost Governor Use Cases

  • Estimating the financial impact before spawning any subagent to log intent and maintain budget integrity.
  • Implementing a daily spend review process to compare actual usage against pre-defined budgets.
  • Performing post-task reconciliation to refine cost multipliers and improve future estimation accuracy.
  • Preventing silent expensive operations by enforcing user approval for any task exceeding a specific dollar threshold.

How Cost Governor Works

  1. The system triggers a cost check immediately before any subagent spawn command is executed.
  2. It calculates an estimated cost based on the model type, expected token count, and task-specific multipliers such as Creative or Technical.
  3. If the estimate exceeds the defined safety threshold, typically $0.50, the agent pauses and requests explicit user approval.
  4. Upon approval, or if the estimate is under the threshold, the operation proceeds and details are logged to the workspace tracking file.
  5. After task completion, the skill reconciles the actual cost with the initial estimate to update historical multipliers for better future precision.

Cost Governor Setup

# Create the necessary tracking directory within your workspace
mkdir -p ~/.openclaw/workspace/notes

# Initialize the cost tracking log file
touch ~/.openclaw/workspace/notes/cost-tracking.md

# Optionally set a daily budget in your environment configuration
echo "DAILY_BUDGET=20.00" >> ~/.openclaw/workspace/.env

Cost Governor Data Schema & Taxonomy

The skill maintains data primarily within a dedicated tracking file using a structured Markdown table format to track lifecycle metrics and budget performance.

Field Description
Date The timestamp of the subagent operation
Task Name or description of the spawned task
Model The specific LLM provider used (e.g., Claude Opus, GPT-4)
Est. The pre-flight cost estimate generated by the skill
Actual The final cost reported after task completion
Ratio The accuracy factor used to tune future multipliers

It also monitors environment variables like DAILY_BUDGET for global cap enforcement across the Openclaw Skills ecosystem.

Cost Governor Advanced Features

  • Customizable task multipliers that the agent reads dynamically from the tracking file header to adapt to specific project needs.
  • Integration with cron jobs for automated daily spend summaries and threshold-based budget alerts.
  • Comprehensive multi-model support with pre-defined rates for high-tier models like Opus and cost-efficient models like Haiku.
  • Automated budget caps that halt all subagent spawning once the daily limit is reached to prevent financial overruns.
  • Seamless integration with the sessions_spawn protocol to gate all downstream Openclaw Skills activities automatically.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*