Inspiration
AgentWallet โ Devpost Submission Package Project Title
AgentWallet: Autonomous Agentic Commerce Runtime & Secure Financial Proxy
Elevator Pitch / Tagline (under 200 characters)
The secure financial proxy empowering AI agents to research, evaluate, and autonomously purchase items via PayPal Orders API v2, backed by cryptographic guardrails and human sign-offs.
About the Project ๐ก Inspiration
We are witnessing an inflection point in artificial intelligence: autonomous AI agents are writing production code, triaging security alerts, analyzing complex datasets, and navigating browsers. However, the moment an agent needs to execute an economic transaction โ whether booking cloud compute instances, renewing API tokens, or purchasing office hardware โ the entire autonomous loop collapses.
Today, engineers face an unacceptable binary choice:
Manual bottlenecking: Require human intervention for every $10 micro-purchase, defeating the purpose of autonomy. Catastrophic financial risk: Provide an AI agent with an unrestricted corporate credit card. A single hallucination or runaway reasoning loop could drain an entire bank account in minutes.
We built AgentWallet to solve this missing link: creating an autonomous financial runtime that gives AI agents the economic agency to transact independently while giving organizations the cryptographic brakes to ensure complete financial safety.
โ๏ธ What It Does
AgentWallet acts as an intelligent, secure financial proxy between autonomous AI agents and merchant checkouts using the PayPal Orders API v2:
Procurement Objective Decomposition: Agents ingest plain-text instructions (e.g., "Order an ergonomic mouse under $60 with fast delivery") and extract formal hardware specifications, budget limits, and urgency using Gemini 2.5 Flash. Multi-Merchant Inventory Discovery: The agent scans diverse merchant catalogs (Electronics, Office Supplies, Cloud Software, Developer Peripherals) to retrieve candidate listings. Multi-Criteria Deal Evaluation: The AI Deal Evaluator weighs price value, shipping speed, merchant credibility, and technical specifications, scoring each candidate from 0 to 100 to pick the optimal deal with defensible rationale. Cryptographic Non-Repudiation: Before any order is transmitted, AgentWallet generates an immutable SHA-256 intent verification digest binding the user prompt, merchant, item, and cart total. Autonomous Guardrail Gate: Auto-Approval: If the total is under the auto-approval threshold ( โค $ 75 โค$75) and carries a low risk score ( < 30 <30), AgentWallet autonomously creates and captures the PayPal Sandbox order in seconds with zero human delay. Human-in-the-Loop Sign-Off: If the purchase exceeds $75 or flags policy risks, the runtime stages a pending PayPal order, issues a secure one-time authorization token with a 15-minute countdown, and prompts the human operator via an interactive approval gate. Hard Policy Interceptions: Transactions exceeding the absolute transaction ceiling ($150) or involving blacklisted vendors (e.g., ShadyElectronicsCorp) are rejected and permanently logged. AG Grid Financial Audit Ledger: An enterprise-grade auditable ledger table equipped with multi-column sorting, text filtering, KPI metrics, and one-click CSV export. ๐๏ธ How We Built It
AgentWallet is engineered as a modern full-stack TypeScript application:
Frontend & Runtime: Next.js 14+ (App Router), React 18, Tailwind CSS, and Lucide Icons for real-time visual step streaming. AI Brain: @google/genai utilizing Gemini 2.5 Flash with strict JSON schemas (responseSchema) for Goal Decomposition, Candidate Evaluation, and Guardrail Auditing. Financial Infrastructure: Direct integration with the PayPal Orders API v2 (POST /v2/checkout/orders with intent: "CAPTURE" and itemized financial breakdown, followed by POST /v2/checkout/orders/{id}/capture), resilient OAuth2 token caching, and webhook listeners for CHECKOUT.ORDER.APPROVED and PAYMENT.CAPTURE.COMPLETED. Cryptographic Guardrails: Node.js crypto primitives for SHA-256 intent verification and high-entropy one-time authorization tokens. Audit Table: ag-grid-react and ag-grid-community for high-throughput transactional inspection. Deployment: Vercel serverless runtime and containerized Render Web Service (render.yaml). ๐ Mathematical & Cryptographic Formulation
The non-repudiation intent digest is computed using a deterministic canonical serialization of the procurement intent:
Intent Digest
SHA-256 ( ๐ถ ( customId , amount , currency , itemId , merchant , prompt , timestamp ) ) Intent Digest=SHA-256(C(customId,amount,currency,itemId,merchant,prompt,timestamp))
Where ๐ถ C is the lexicographically sorted JSON canonicalizer.
The composite transaction risk score ๐ โ [ 0 , 100 ] Rโ[0,100] is formulated as:
๐
min โก ( 100 , ๐ 0 + 35 โ ๐ผ ( cost
๐ auto ) + 45 โ ๐ผ ( cost
๐ max ) + 40 โ ๐ผ ( spend + cost
๐ daily ) + 80 โ ๐ผ ( merchant โ ๐ต ) ) R=min(100,R 0 โ
+35โ I (cost>ฮธ auto โ
) โ
+45โ I (cost>ฮธ max โ
) โ
+40โ I (spend+cost>ฮธ daily โ
) โ
+80โ I (merchantโB) โ
)
Where:
๐
0
12 R 0 โ
=12 is the baseline operational risk. ๐
auto
$ 75 ฮธ auto โ
=$75 is the autonomous sign-off threshold. ๐
max
$ 150 ฮธ max โ
=$150 is the per-transaction ceiling. ๐
daily
$ 500 ฮธ daily โ
=$500 is the cumulative daily organizational budget. ๐ต B is the set of blacklisted merchant identifiers. ๐ผ ( โ ) I (โ ) โ
is the indicator function. ๐ฅ Challenges We Faced Non-Repudiation in Agentic Loops: LLMs are inherently non-deterministic. If an agent changes its reasoning mid-stream, downstream financial operations could drift from the user's initial objective. We resolved this by binding the execution to a cryptographic SHA-256 intent digest before the PayPal API call is staged. PayPal Orders v2 Breakdown Precision: PayPal strictly enforces that: item_total + shipping +
tax
amount.value item_total+shipping+tax=amount.value Floating-point rounding issues in JavaScript initially caused 422 UNPROCESSABLE_ENTITY errors. We implemented a centralized fixed-precision financial decimal serializer ensuring zero discrepancies across currency units. Dual Execution Resilience: For hackathon testing and judge demonstrations, we engineered an intelligent offline/sandbox fallback manager that communicates with live PayPal Sandbox credentials when provided, but gracefully simulates sandbox transactions if keys are absent, ensuring reviewers never hit a fatal barrier. ๐ Accomplishments That We're Proud Of End-to-End Autonomous Pipeline: A single prompt executes goal decomposition, catalog scanning, AI scoring, cryptographic verification, and PayPal Sandbox capture in under 3 seconds. Zero Hallucination Leaks: The policy engine functions outside the LLM context as a hard deterministic boundary โ ensuring that even if an LLM hallucinated a purchase approval, the proxy server rejects any violation. Production-Grade Next.js 14 Build: Fully typed with TypeScript, passing strict linting and production optimization with 12 static/dynamic routes. Comprehensive Documentation: Complete with a 2-minute 45-second timed video script, open-source MIT license, and dual deployment pipelines (Vercel & Render). ๐ What We Learned How to leverage Gemini 2.5 Flash's structured responseSchema to eliminate fuzzy regex parsing and guarantee valid JSON outputs. Deep architectural insights into the PayPal Orders API v2 lifecycle: OAuth2 token refresh intervals, idempotency keys, and webhook event reconciliation. How to design safety perimeters that empower autonomous intelligence without sacrificing auditability. ๐ฎ What's Next for AgentWallet PayPal Vaulting for Subscriptions: Enable autonomous agents to provision, manage, and automatically terminate recurring software and cloud subscriptions without storing raw credentials. Multi-Signature Corporate Governance: Require approvals from multiple human stakeholders or department leads for high-value agent procurements above $1,000. Dynamic Vendor Credibility Graphs: Train real-time fraud detection models using historical merchant fulfilment data to dynamically adjust risk scores on the fly. ๐ท๏ธ Built With (Devpost Tags โ 20 Tags)
next.js react typescript paypal paypal-api gemini-api gemini-2.5 google-cloud artificial-intelligence agents agentic-ai fintech e-commerce cryptography ag-grid tailwind-css vercel render docker rest-api
๐ "Try It Out" Links GitHub Repository: https://github.com/Ayush-web28/AgentWallet Live Demo / Deployment: https://agentwallet-app.vercel.app (Or your deployed Vercel domain) Demo Video Script: DEMO_SCRIPT.md PayPal Healthcheck API: https:///api/paypal/health
Built With
- ag-grid
- agentic-ai
- agents
- artificial-intelligence
- cryptography
- docker
- e-commerce
- fintech
- gemini-2.5
- gemini-api
- google-cloud
- next.js
- paypal
- react
- render
- rest-api
- tailwind-css
- typescript
- vercel
Log in or sign up for Devpost to join the conversation.