Idea 04
Agent Wallet
AI agents that can spend money, without unlimited access.
- Category
- Agentic Payments
- Difficulty
- Intermediate/Advanced
- Theme
- Agentic Commerce
- Soroban
- USDC
- x402
- MPP
- Stellar SDK
Problem
Giving an agent its own Stellar wallet with the secret key is unlimited control. One bad tool call can drain the account or pay an arbitrary address.
Idea
The agent gets a wallet, and a Soroban policy contract decides what it may do. Example policy: spend at most $100/day, only USDC, only approved merchants, at most $5 per API call, no transfers to EOAs, and human approval above $50.
Why now
Stellar supports x402 and MPP for machine payments. x402 is per-request. MPP adds session channels for high-frequency machine payments. A Stellar Builder Summit bounty already shipped an agent CLI gated by an onchain Soroban policy.
User story
A user creates an agent wallet, sets the policy, and connects an LLM agent. The agent buys an API call through x402 or MPP. Soroban accepts the payment only when every rule passes.
Architecture
01
User creates an agent wallet
02
User defines a spending policy
03
Soroban policy contract
04
AI agent
05
x402 / MPP
06
Merchant or API
MVP
- Create a wallet the agent can use.
- Write the spending policy onchain.
- Connect an LLM agent that requests a purchase.
- Pay with x402 or MPP.
- Reject the call when a policy rule fails.
Soroban contracts
Agent wallet
Holds USDC. The agent cannot move funds except through the policy.
Policy
Checks daily cap, asset, merchant allowlist, per-call max, and approval threshold.
Approval
Queues spends over $50 for a human signature.
Stellar features
- Soroban authorization on every spend
- x402 for a single request
- MPP charge or session for repeated calls
- USDC as a SAC
Suggested integrations
- x402
- MPP
- USDC
- Stellar SDK
- An LLM tool that pays the 402
Build sequence
01
Wallet + contract
Deploy the wallet and a policy skeleton the agent must call.
02
Policy engine
Daily cap, USDC only, merchant allowlist, per-call max, no EOA transfers.
03
x402 payments
One paid request that the policy can allow or deny.
04
AI agent
An LLM tool that attempts the purchase and reads the denial reason.
05
UI + demo
Show the policy, a successful $5 call, and a rejected transfer.
Stretch goals
- Add an MPP session channel for a burst of calls under the same daily cap.
- Require human approval above $50 before the policy returns success.