Governor
More
Open console

Give every AI teammate its own budget.

Teams now hand real work to AI agents: sales research, support replies, code, reports. Each agent spends money on every call, and use grows week by week. Governor gives each agent its own key and its own budget, checks every call before it goes out, bills the provider's real usage when it comes back, and keeps a signed record of what each agent spent.

What it's for

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

One budget per agent

Give your sales agent, support agent and coding agent each a Governor key with its own daily and monthly cap. When one hits its limit, the others keep working.

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. They can approve it, approve it smaller, defer it with a note, or deny it with a reason. The signed record keeps a hash of exactly what they were shown, so it proves what they knew when they decided.

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.

Outages

Give each key a fallback model, then rehearse: mark a provider or one model down and watch traffic move, or get refused with a clear reason. The drill report shows what kept running and what it cost. Give a drill a time limit and it ends by itself.

New agents

A brand-new agent can start on a small daily budget that doubles each clean day. A runaway loop puts it back to the start, so trust is earned.

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.
    Windows PowerShell
    $k = Read-Host "Anthropic key" -AsSecureString
    $env:ANTHROPIC_API_KEY = [Net.NetworkCredential]::new('', $k).Password
    npm start
    macOS / Linux
    read -rs -p "Anthropic key: " ANTHROPIC_API_KEY && export ANTHROPIC_API_KEY
    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 (Python)
    client = anthropic.Anthropic(base_url="http://127.0.0.1:8787", api_key="gk_...")
    OpenAI SDK (Python)
    client = OpenAI(base_url="http://127.0.0.1:8787/v1", api_key="gk_...")
    Grok (OpenAI SDK, any grok- model)
    client = OpenAI(base_url="http://127.0.0.1:8787/v1", api_key="gk_...")
    client.chat.completions.create(model="grok-4.3", messages=[{"role": "user", "content": "Hello"}])
  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 request (or approves it with a lower output cap); deny and defer need a reason403 approval_required
Soft startA new key's daily cap starts small and doubles each clean day up to its full cap402 budget_exceeded
Outage drillA provider or model marked down: the call goes to the key's fallback model, billed at that model, or is refused503 provider_down
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, on drills, and on approval requests with the evidence the approver needsnone

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

Verify a record

Any single audit record can be handed to an auditor as a small proof file (governor proof --seq N --txid T). Drop one here. Every check runs in your browser; nothing is uploaded, and you don't have to trust this server or the explorer.

Drop a governor-proof JSON file here, or paste it below

Governor's anchor transactions are also on the BSVKey Proof Wall, which re-checks every BSVKey mainnet claim live in your browser.

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), OpenAI (Chat Completions) and xAI (Grok, through the same Chat Completions endpoint: any model whose name starts with grok- goes to xAI with your xAI key). Current Claude and Grok 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.

How is Grok's hidden reasoning handled?

Grok always reasons before it answers, and xAI bills that reasoning as output. Unlike Claude and OpenAI, max_tokens does not limit it, so Governor reserves an extra 32,000 output tokens before each Grok call (change it per key with reasoningReserveTokens). After the call, Governor bills the exact charge xAI states in its response, reasoning included.

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.