Paper-cut illustration of a small assistant passing a refund slip towards a paused computer window and a blank signature card, beside a ceramic bowl.

Illustration made with AI.

A customer’s bowl arrives late. The shop’s support agent reads the complaint and asks for a $40 refund. The payment is reasonable, but it is more than the agent’s automatic limit. Before the money moves, someone should be able to see the request and decide.

That was the starting point for Countersign, our entry to the PayPal AI Hackathon. We wanted an agent to handle ordinary support work without giving it an unchecked route to a payment account. Countersign checks each request against rules and holds some moves for a signature.

Starting with the decision

We built the prototype around a small pottery shop. A customer might receive an automatic refund for a chipped mug; a larger refund might need review. The shop is fictional, and the demo uses PayPal Sandbox and test money.

We gave the AI model a specific role: explain a request so it is easier to review. The rules decide whether it goes through, waits, or is blocked. The console brings the amount, the ticket and the rule checks together, so a person can approve or deny the hold.

Countersign builds on OpenEdison, an open-source agent gateway. We imported the existing code first and built the payment checkpoint on top. Claude Code helped write the project. Codex later helped redesign the console, run the recorded demo and prepare the submission.

From build to submission

A chronological sequence of recorded milestones: the gateway base and first build on 27 October; a late-approval retry fix on 30 October; sandbox runs on 31 October; risk notes and copy on 7 November; and the recorded demo and submission on 11 November. The spacing is not to scale.

The first commit to submission covered roughly 15 calendar days, including gaps and waiting.

The first build was committed on 27 October. We tested the gateway, rules and a simulated payment backend, then set up PayPal Sandbox. Over the following sessions, we tested real sandbox requests, fixed retry behaviour, improved the money trail, and prepared the write-up and video. Devpost confirmed the submission on 11 November.

We did not keep a complete record of hands-on hours or total agent time. One Claude Code session used for the final sandbox take lasted about 47 seconds from its first to last recorded event. An earlier support-agent run reported a cost of about $0.10. Both figures describe individual runs, not the whole project.

A refund, a signature and a repeat

Flow diagram: Claude Code requests a $40 refund after reading a support ticket; Countersign checks the rules and holds the request; approval in the console allows a PayPal Sandbox refund to complete. A separate script repeats the request and Countersign blocks it.

The refund used PayPal Sandbox and test money. A separate script made the repeat request.

Watch the 44-second demo · Browse the code · See the submitted entry

Claude Code acted as the shop’s support agent. It asked for the $40 refund after reading the customer’s message. Countersign held it because the amount exceeded both the automatic limit and the lower limit set for requests following untrusted content.

The console showed the ticket and the rule checks. After the request was approved, PayPal Sandbox confirmed the refund. Codex operated the console for that recorded approval at my direction. A script then asked for the same refund again, and Countersign blocked it.

A separate test bench compares six failure scenarios with and without the checkpoint. In the simulation, $631 moved that should not have when calls went directly to the simulated payment service; with Countersign, the figure was $0. The bench uses scripted decisions and simulated failures.

The parts that took work

A retry can return an old result. Our first recording attempt showed a completed $40 refund, but its PayPal identifier matched an earlier payment. The sandbox totals had not changed: we were looking at a replay. For the final take, we used a new reference and checked the balance before and after. This time, the refundable balance fell by $40.

Refunds and payouts handle repeats differently. In our tests, a repeated refund with the same request ID returned the original refund. A repeated payout batch was refused. We changed the payout path to read back the original batch, so a lost reply would not be reported as unpaid when PayPal had already processed it.

A late signature exposed a bug. An earlier version only matched retries within 24 hours. When an expired hold was signed later, the agent’s retry opened another hold instead of following the decision. We removed that time limit and tested the corrected path on the sandbox.

The agent changed our demo plan. Claude spotted the suspicious ticket instruction and look-alike payout address in several runs, before requesting either payment. We used a labelled script to test those requests through Countersign instead.

What we would carry forward

The most useful design choice was keeping the evidence beside the decision. A reviewer can see what the agent read, why a rule held the request, and what PayPal reported afterward. That makes a signature more meaningful than a bare approve button.

The test environment also taught us to check the result independently. A successful-looking response can be a replay; a refused retry can refer to a payout that already happened. The money trail needs to distinguish those cases.

Finally, we would make the recording part of the build earlier. Our first capture was incomplete, and we spent time untangling the replay. For the finished video, we chose a fresh sandbox request, a silent captioned walkthrough and a Windows XP-inspired console.

Countersign remains a sandbox prototype with one administrator and a local database. The two-agent race was tested in simulation; the real sandbox run verified the refund and blocked repeat. The code is open for anyone who wants to explore it.

When an agent asks to move money, what evidence would you want beside the approve button?