IT-RAT the stack/tokenfuse GitHub ↗
money plane · wave 1

TokenFuse. The breaker between your agents and your invoice.

Observability tells you about the fire in next month's bill. TokenFuse is the extinguisher: a drop-in gateway that gives every run a budget, watches its burn in real time, and cuts the circuit with an HTTP 402 the second the money stops making sense. Adoption is one base-URL change; no agent framework rewrite, no SDK lock-in.

releasev0.4.0 · ghcr images
coreRust · 513 tests
consensusraft · redb ledger
enforcementHTTP 402, in-line
proven onHetzner · AWS · GCP
sixty seconds, one runaway

Watch the breaker do its job.

This is a simulation, but not a fantasy: it replays the exact shape of the live validation runs. An agent enters a retry loop against a $0.006 budget. Four calls land. The reserve for the fifth would cross the cap, so the raft ledger refuses it, and every node agrees.

under the hood

One gateway in the path. One ledger everyone trusts.

Your agent's SDK points at TokenFuse instead of the provider. In the hot path: budgets, loop detection, a model router that downgrades routine calls, a semantic cache, DLP and the Wardryx policy hook. Behind it: a raft-replicated spend ledger, so five gateways on five machines still admit exactly what one budget allows.

agent SDK base_url = tokenfuse tokenfuse-gateway :4100 budgets · breaker loop detection model router semantic cache DLP · firewall Wardryx PEP every decision emitted as an agent-event provider Anthropic · OpenAI · local raft spend ledger n1 n2 n3 no double-spend, ever Cloud + dashboard incidents · savings · evidence Pocket app pairs here · iOS
what it holds

Not a dashboard. A set of hands on the wheel.

Per-run budgets

Company, team, agent, run: budgets nest, and the run is the unit that pays. Cross the cap and the answer is a clean 402 your framework already understands, not a Slack message at 9am.

Loop detection

A retrying agent looks exactly like a compromised one from the budget's side. Sustained loops and fan-out explosions trip the breaker before they become a four-digit night.

Burn forecast

Reserve-then-settle accounting prices each call before it happens, with the 2026 model price book built in. The estimate is fast and honest about being an estimate.

Model router

Routine calls ride a cheaper model that still clears your quality bar; hard ones keep the big brain. In live runs the router and cache together stripped about 22% of routine spend.

Raft-replicated ledger

Four physical machines held one shared budget through a leader kill and a real network partition: majority kept serving, the isolated node could not overspend, nothing split-brained.

FOCUS export

Agent spend lands in the same FinOps Foundation format as the rest of your cloud bill, so showback and chargeback reuse the pipes and dashboards finance already trusts.

an honest comparison

Where the breaker lives matters.

The closest comparable tool, Pipelock, does real work in the same category. The architectural difference is where the stop button sits: inside the request path it protects, or outside it.

TokenFusePipelockObservability dashboards
EnforcementIn-line 402, secondsIn-line, in-processAlert after the fact
Kill switch locationOut of band: iPhone / Watch, Secure Enclave-signedInside the same process it protectsNone
Shared budget across machinesRaft consensus, byte-identical stateSingle noden/a
Cost optimizationRouter + semantic cache, measured 22%Not a goalRecommendations only
FinOps handoffFOCUS-format exportCustom logsVendor lock
Fleet, incidents, evidenceCloud plane + audit hash chainNo fleet layerStrong, read-only
in the stack

The loud neighbor everyone listens to.

TokenFuse asks Wardryx before letting a declared tool through, and stamps the verdict on the response. Its Parquet traces are the raw material Verdryx prices outcomes from. Mockryx attacks it on purpose in pre-prod. Idryx correlates its events into the identity graph, and Pocket carries its kill switch on a wrist. Everything travels as one envelope: the agent-event.

try it now
docker run -p 4100:4100 ghcr.io/taipanbox/tokenfuse

Then point ANTHROPIC_BASE_URL at localhost:4100 and give your next run a budget header. That's the whole migration.