Fuse puts every agent that pays on its own fuse: a rating per period over a USDC account the agent does not own. The agent key is worth that rating and nothing more.
Why a fuse
Agents pay for things now. An inference call, a search, a scraped page: services answer 402 Payment Required with a price and the agent pays it over x402. The usual way to let an agent do that is to hand it a wallet with money in it.
That wallet is a problem the day its key leaks or the agent gets stuck in a retry loop. Everything in it is within reach. A fuse moves the money out of the agent’s reach and leaves it one number to spend against.
Three parts
Part
What it is
The fuse
An account of the Fuse program holding the terms: the rating, the period, the expiry, whether it is pulled or blown, and the running totals.
The fuse account
A USDC token account that holds the money. The fuse owns it. The agent key never does.
The allowance
The amount the agent key is approved to move out of the fuse account, using the token program’s own Approve. This is the rating, live.
Try it: the SDK against a test service, in this page.
Start
Quick start
Open a fusebox, add a fuse, give its key to the agent, and swap fetch for agent.fetch.
1. Add a fuse
In the fusebox, pick a name, a rating and a period, and fund the account. The fusebox gives you an agent key that is approved for the rating and holds nothing else.
2. Import the SDK
The SDK is one ES module with no dependencies. Import it straight from this site:
# what the SDK does, by hand
curl -i https://search.example/q # 402 + PAYMENT-REQUIRED header
curl -i https://search.example/q \
-H "PAYMENT-SIGNATURE: <base64 payment>"# 200 + PAYMENT-RESPONSE
3. Let it blow
When a price is over what is left, agent.fetch throws FuseBlown before it signs anything. Catch it and decide what the agent does next.
try {
const res = await agent.fetch(url);
} catch (e) {
if (e.name === "FuseBlown") console.log("rolls at", new Date(e.rollsAt));
else throw e;
}
NOTEThe signer you pass to fuse() decides what actually gets signed. Without one, the SDK runs a dry run: it builds the exact four-instruction payment plan and sends it as the header, without touching a chain. That is what Try it uses.
Start
The fusebox
The fusebox is the panel of every fuse your wallet owns: its meter, its state and its pull, plus a main that pulls all of them.
A fuse card
Meter. Spent against the rating this period. The last ticks warm amber past 62% and run white-hot past 85%.
State. Live, Blown or Pulled.
Controls. Reset, Pull or Seat, Fund, Rotate key, Close.
Copy code. The two lines that put this fuse into an agent.
The main
The main sits above all the cards. Pulling it revokes every agent key in one go; seating it approves each of them for what is left of its rating again.
Dry run
The fusebox on this site keeps its fuses in your browser and moves no money. Agents you run there pay test services with the dry-run signer, so you can watch a fuse heat, blow and roll without funding anything.
Fuses
Fuses
A fuse is three things on chain and one rule: the agent key can move the smaller of what is left of the rating and what is in the account.
The model
what the key can pay next = min( rating − spent this period , account balance )
→ 0 if the fuse is blown, pulled or expired
Fields
Field
Type
Meaning
limit
u64
The rating: base units of the mint per period.
period
u32
Seconds. 60, 3600, 86400 or 604800 in the fusebox; any value in the program.
periodStart
i64
Unix time the current period began.
spent
u64
Taken off the allowance this period.
blown
bool
Set by a payment that did not fit. Cleared by a roll or a reset.
pulled
bool
Set by the owner. While set, the allowance is revoked.
expires
i64
0 for never. After it, nothing passes.
Life of a fuse
Created and funded: the account holds money, the key is approved for the rating.
Live: payments take the price off the allowance.
Blown: a price over what is left. Nothing is sent, nothing passes.
Rolled: the period ends, the full rating is approved again, the fuse is whole.
Fuses
Blow
A fuse blows when a price is above what is left this period. It is the one place Fuse is stricter than a plain allowance.
What happens
The SDK reads the price from the 402, compares it to what is left, and stops before it signs. It throws FuseBlown with the price, what was left and when the period rolls. The fuse records itself as blown.
Why nothing else passes
With a plain allowance, a cheaper payment that still fits would go through. A blown fuse refuses everything until it rolls or the owner resets it. An agent that tried to spend over its rating once is doing something you did not plan for, and the cheapest moment to look at it is right then.
WARNINGThe blown flag lives in the fuse, not in the token program. A key used outside the SDK can still move what is left of the allowance until the period rolls. If you think a key has leaked, pull the fuse: that revokes the allowance itself.
Fuses
Roll and reset
Two ways to get the full rating back: the clock, and you.
Roll
At the end of every period, one transaction closes it with what it spent, clears blown, and approves the full rating again. Fuse’s keeper sends it for every fuse at its boundary, on the chain’s own clock. Each closed period stays in your ledger.
Reset
A reset is the owner doing the same thing early: the full rating again, now, inside the same period. It is one transaction from your wallet.
import { replace, reset } from"https://fuseagent.vercel.app/lib/fuse.js";
replace(budget); // close the period now, open the next one
reset(budget); // full rating back, same period
Fuses
Pull
Pulling a fuse revokes the agent key in one transaction. It holds from the next slot.
The instruction
A pull is the token program’s Revoke on the fuse account, plus the fuse marking itself pulled. Seating it again is an Approve for what is left of the rating.
The main in the fusebox sends one revoke per fuse, packed into as few transactions as fit.
Fuses
Keys
One agent, one key. The key holds no money and no SOL; it is only ever the delegate of one fuse account.
Rotate
Rotating approves a fresh key and revokes the old one in the same transaction. The old key pays nothing from the next slot. The fuse account, and so the payer a service sees as the source, stays the same.
Expiry
A fuse can carry an expiry. After it, the SDK refuses with FuseExpired and the keeper revokes the allowance at the next roll.
Agents
SDK
lib/fuse.js is a single ES module with no dependencies. Every function below is exported from it.
fuse(options)
Option
Meaning
budget
A fuse from createBudget(). Required.
key
The agent key, { publicKey }, plus whatever your signer needs.
signer
async (requirement, budget, key) => ({ header, value, plan }). Defaults to dryRunSigner.
fetch
The fetch to use. Defaults to the global one.
onEvent
Called with request, 402, paid, refused and response events.
limit in whole USDC, period as "minute", "hour", "day", "week" or seconds, balance, expires in ms. Returns a plain object you can store as JSON.
Other exports
charge(b, price)
Check a price against the fuse and take it, or throw.
remaining(b)
What the key can still pay this period.
replace(b) · reset(b)
Roll now · full rating, same period.
pull(b) · seat(b)
Mark the fuse pulled or seated.
readRequirement(res)
Read a 402, version 1 or 2, and return the Solana exact requirement.
paymentPlan(req, b, key)
The four instructions a payment is made of.
ix.approve · ix.revoke · ix.transferChecked
Token program instructions with the real byte layouts.
base58
encode and decode.
mockService({ price })
A fetch that answers 402, then 200 once paid. For tests.
Agents
x402
A fuse payment is a standard x402 payment in the exact scheme for Solana. The SDK speaks both versions of the protocol.
The exchange
→ GET /search?q=fuses
← 402 Payment Required
PAYMENT-REQUIRED: base64({ x402Version: 2, accepts: [{ scheme: "exact", network: "solana:5eykt4…",
amount: "60000", asset: USDC, payTo, extra: { feePayer } }] })
· the SDK checks 0.06 against the fuse, then signs
→ GET /search?q=fuses
PAYMENT-SIGNATURE: base64({ x402Version: 2, scheme: "exact", payload: { transaction } })
← 200 OK
PAYMENT-RESPONSE: base64({ success: true, transaction, network })
Version 1
On version 1 the requirement comes in the body, the amount is maxAmountRequired, and the payment goes back in X-PAYMENT. readRequirement() handles both.
Amounts
Amounts in x402 are base units of the mint. USDC has 6 decimals, so "60000" is 0.06 USDC.
Give an agent a separate fuse for each expensive tool: a small hourly one for inference, a daily one for search. One blown fuse stops one tool, not the whole agent.
Agents
Try it
The SDK from this site against a test service that answers 402. Every line below is an event from agent.fetch.
Every fuse operation comes down to token program instructions on the fuse account. These are the byte layouts the SDK builds.
Token instructions
Instruction
Tag
Data
Signer
Approve
4
[4, amount u64 le]
Owner
Revoke
5
[5]
Owner
TransferChecked
12
[12, amount u64 le, decimals u8]
Agent key, as delegate
A payment
#
Instruction
Value
1
SetComputeUnitLimit
20,000 units
2
SetComputeUnitPrice
1 micro-lamport per unit
3
TransferChecked
The price, from the fuse account to the service’s token account
4
Memo
The service’s reference, or a random one
Addresses
Token program
TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA
USDC
EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
Network
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp
Reference
Errors
Every refusal happens before anything is signed. None of them moves money.
Name
Code
When
Carries
FuseBlown
6001
The price is over what is left, or the fuse already blew this period.
price, left, rollsAt
FusePulled
6002
The owner pulled the fuse or the main.
—
FuseExpired
6003
The fuse is past its expiry.
expiredAt
FuseWrongMint
6004
The service asks for a mint the fuse does not hold.
—
FuseEmpty
6005
The rating has room, the account does not. Fund it.
price, balance
Reference
Constants
Numbers the SDK and the fusebox use.
Name
Value
PERIODS.minute
60
PERIODS.hour
3,600
PERIODS.day
86,400
PERIODS.week
604,800
USDC decimals
6
Compute unit limit
20,000
Memo
up to 256 bytes
Meter warm / hot
62% / 85% of the rating
Protocol
For services
What you already do is what a fuse needs. A fuse payment follows the x402 exact scheme for Solana to the letter.
From your side
Answer 402 with an exact price on Solana.
Name your price in USDC.
Name payTo, your wallet.
Name your facilitator’s key as extra.feePayer, so the agent needs no SOL.
Hand the payment to your facilitator and answer with the result.
The one thing that differs
In most x402 payments the account the money leaves belongs to the key that signs. In a fuse payment the signer is the account’s delegate: the money leaves an account the fuse owns, and the agent key signs as the one approved to move it. The token program treats both the same way, and a facilitator checks the mint, the amount and the destination, so it passes the same checks.
TransferChecked
source the fuse account (not the payer's own wallet account)
mint USDC
destination your token account
authority the agent key (the source account's delegate)
amount your price, in full
Who paid
The transfer’s authority is the agent key: one agent, one key, the steadiest name for a customer. The source is the fuse account, which stays the same when the owner rotates the key.
An agent at its limit
The SDK checks the price before it signs. An agent whose fuse cannot cover your price sends you no payment at all: you see the first request and no second one. Your facilitator is never handed a transfer that would fail.
Protocol
Threat model
What a fuse protects, and what it does not.
Event
Worst case
Agent key leaks
What is left of this period’s rating. Pull the fuse and it is zero from the next slot.
Agent loops
The SDK blows the fuse at the first price over the line. Nothing passes until the roll.
Service overcharges
One payment, up to what is left. The blow stops the next one.
Owner wallet leaks
Everything in every fuse. A fuse protects you from your agent, not from yourself.
WARNINGKeep the rating small and the period short for agents you do not watch. A fuse is cheap to replace; a month of money is not.
Protocol
$FUSE
The coin of everyone who would rather lose 2 USDC to a looping agent than 1,240. Fair launch on Solana.
$FUSE is the token of this project. Fuses themselves hold USDC and payments settle in USDC; you never need $FUSE to put an agent on a fuse.
Contract
The address appears above once the coin is live. Click it to copy.
Protocol
FAQ
Short answers.
Does the agent need SOL?
No. The service’s facilitator pays the network fee as feePayer.
Can a service tell it is a fuse?
Only by reading the source account. The transfer, the amount and the destination are the ones it asked for.
What if I set the rating too low?
The fuse blows, you see it in the fusebox, and you change the rating in one transaction.
Is the fusebox on this site real money?
No. It is a dry run kept in your browser, so you can watch fuses heat and blow without funding anything.
Why not just a smaller wallet?
A smaller wallet still loses everything in it, and you have to refill it by hand. A fuse holds a month behind a daily rating and refills its own allowance every period.