Moneda exposes actions to AI agents through four distinct patterns, picked based on what the action requires the user to do. Knowing the pattern up-front lets your agent handle each tool response correctly and set the right user expectations. This is the technical reference. For a consumer-facing version, see Working with your AI assistant.Documentation Index
Fetch the complete documentation index at: https://docs.moneda.com/llms.txt
Use this file to discover all available pages before exploring further.
Every pattern preserves Moneda’s self-custody guarantee: the user’s passkey is the only thing that can authorise value movement. The patterns differ only in when and how the user is involved.
At a glance
| Pattern | When to use | What the tool returns | What your agent does |
|---|---|---|---|
| Instant | Pure server state, no signature needed | Final result | Show result. Done. |
| HITL approval | Each invocation needs explicit user consent | { paymentRequestId, status: "PENDING_APPROVAL" } | Tell user to approve in app, poll status until terminal. |
| Claim-link | One-time device-bound setup (passkey, on-chain install) | { activationUrl, expiresAt } | Render the URL or QR for the user to open. Poll status if applicable. |
| Smart Session | Recurring, agent-initiated, bounded by static policy | (Setup returns a claim-link; subsequent executions are transparent) | Set up once via claim-link; thereafter call execution tools directly. |
Pattern 1: Instant write
Direct server-side mutation. No signature, no biometric, no on-chain transaction. The tool runs the change and returns the final result in the same response. Examples:update_display_name, update_transaction_category, add_transaction_note, add_contact_moneda, add_contact_external, add_wallet, add_bank, batch variants of the above.
Tool response shape:
Pattern 2: HITL approval (push notification + polling)
The user must explicitly approve each invocation. Used today for payments. Each call creates a server-side pending request, sends a push notification to the user’s phone, and returns immediately. The user approves (or rejects) in the Moneda app; your agent polls a status endpoint until it reaches a terminal state. Examples:initiate_payment, get_payment_status.
Initiation response shape:
COMPLETED, FAILED, EXPIRED, REJECTED.
Agent behaviour:
- Call the initiation tool (e.g.
initiate_payment). - Tell the user a notification has been sent and what to do (e.g. “I’ve sent the payment request to your phone — approve it in the Moneda app”).
- Poll
get_payment_status({ paymentRequestId })periodically (every few seconds). Stop polling when the status is terminal orexpiresAtpasses. - Tell the user the outcome.
Pattern 3: Claim-link (one-time browser handoff)
For actions requiring a one-time device-bound ceremony — registering a new passkey, installing an on-chain Smart Session, accepting a recovery email — but where the user doesn’t need per-invocation approval afterwards. The tool creates a server-side pending claim and returns a short-lived signed URL. The user opens the URL in any browser; their synced passkey (iCloud Keychain, Google Password Manager, 1Password, etc.) signs the ceremony locally; the action completes atomically. Examples (designed): agent-mediated signup, scheduled-transaction activation, sub-account create. Status: signup is shipping; the others land alongside their respective backend features. Tool response shape:- Call the initiation tool.
- Render the
activationUrlto the user. On a desktop, render as a clickable link. On a phone, the URL itself works in any browser. If the user’s passkey lives on a different device than the one they’re chatting from, the browser-side WebAuthn ceremony will use cross-device assertion (QR + Bluetooth proximity to the phone) automatically — no extra implementation needed. - Tell the user what they’re signing for, briefly. (“This will set up email-based account recovery using ada@example.com — open the link and confirm with your passkey.”)
- If the action has follow-on state (e.g. “schedule activated” → continue scheduling), poll a corresponding status tool. For one-shot actions (passkey enrolled, recovery email accepted), no polling is needed; the user will tell you when they’re done.
activationUrl as a single-use token — which it is. The 24-hour expiresAt and one-shot consumption bound the blast radius if the URL leaks. Don’t echo it back later in conversation; refresh by calling the initiation tool again if the user needs a new one.
Pattern 4: Smart Sessions (delegated autonomous execution)
For repeating actions that should run without user interaction, bounded by a static on-chain policy: recipient pin, amount cap, time window. The user installs the session once via passkey (typically through a Pattern 3 claim-link); subsequent executions inside the policy run transparently. Status: rolling out alongside scheduled transactions. The first user is the recurring transfer engine; future users include auto-rebalance, threshold-triggered conversion, and recurring vault contributions. Setup response shape (one-time): see Pattern 3 — Smart Session installation is itself a claim-link. Execution response shape (subsequent):- First time only: propose the standing instruction. Make the bounds explicit (“send €100 to your savings vault on the 1st of every month, capped at €1,200/year, expires 2027-05-14”). Initiate via the appropriate tool, render the resulting claim-link, wait for the user to install the session.
- From then on: query schedule status, propose adjustments, or initiate executions within the bounds without further per-invocation approval. The chain enforces the policy; the user’s passkey is the only thing that can revoke or amend.
Detecting the pattern from a tool response
Your agent doesn’t need to know the pattern up-front for every tool — the response shape tells you what to do next.| Field present | Pattern | Next step |
|---|---|---|
success: true (or terminal data) | Instant | Show result. |
paymentRequestId + status: "PENDING_APPROVAL" | HITL | Poll get_payment_status. |
claimId + activationUrl | Claim-link | Render URL/QR. |
scheduleId + status: "PENDING_INSTALL" | Smart Session setup (claim-link sub-case) | Render the included activationUrl. |
scheduleId + status: "ACTIVE" | Smart Session active | Standing instruction is live. |
paymentRequestId and activationUrl, treat it as claim-link first (the link is the user’s next action) and poll status afterwards. The patterns compose; they don’t conflict.
Forward-looking notes
The patterns above describe both what’s live today (Patterns 1 and 2) and what’s coming (Patterns 3 and 4 are designed and partially implemented; tools that use them will appear in Read Tools and Write Tools as they ship). Agents built today should be ready to handle all four — the response-shape detection above is forward-compatible. Internal documents that describe the implementation roadmap:docs/agent-signup-spec.md— the canonical claim-link pattern, applied to signup.docs/scheduled-transactions-spec.md— Smart Sessions architecture (PR #1818).docs/agent-headless-parity.md— full pattern guide and parity gap inventory.
Learn more
Working with your AI
The consumer-facing version of this page — what users will experience for each pattern.
Read tools
All Pattern 1 read operations available today.
Write tools
Pattern 1 instant writes plus Pattern 2 HITL payment initiation.
Scopes
OAuth permission scopes that gate access to tools.
