Skip to content

docs: add a read-only BlockRun research agent example with payment safeguards #490

Open

Description

@osr21

Motivation

The Arc app work now explores BlockRun's dynamically discovered paid services for sourced research and informational market monitoring. The current arc-node examples include an autonomous X402 oracle-to-vault strategy; a complementary read-only example would help developers use paid agent services without confusing app-level service discovery with node functionality.

Proposal

Add a concise documentation example that:

  • discovers service endpoints, input schemas, and payment requirements at runtime instead of hard-coding catalog data;
  • shows explicit per-call user approval, a dedicated server-side agent wallet, and configurable per-call and daily spend caps;
  • avoids automatic retries when payment outcome is ambiguous and demonstrates recording/displaying the payment receipt;
  • keeps the result informational (no trading or other transactions).

This is a docs/example request only: it does not ask arc-node to host the BlockRun catalog, hold application wallet keys, or make paid calls on behalf of an app.

Related

Activity

  1. feafel commented on Oct 15, 2026

    @feafel

    I would like to take this one — could you please assign it to me?

    Plan, pending your confirmation of scope:

    • Add a new runnable example under `examples/` (next to the existing X402 examples) implementing a read-only BlockRun research agent: tool surface limited to `web_search`/`web_fetch`-style reads, no shell, no wallet-signing paths other than the X402 payment client itself.
    • Payment safeguards spelled out in the example README and enforced in code: per-run spend cap, explicit `.price`/`.maxAmount` bounds on the payment request, idempotency key per run, and a hard refusal path when the server price exceeds the configured cap.
    • Verify the example runs against localnet per the repo contributing docs; keep it self-contained (no new workspace dependencies beyond what existing examples already use).

    If you would rather this live somewhere else (e.g. the app-work directory or a separate cookbook repo), happy to follow that direction instead.

  2. osr21 commented on Oct 15, 2026

    @osr21
    Author

    Thanks—this looks like a good fit for a separate, read-only example. One useful boundary to make explicit: keep BlockRun catalog discovery in the example/client layer; arc-node should demonstrate the x402 payment/resource flow without embedding BlockRun catalog URLs or schemas. That keeps dynamic service discovery out of node responsibilities, and is consistent with the per-route metadata gap tracked in #436.

    For acceptance criteria, I suggest covering two safeguards from the issue that aren’t explicit in this plan:

    • Require approval for each paid call, bound to the resolved service, canonicalized inputs, network/token, and a maximum amount. Reject if the quote, schema, or inputs change after approval.
    • Enforce both the per-call limit and a durable UTC-day aggregate cap, with an atomic reservation so concurrent calls cannot exceed the budget. Persist and display the payment receipt/result.

    An idempotency key helps only if the payment service actually honors it. On timeout or an ambiguous payment outcome, reconcile by receipt/status and fail closed rather than blindly resending. A useful test would change the quote after discovery and verify that the old approval cannot authorize the new price.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions