Governor Open console

Stop runaway AI bills before they happen.

Governor sits between your apps or AI agents and the model providers. Every call is checked against your budgets and rules before it goes out, billed from the provider's real usage when it comes back, and written to a signed audit log.

What it's for

AI agents call paid APIs on their own, often thousands of times a day. Provider dashboards tell you what you spent after the fact. Governor decides before each call whether it may spend at all.

Runaway loops

An agent stuck retrying the same request can burn a month's budget overnight. Governor spots the repeat and blocks it, and can switch that agent's key off.

Surprise bills

Daily and monthly caps per agent and for the whole account. A call that could cross a cap is refused before it is sent.

Expensive one-offs

Big jobs above a threshold wait for a person to approve that exact request. Approve or deny in one click.

Emergencies

One kill switch stops every AI call at once, from the console or the command line.

Leaked keys

Apps get Governor keys, not your real provider key. A leaked Governor key is capped, and you can disable it without rotating anything upstream.

Proof of what happened

Every decision and every charge goes into a tamper-evident, signed log you can verify at any time.

How it works

Your code keeps using the normal Anthropic or OpenAI SDK. You change two settings: the address it calls, and the key it uses.

Before a call, Governor works out the most it could cost: the prompt plus every output token the call is allowed to produce. If that could break a rule, the call is refused and nothing is sent. If it passes, that amount is set aside so several calls at once cannot jointly overshoot a cap. When the answer comes back, the set-aside amount is replaced with the exact cost from the provider's usage numbers.

Get started

Governor runs on your own machine or server. It needs Node.js 18 or newer and nothing else.

  1. Try the demo first (no API key, no cost)It runs a scripted scenario against a fake provider: a budget cap, an approval, a runaway loop and the kill switch.
    npm run demo
  2. Start Governor with your provider keySet the key in your terminal so it is never written to a file, then start the server.
    $env:ANTHROPIC_API_KEY = Read-Host "Anthropic key" -MaskInput
    npm start
  3. Create a key for each app or agent, with its limitsThe gk_... key is shown once. Governor keeps only a hash of it.
    node bin/governor.js create-key --name support-agent --daily 5 --monthly 50 --approve-above 0.50
  4. Point your code at Governor
    # Anthropic SDK
    client = anthropic.Anthropic(base_url="http://127.0.0.1:8787", api_key="gk_...")
    
    # OpenAI SDK
    client = OpenAI(base_url="http://127.0.0.1:8787/v1", api_key="gk_...")
  5. Watch and steer from the consoleOpen the console and paste the admin token from data/admin-token.txt. You will see spend against each cap, approvals waiting, alerts, and the audit trail.

Controls

Set defaults for every key, then override per key. All limits are in US dollars.

ControlWhat happensResponse the app sees
Daily and monthly capsA call that could cross the cap is refused402 budget_exceeded
Account-wide capsSame, across every key combined402 org_budget_exceeded
Per-request capRefuses any single call that could cost too much402 request_too_expensive
Approval thresholdHolds the call until an admin approves that exact request403 approval_required
Kill switchStops every call immediately403 kill_switch
Loop breakerBlocks the same request repeated too often; can disable the key403 loop_detected
Spend per minuteCaps how fast a key can spend429 spend_velocity
Requests per minuteRate limit per key429 rate_limited
Model allow-listOnly the models you name403 model_not_allowed
Unknown modelsRefused; Governor never guesses a price403 unknown_price
AlertsSlack or Discord webhook at 50%, 80% and 100% of each cap, on kill and on approval requestsnone

Tested against the real API

Passed

On 11 October 2026 Governor ran against the live Anthropic API with Claude Opus 5.5. A call of 25 input and 36 output tokens was billed $0.00082, which matches the $4 / $20 per million list price exactly. A streaming call was billed from the provider's final usage numbers. An oversized call was refused before reaching Anthropic, the kill switch blocked a call, and the audit log verified intact.

Anchored

On 12 October 2026 the fingerprint of a 28-record demo audit log was published on Bitcoin BSV for a 26-satoshi fee. Anyone can recompute it from the log and compare: view the transaction.
Merkle root 786e045f363f9ddbf8433d7267cd62f2bd1b718d1578b99e42eeaffeb25687ed

FAQ

Does Governor read or store my prompts?

No. Prompts and answers pass straight through. The audit log stores who called, which model, what it cost and a one-way hash of the request, never the text itself.

Which providers and models does it support?

Anthropic (Claude, through the Messages API) and OpenAI (Chat Completions). Current Claude models and two OpenAI models are priced out of the box. You can add any other model and its price in the config file. Models without a price are refused.

What does my app see when a call is blocked?

A normal API error from the SDK, with a plain-English message such as "Daily budget of $5.00 reached". The x-governor-decision header names the rule that fired, so your code can react to it.

How accurate is the cost?

Each charge is computed from the token counts the provider returns, using list prices, including prompt caching. Before the call Governor uses a deliberately high estimate, so it errs toward blocking, never toward overspending. If a streaming call is cut off before the final usage arrives, the high estimate is billed. Check the built-in prices against your provider's pricing page; you can override any of them.

Does it slow my calls down?

The checks run in memory before the call is forwarded, so the added time is very small next to the model's own response time. Streaming responses are passed through as they arrive.

What happens if Governor is down?

Calls through it fail; nothing slips past it uncontrolled. That is deliberate. If you need a bypass for an outage, give that app the provider key directly for the duration.

Where is my real provider key kept?

Only on the machine running Governor, as an environment variable. Apps never see it. Callers can also bring their own provider key per request if you allow it; Governor forwards it and never stores or logs it.

How does an approval work?

When a call is held, the response includes an approval ID. An admin approves it in the console. The app resends the identical request with the header x-governor-approval. An approval works once, for that exact request, within 24 hours.

How do I know the audit log hasn't been altered?

Each record carries the fingerprint of the one before it and is signed with a key that only your Governor instance holds. Editing, deleting or reordering any record breaks the check. Click "Verify chain" in the console or run node bin/governor.js verify.

Do I need crypto or a Bitcoin BSV wallet?

No. Payment to the AI provider stays exactly as it is today. Anchoring is an optional extra: you can publish each day's audit fingerprint on Bitcoin BSV, so anyone can later confirm the log existed in that exact form on that date.

Where does it run, and can I host it?

Today it runs as one process on your own machine or server and keeps its state in a local file. Run it on localhost, or put it behind HTTPS if other machines need to reach it.

How much does it cost?

Governor is in early access. Email embryospace@gmail.com to try it with your team.