Inspiration

Inspiration

We entered this hackathon with a simple question: "If an AI agent can book a flight, why does it still need me to enter my credit card?" Current AI agents are powerful thinkers but impotent actors in the economy. They hit a wall whenever a transaction is required. We realized that for agents to become truly autonomous, they need:

  1. Agency: The ability to decide what to buy.
  2. Wallet: The ability to pay for it.
  3. Protocol: A standard way for machines to bill each other.

The dusty, unused HTTP 402 Payment Required status code was our "aha!" moment. We envisioned a world where this status code wasn't an error, but an invitation for an agent to negotiate a deal.

How We Built It

We started by building the Brain using Gemini 3 Flash Preview. Its speed was critical; an agent negotiating a payment can't take 5 seconds to think. We then built the Rails using the Stellar Network, chosen for its micro-transaction capabilities (paying $0.0001 fees for a $0.01 API call).

The core innovation was the Agent402 Client, a wrapper that intercepts 402 responses, signs a Stellar transaction locally, and retries the request with a proof-of-payment header.

Challenges & Solutions

Challenge 1: The Sequence Bottleneck Stellar accounts have sequence numbers, meaning you can't fire 5 transactions at once from one wallet. This broke our "Parallel Execution" goal.

  • Solution: We implemented a Channel Account System. The agent automatically spins up and funds temporary "worker wallets" to execute parallel tasks (e.g., querying 5 paid weather APIs simultaneously) without sequence collisions.

Challenge 2: Security vs. Autonomy Allowing an AI to run arbitrary code from a marketplace is dangerous.

  • Solution: We utilized Node.js vm for sandboxed execution and implemented a strict Cryptographic Approval Workflow, where a human admin must cryptographically sign off on new tools before they enter the marketplace.

Challenge 3: Gemini's Cost Awareness The agent would initially pick the most expensive tool.

  • Solution: We used Gemini's System Instructions to enforce a "frugal persona," creating an agent that actively shops for the best deal.

Built With

Share this project:

Updates