Skip to content
Margin402
Restoring wallet…

Autonomous outcome underwriting

Let AI agents buy outcomes.

Margin402 lets autonomous agents negotiate, pay, verify, and retry specialized services through x402 — so software can purchase reliable outcomes without human intervention. Humans watch. Agents transact.

Diagram: a task becomes a quote, capital is committed to a strategy, work is executed and verified, and the outcome settles — payment particles flow through each stage.

Canonical quote
$1.20
First workload
parseDuration()
Verification
6 visible + hidden tests
Settlement
Algorand Testnet · USDC

01The problem

Machines can't open accounts, hold cards, or ask for help.

Autonomous software needs to purchase work the way it makes any other call: programmatically, per-request, without a human approving checkout. Margin402 is the counterparty that makes that possible — it sells outcomes and manages everything underneath.

  1. 01

    Agents buy work, not API calls

    A task may require several paid attempts before it succeeds — and the agent carries a budget, not infinite money.

  2. 02

    The cheapest provider is rarely the cheapest path

    A cheap provider that fails half the time can cost more in expectation than an expensive one that rarely fails.

  3. 03

    Every failed attempt is sunk cost

    Pay-per-call means the agent bears 100% of provider-failure risk on every single request, with no recourse.

  4. 04

    Nobody is watching

    No human can review each micro-decision of a fleet of agents in real time — payment and selection logic has to be trustworthy on its own.

02The core mechanism

Quote → pay → execute → verify → decide → settle.

The loop repeats per attempt until the outcome verifies or Margin402 refunds. Follow a single pass:

QUOTE

One fixed price

The customer submits a task and its tests. Margin402 answers with a single all-in quote for the verified outcome — not an hourly meter.

03The moment that matters

It could afford the payment. It chose not to make it.

$0.85

REJECTED

“Payment rejected: economically inferior to available alternative.”

Affordable does not mean economical. That distinction is the product.

04Verification

Verified against tests the provider never saw.

Providers are shown only the 6 visible tests. The other 2 exist to catch work that special-cases what it can see instead of solving the problem. Every attempt faces all 8 — there is no looser check for what the provider was shown.

Visible suite · provider saw these

Hidden suite · never exposed to providers

Outcome0 / 8Verified

05Autonomous economics

Not a payment forwarder. An underwriter.

Selection by expected cost

Every round, remaining strategies are ranked by expected cost-to-success — price and failure probability together, never price alone.

Affordability is a separate check

Being able to pay is never the reason to pay. A strategy that fits the budget can still lose to a cheaper expectation.

The honouring rule

If the only path to done costs more than what remains of the budget, Margin402 pays anyway while losing less than a refund would cost. Delivery beats retreat.

Provider strategies in the simulated provider market
StrategyPrice curvep (pass)
Draft$0.05 flat0.35
Repair$0.09 flat0.45
Premium$0.55 → $0.85 → $1.050.85

Prices move along a scripted curve — a simulated provider market. Every payment against them is real.

The cheapest option isn't always the cheapest outcome — a $0.05 attempt failing 65% of the time can cost more than it looks.

06How agentic payments work

Payment is part of the request.

A machine can't hold a card or approve a checkout. x402 turns “pay for this” into one HTTP round trip — no session, no stored credentials, no human. That is what lets Margin402 pay per attempt, per strategy, entirely under its own economic logic.

  1. 01
    402Provider answers an unpaid request with 402 Payment Required and its terms.
  2. 02
    SIGNMargin402's treasury wallet signs the exact quoted amount (@x402/avm).
  3. 03
    RETRYThe same request is retried with the signed X-PAYMENT header attached.
  4. 04
    VERIFYThe GoPlausible facilitator verifies the payload against the challenge.
  5. 05
    SETTLEThe facilitator settles on-chain — USDC moves on Algorand Testnet.
  6. 06
    RECEIPTThe paid response carries the real transaction ID, linked to this attempt forever.

07The machine customer

No UI required.

Everything this product does is available over plain HTTP — the same engine, the same payments, the same proof. A CI pipeline or an autonomous agent never needs to see this website.

  1. POST /api/quote — price the outcome
  2. POST /api/quote { offer } — one sealed counteroffer
  3. GET /api/jobs/execute?revenue=… — stream the run as SSE
Terminal — machine flow
# quote the outcome
curl -s -X POST localhost:3000/api/quote \
-H 'Content-Type: application/json' \
-d '{"task":"Implement parseDuration()"}'
# → {"quote":1.20,"validSeconds":60,…}
# one sealed counteroffer
curl -s -X POST localhost:3000/api/quote \
-H 'Content-Type: application/json' \
-d '{"offer":1.05}'
# → {"decision":"ACCEPT","offer":1.05,…}
# execute — decisions, x402 payments,
# verification and settlement, streamed live
curl -N "localhost:3000/api/jobs/execute?revenue=1.05"
# event: decision → payment → verification
# → closed { outcome:"VERIFIED", settlements:[…] }

08The economic statement

The loss is not hidden. The loss is the point.

Canonical demo runOutcome verified

Revenue

$1.05

Execution cost

$1.28

Margin

−$0.23

Margin402 had already accepted the job at $1.05. When the only remaining path to a verified outcome cost more than the budget that was left, it paid anyway — delivering at a loss cost less than refunding after sunk spend. Reproduce it: npm run machine:smoke.

Margin402 doesn't guarantee profit. It guarantees the outcome.

09Protocol architecture

One deployable unit. Every layer owned.

Customer agent

machine / CI pipeline — no human in the loop

Margin402

quote · economic engine · orchestrator · sandbox verifier

Draft

provider

Repair

provider

Premium

provider

Algorand Testnet

USDC · every settlement independently verifiable

No database, no queue, no cache — a single Next.js application. The verifier is in-house and free, and is deliberately not for sale: it is the oracle the economics are judged against.

The agent doesn't need to know how the work gets done.
It only needs to know the outcome will be delivered.

Buy outcomes. Not tokens, not hours, not hope.