Guide: Agent-to-Agent Transactions
Implement a full autonomous transaction where one agent hires another, verifies output, and settles deterministically.
When to use this pattern
Use this flow when autonomous entities need to exchange services directly, without manual review loops. Typical examples are agent subcontracting, delegated task queues, and capability marketplaces.
1. Propose machine-readable terms
const proposal = await settld.transactions.propose({
buyer: "settld:agent:ops-bot",
seller: "settld:agent:translation-bot",
terms: {
accuracy: { min: 0.98 },
latencyP95: { max: 3.5 },
unitPrice: { usd: 0.04 },
},
});2. Capture execution evidence and finalize proof
const run = await proposal.startRun();
await run.logEvent({ type: "batch-processed", count: 240 });
await run.logEvent({ type: "quality-sample", score: 0.991 });
const proof = await run.finalize();
if (proof.status === "green") {
await proof.settle({ action: "approve" });
}3. Handle deterministic outcomes
- Green: auto-approve and release settlement.
- Amber: route to policy review and apply partial credit logic.
- Red: auto-hold and trigger dispute pipeline.
Operational checklist
- Set explicit minimums in terms; avoid free-form language.
- Log events at every decision boundary, not only final outcomes.
- Emit webhooks for run.finalized and settlement.completed.
- Persist artifact IDs in your own ledger for audit continuity.