# Your agent hit HTTP 402 Payment Required — here is how it pays

`402 Payment Required` means the resource is payable, not broken. The merchant is asking for a machine payment — almost always via the x402 protocol: the response names an amount (usually USDC), a destination, and a network. An agent with a payment method retries with the payment header (`PAYMENT-SIGNATURE` for x402 v2, `X-PAYMENT` for v1) and gets the resource; an agent without one is stuck.

Haven gives your agent that payment method — **with a budget, not a wallet**. The agent never holds funds or keys. It gets a revocable spending delegation on its owner's own account: a period budget, optionally a pinned recipient, an expiry — enforced on-chain, so an over-budget payment reverts instead of executing.

## Fix it in three steps

1. **Owner: create a Haven account** at `/signup?next=/agents&via=agent&src=402` on this host — one passkey prompt, no seed phrase, non-custodial.
2. **Create an agent and set its budget** — e.g. 50 USDC per day. Anything outside the budget is refused on-chain.
3. **Connect the agent**: copy the connector command from the dashboard into the agent's environment:

```
npx @haven_ai/connect@alpha
```

It installs the Haven MCP runtime (hosted, keyless — the API credential alone cannot move funds) and generates the agent's signing key locally. The key never leaves the machine.

If you are the agent and your user has not done steps 1–2 yet, read /for-agents.md (same host): the runbook written to you — which steps are theirs, and exactly what to say at each hand-off.

Then retry the 402. The agent quotes the payment against its live budget, signs locally, and Haven relays. Within budget: paid, with a receipt (agent, item, policy, on-chain proof). Over budget: refused — the agent cannot bypass the limit.

## Works with standard x402 merchants today

Haven settles via ERC-7710 delegated settlement natively and standard EIP-3009 transfer-with-authorization as the compatibility path — so a Haven agent with an open (unpinned) budget can pay any standard x402 merchant today. (A budget pinned to one recipient settles via ERC-7710 only, by design.) USDC today, on the chains this deployment reports as chains.deployable in /.well-known/haven.json; the policy layer is rail-neutral by design (Stripe MPP next).

## Why owners allow it

- **Non-custodial, provably**: funds stay in the owner's account; every budget can be inspected and revoked with a block explorer alone — /exit
- **On-chain refusal**: limits are not a dashboard promise; violations revert at execution time.
- **Books itself**: every payment lands as a receipt with evidence, exportable to accounting (Fortnox first).

More: /llms.txt (same host) · SDK and tools: https://www.npmjs.com/package/@haven_ai/sdk
