Payment services are where an agent's mistake costs money, and they were the one system our gate had not yet checked against a judge that is not ours. Stripe publishes a full machine-readable description of its API. A program turns it into the gate's table of rules, with no rule written by hand. We then sent about 17,000 requests to Stripe in test mode and to the gate. Of the requests Stripe accepted, the gate let through 1,616 of 1,641. Of those Stripe refused because they were badly formed, the gate refused 8,227 of 8,500. Every remaining case has a named cause, all of them, on the refusing side, rules Stripe applies that its own description does not write down.
## Why it matters
An agent connected to a payment service can create charges, refunds and payouts. Before such an action runs, the gate decides whether it passes, from a table of rules. Writing those rules by hand for a service with hundreds of functions is slow and error prone. Stripe, like many business systems, publishes a complete machine-readable description of what each function takes. If the rules can be read from that description, every system that publishes one gets a ready table.
## What we did
A program read Stripe's published description (576 functions in scope) and wrote the gate's table: which functions exist, which fields each takes, of which type, how long, from which list of values. No rule was written by hand. Then, in Stripe's test mode, we generated requests from the same description, some correct and some with one thing changed (a wrong type, an unknown field, a missing field, a value outside its list, a text too long, an empty value), and asked both Stripe and the gate. Stripe is the judge: what it accepts should pass, what it refuses as badly formed should not.
The work ran in three rounds, each declared before it ran: one to build, two to correct only the causes the previous round named. Each round used new requests.
## What we found
```chart
{"type": "bar", "title": "The gate against Stripe, three rounds", "labels": ["Round 1", "Round 2", "Round 3"], "datasets": [{"label": "Accepted by Stripe, passed by the gate (in 100)", "data": [78.6, 98.9, 98.5]}, {"label": "Refused by Stripe, refused by the gate (in 100)", "data": [94.0, 94.6, 96.8]}]}
```
- Third round: of 1,641 requests Stripe accepted, the gate let 1,616 through. Of the other 25, 16 are requests the description says are malformed, which Stripe answered with another error first (a card, tax or e-mail check); 9 are empty values Stripe accepts on fields where its description does not allow them.
- Of 8,500 requests Stripe refused as badly formed, the gate refused 8,227. All 273 remaining cases are rules Stripe applies that its description does not write down: a field required only together with another, a minimum of 1 or a maximum of 100 on search results, a report type from a fixed list given as free text. A table read only from the description cannot hold these; they are rows the owner adds and signs. The third round removed the one cause on our side left by the second (an empty value in a web address read more widely than Stripe reads it).
- About 4 in 10 requests named records that do not exist (made-up identifiers), and Stripe answered "not found" before checking the rest; those are counted apart and not in either figure.
## What comes next
The same compiler applies to every system that publishes such a description. The list of business systems with a free test environment, to be used as judges in the same way, is being drawn up now.
This update is not available.