Skip to content

[ephemeral_wallet] v1 design: x402 + CDP session (parent: #41) #272

Description

@Hendobox

Parent

Part of #41 — design-only precursor to a scoped skill PR. Research matrix and v1 recommendation: #41 (comment) (approved direction by @rosspeili).

Goal

Ship a thin Skillware skill for spend-capped / short-lived agent payment sessions that settle x402 HTTP 402 challenges using a dedicated CDP / AgentKit-style funded wallet — not classic virtual-card PANs in v1.

Working skill ID (open to rename): finance/agent_pay or finance/ephemeral_wallet with description clarified to agent payment session, not card Issuing.

Non-goals (v1)

  • Stripe Issuing / Privacy.com-class PAN minting (optional later adapter)
  • Stripe MPP as primary rail (fiat adapter later)
  • AP2 mandates as primary backend (compose in v2)
  • Depending on @asgcard/pay (TS reference only)
  • Live chain / live facilitator in CI

Proposed actions

Action Purpose
create_session Create session metadata: spend_cap_usd, ttl_seconds, optional allowlist; bind to configured agent wallet
status Session remaining cap, expiry, last payment / receipt refs (no secrets)
pay Given a URL (or 402 challenge payload): follow x402 flow (402 → sign/settle → retry); enforce session cap + TTL
revoke Expire session immediately (fail closed on further pay)

Optional later: quote (inspect 402 without settling).

Env / config (draft)

  • Dedicated agent wallet secrets only in .env (e.g. CDP / private key env names TBD after CDP+x402 SDK pass) — never in tool args or YAML
  • Optional: facilitator URL (default public x402 facilitator), network (base-sepolia for demo)
  • config.yaml.example: default cap, TTL, network — gitignored real config

Constitution (draft)

  1. Dedicated agent wallet only — never personal/treasury keys
  2. Never return private keys, seed phrases, or full PANs/CVVs in tool output
  3. Fail closed on missing env, over-cap, expired session, or unverifiable settlement
  4. Not financial advice; on-chain results may differ from quotes
  5. Redact secrets in logs / agent_hint; instructions teach agents not to echo secrets

Provider interface

Keep a small internal provider boundary so v1 is x402+CDP but later adapters (MPP, Issuing) can plug in without rewriting the action router.

Tests

  • Mocked HTTP 402 → payment header → 200 path
  • Cap exceeded / TTL expired → structured error
  • Missing wallet env → missing_config (agent-friendly), not bare traceback
  • No live Base / facilitator in CI

Acceptance for design sign-off

  • Skill ID / category agreed (finance/…)
  • Action list + env var names locked enough for PR1
  • Constitution + secret redaction rules agreed
  • Explicit reject list vs Issuing/MPP/AP2/ASG unchanged unless Ross finds blockers

Implementation plan (after sign-off)

  1. PR1: bundle skeleton — manifest, instructions, constitution, mocked create_session / status / revoke, stub or mocked pay
  2. PR2: real x402 client path behind mocks + optional demo script (EVM_TX_HANDLER-style demo flag)

Assignee

@Hendobox — continuing from #41 research spike.

Metadata

Metadata

Assignees

Labels

duplicateThis issue or pull request already existsenhancementNew feature or request.skill requestRequest for a new capability to be added to the registry.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions