-
-
Judge access to the live AegisFleet seller console.
-
Tamper detection in action: the overview flags a broken proof chain and surfaces open approvals, disputes and overdue invoices.
-
Every Collector, Defender and Guardian run expands into the exact LLM, tool and decision steps behind it.
-
Invoices and the ship gate in one view: payment status, risk, tracking and delivery, with release tied to verified payment.
-
A Bryntum-powered agent timeline for follow-ups, dispute deadlines and shipment events; planned actions still run through the same gateway.
-
Sentinel checks a “payment received” email against the Proof Ledger before the seller ships: no verified payment, no release.
-
The judge-ready demo panel: reset state, run the PayPal invoice flow, inject a fake payment email, or connect any MCP client.
-
Defender assembles the evidence pack from sealed ledger proof; the seller approves before anything goes to PayPal.
-
A rule-based account health score with the exact factors helping or hurting settlement, plus the recommended next action.
-
Human-in-the-loop control: every money-moving agent action waits for explicit seller approval.
-
The append-only, hash-chained ledger records every event and agent decision, with broken links highlighted and CSV export.
Inspiration
Lots of teams are building AI agents that spend and move money, and very few are building the brakes. For a solo seller on PayPal, an agent that can click "refund" is one prompt injection away from emptying the account. The same seller is already losing money to fake "payment received" emails, disputes they can't answer in time, and invoices nobody chases. We wanted agents a seller could hand that work to: useful, unable to do anything the seller's rules don't allow, and unable to hide what they did.
What it does
AegisFleet is a guardrail gateway between AI agents and a seller's PayPal account. Our demo seller is Riya, who sells jewellery from Jaipur to buyers in the US.
Every agent action goes through the gateway before it reaches PayPal. The gateway checks the kill switch, the agent's allowlist, the arguments and the weekly caps, and holds refunds of $100 or more until the seller approves them. A refund can only go back to the buyer who paid, and never for more than PayPal says they paid.
Every PayPal event, gateway decision, approval and plan is sealed in a hash-chained Proof Ledger. If anyone edits a past record, verification points at that exact entry.
Any AI agent can use it. AegisFleet is an MCP server, so ChatGPT, Claude, Gemini, Cursor or any other MCP client can connect with one link and issue real PayPal sandbox invoices, send reminders, check suspicious emails and refund buyers, always through the gateway. Each tool declares whether it is read-only or destructive, so a client can warn before a refund. We tested the whole loop live: the agent invoiced $150, PayPal's signed webhook marked it paid, the agent's $900 refund "to my other account" was denied, its $150 refund was held, the seller approved it in the console, and PayPal's refund webhook marked the invoice refunded.
Our own four agents work under the same rules:
- Sentinel checks "you've been paid" emails against verified PayPal payments instead of trusting what the email says.
- Defender builds dispute evidence from the ledger and writes the note to PayPal. The note is used only if every claim in it cites a real ledger entry.
- Collector chases overdue invoices with capped, polite reminders.
- Guardian syncs tracking and scores account health.
The agents also plan ahead. Collector books its own follow-up and final notice, Guardian books a carrier check, and Defender books a re-check 48 hours before PayPal's dispute deadline. The seller sees these on a timeline and can drag any of them. When one comes due it runs through the same gateway, so a plan that breaks a rule is blocked instead of run. When the facts change, for example the invoice gets paid, the agents cancel the plans that no longer make sense.
The console (React, AG Grid, Bryntum) shows money at risk, approvals, the ledger, the agents' timeline, disputes and invoices, with a one-click demo panel and a guided tour.
How we built it
- PayPal sandbox, used live: Invoicing v2 (create, send, remind, record payment, record refund), Payments v2 capture refunds for invoices paid through PayPal, and Webhooks with
verify-webhook-signatureon every event (invoices paid and refunded, captures, disputes). The client uses OAuth with a cached token and sends aPayPal-Request-Idon every write, so a retry never acts twice. - PayPal, built but replayed in the demo: Disputes (get, message, provide evidence, make offer, accept claim) and Shipment Tracking. The sandbox can't open a dispute on demand, so the demo's dispute and parcel are replayed from recorded PayPal payloads, and the ledger labels those calls "simulated".
- MCP: the official MCP Python SDK, streamable HTTP at
/mcp, eight tools. Clients sign in with a signed 14-day link (for URL-only clients like ChatGPT) or HTTP Basic. Outside agents get their own identity in the gateway, with their own allowlist and caps. - AI: one OpenAI-compatible wrapper with a fallback chain (Groq → Gemini → NVIDIA NIM). Agents return JSON validated against Pydantic schemas. Invalid output gets one retry, then the rules take over. Untrusted text such as emails and buyer messages is fenced and never followed as instructions. Rules decide anything that moves money; the model reads, flags, breaks ties and writes the words people read, and those words are checked before use.
- Evals on the real model, committed in
docs/evals/: Sentinel 20/20 emails (0 scams missed, 0 false alarms), Defender 8/8 disputes (0 uncited facts, and all 8 AI-written notes passed the citation check), Collector 10/10 invoices, prompt injection 6/6 (every disallowed tool call denied). - Backend: FastAPI and PostgreSQL, with an append-only ledger sealed under an advisory lock, a plan runner and signed session login. 75+ tests run in CI.
- Hosting: Render from
render.yaml, with the database on Neon Postgres. Every push tomainredeploys.
Sponsor tools we built with
- Bryntum Scheduler is the agents' timeline. Each agent has a row, and the actions it has planned are dashed bars the seller can drag to a new time; the move is sealed in the ledger. Drop one on "now" and it runs within seconds through the gateway, and the bar turns ✓, ⏸ (waiting for approval) or ✕ (blocked, with the gateway's reason in the tooltip). Approvals, overdue invoices and PayPal's dispute deadline sit on the same schedule.
- AG Grid Community runs the Proof Ledger and Invoices tables. The ledger re-verifies the chain every few seconds. After a tamper, the broken record pins to the top in red and everything after it is marked unproven. A link column shows ✓ or ✕ per hash link, new records flash as they're sealed, a row click opens the full record, and the trail exports to CSV. Invoices flash when PayPal's webhook marks one paid or refunded, with an overdue bar and a pinned totals row.
- APIMatic: we cleaned up our OpenAPI spec against APIMatic's checks (SDK readiness 99/100, AI readiness 98/100) and generated the docs portal at https://aegisfleet.solvor.co.in/docs (live playground, code samples, an MCP page and
llms.txt) plus Python, TypeScript and C# SDKs. - Render hosts the app and the docs portal from one blueprint, with the PayPal sandbox and model keys in Render env vars.
Challenges we ran into
- Making AI useful without trusting it. The rule we kept: AI drafts, classifies and recommends, and only the gateway's rules or a human approval execute a PayPal call.
- Letting outside agents in without opening a hole. They get their own identity in the gateway, a narrower allowlist, caps, and refunds bounded by the ledger's record of what the buyer actually paid.
- Free-tier rate limits during evals. The fallback chain absorbed them.
- Sandbox checkout failed for an India-region buyer account, so we kept a "record payment" path that fires the same signed webhook.
Accomplishments that we're proud of
- An outside AI agent invoicing, getting paid and refunding on the real PayPal sandbox, with the seller approving the money move and PayPal's own signed webhooks confirming each step.
- Prompt-injected refunds are denied by the gateway's rules, which don't care how the prompt is worded.
- Every claim an agent makes about money points at a specific ledger entry, and the AI-written dispute note is thrown away if it doesn't.
What we learned
Guardrails belong outside the model. A small gateway with allowlists, caps, human approval and a ledger made the agents easier to trust than any prompt could, and it let us open the door to agents we didn't write.
What's next
- Put PayPal's own Agent Toolkit and MCP server behind the same gateway, so any PayPal tool an agent calls gets caps, approvals and a ledger.
- Per-seller limits and production mode, behind the same rules.
- Buyer-side agents: a shopper's agent requests a refund or pays an invoice through AegisFleet, and the seller's rules decide.
Try it
- Live demo: https://aegisfleet.solvor.co.in (judge login is in the testing instructions)
- API docs and SDKs: https://aegisfleet.solvor.co.in/docs
- MCP endpoint: https://aegisfleet.solvor.co.in/mcp
- Code (MIT): https://github.com/Shivoo29/AegisFleet
Built With
- ag-grid
- apimatic
- bryntum
- fastapi
- gemini
- groq
- mcp
- neon
- nvidia-nim
- paypal
- paypal-disputes
- paypal-payments
- paypal-shipment-tracking
- paypal-webhooks
- postgresql
- python
- react
- render
- typescript
- vite