A policy-bound AI agent that runs a weekly DCA strategy. It pays market-data APIs via x402 (no API keys). Every step is validated against a plain-English policy. The full audit log is merkle-anchored to the XRPL daily.
€40 / wkDCA target
143runs · 0 failures
x402no API keys
anchoredto XRPL daily
01 / 05
· Policy
Mia sets the rules her bot must obey.
Mia drafts a plain-English policy: buy €40 of XRP every Friday at 18:00 CET, never spend more than €42, never trade other tokens, never withdraw.
Under the hood: Policy is a YAML doc with explicit DO / DON'T blocks. Stored signed against Mia's wallet — every plan she agent makes is validated against this exact policy.
02 / 05
· Plan
5 steps. Every one allowed by policy.
Claude Opus reads the policy and drafts a 5-step plan: quote → check spend → swap → verify slippage → log. Each step is checked against the policy guards before anything runs.
Under the hood: Planner output is a JSON schema. The validator runs every step's pre-conditions; only when ALL pass is the plan handed to the Executor.
03 / 05
· Pay (x402)
402 Payment Required. The bot pays €0.001.
Step 1 requires fresh EUR/XRP quotes. The market-data API answers 402 Payment Required · €0.001. The bot pays in XRP, retries, gets the quote.
Under the hood: Standard HTTP 402 flow. Payment is an XRPL tx with the request nonce in the memo. No API keys, no subscription, no rate-limit dance.
04 / 05
· Execute
€40 → 22.86 XRP. Within policy.
Executor signs the swap. €40 of EUR converts to 22.86 XRP at €1.7496. Slippage came in at 22 bps — inside the 30 bps policy limit, so the verify step passes.
Under the hood: Executor uses the policy-bound key (delegated by Mia, limited to swap.execute on EUR/XRP only). Slippage check is the final guard before log + anchor.
05 / 05
· Audit
Every step anchored to XRPL.
Every decision, every guard, every payment goes into the audit log. At the end of the day, the merkle root of all runs is anchored to the XRPL as a single tx memo. Mia (or her auditor) can prove any step happened, and exactly when.
Under the hood: Anchor service computes daily merkle root, submits a tiny XRPL Payment with the root in the memo. Each step receipt is signed; a proof is a hash chain from leaf to root.
Policy
·
01 / 05
Why this matters
Policy-bound by default
The bot can never spend more than €42 per run or trade other tokens.
x402 pay-per-call
No API keys, no subscriptions — €0.001 per quote, settled on XRPL.
€0.001 / call
Auditable forever
Every step receipted; the merkle root is anchored to XRPL each day.
143 runs, 0 failures
Weekly DCA running for 2.7 years. Same policy. Same outcome.
143 / 0
New here? Skim the glossary —
Glossary
x402
HTTP 402 reborn — pay per request, no API keys, no subscriptions.
Server replies 402 Payment Required with the price + an XRPL payment destination. Client pays in XRP and retries the call with the receipt hash.
Policy
Plain-English rules an AI agent must obey — DO this, DON'T that.
Policies bound spend caps, allowed tools, allowed counterparties. The validator enforces them deterministically before any tool call.
Planner / Executor
Two-model architecture: the planner drafts a plan, the executor runs it.
Planner = Claude Opus (creative + slow). Executor = Claude Sonnet (fast + faithful). The validator checks every step against policy before execution.
Merkle anchor
Daily summary hash of every action, written into a XRPL memo.
Lets anyone prove a specific step happened without storing the entire audit log on-chain.
"143 weekly runs. Zero policy violations. No API keys. No
subscriptions. Every decision provable from a single merkle root
on the XRP Ledger. This is what shipping an agent should feel like."