Agentic Commerce Gateway
A trust gateway for agent-initiated payments. When software does the buying, the question stops being “is this card stolen” and becomes “did a human authorise this, and is the money going where they meant it to”.
Five of the eight attack classes need no language model at all. They are decided by arithmetic and comparison against values the request cannot reach. Three do need one, because they are unbounded natural language. The table below is the ablation that says which is which — and the false block rate, which says what the defence costs in refused genuine orders.
Need no model is a claim about the design; it is not a claim that all five are finished. Four are at zero. The fifth, I2, is short three rules — and those three are arithmetic too, so the partition holds even where the implementation does not yet.
Prompting is not a security control. A type and a lattice are.
The ablation
Attack success rate per class, over a published corpus of 120 attacks.
Lower is better. An attack succeeds if and only if the gateway’s
final decision is ALLOW — a REVIEW is
not a success, because the money is held and a human sees it.
| class | what it is | C0 no guardrail | C1 rules only | C2 rules + model |
|---|---|---|---|---|
| loading results… | ||||
Try it
Every verdict below comes from the same rule engine the table was measured with — the page calls the gateway rather than reimplementing the lattice in JavaScript, because a demo that disagrees with its own evaluation is worse than no demo.
or write your own catalog text (the injection surface)
Layer 1 never reads this field. Layer 2 does, and can only tighten the verdict Layer 1 reached.
What the rules found
What was actually judged
Predictions, written down before the corpus existed
A results table with no prior commitment is decoration — whatever comes out, the write-up explains why that was sensible. These were committed to git before the corpus was, so the order is checkable rather than claimed. Each one says what its failure would mean.
- loading…
How this relates to AP2 and ACP
Two open standards for agent payments landed while this was being built. Checked against the specifications rather than the launch write-ups, which differ — AP2 v0.2 defines a Checkout Mandate and a Payment Mandate, not the Intent / Cart / Payment triple most summaries still describe.
AP2’s own threat model states the premise this gateway is built on:
“AP2 assumes that preventing prompt injection attacks is infeasible. Therefore, all LLMs and Agents MUST be considered potential attackers.”
docs/ap2/security_and_privacy_considerations.md
So this is not an alternative to those protocols. It is the enforcement a threat model like AP2’s requires, at the layer where money moves. AP2 names the threat it calls Manipulated Discovery — “prompt injection causes the Shopping Agent to select malicious products” — and does not specify the control. That control is Layer 2 here.
Both protocols constrain the payment instrument. Neither constrains
the purchase decision.
ACP’s delegated-payment allowance is
max_amount, currency,
expires_at, checkout_session_id. AP2’s
open mandate is checkout.line_items and
checkout.allowed_merchants. Both make a leaked credential
nearly worthless. Neither carries what a human actually wants to say
— ₹1,500, skincare, one-time — so neither can
refuse a purchase that is correctly signed, correctly scoped, inside
its allowance, and simply not what was authorised. That is attack class
I1, and it is what this gateway’s mandate is shaped for.
Velocity (I4) appears in neither: a protocol scoped to one transaction
has nowhere to notice that this is the ninth in an hour. The full
comparison, with every claim cited by file path, is in
docs/protocols.md in the repository.
What this does not establish
- Three of the twelve designed rules are not built, all in I2. Split-order structuring is exercised by four corpus cases and walks straight through, which is why I2 does not reach zero — predicted in advance as P2. Coupon stacking and refund-before- fulfilment cannot be expressed by the corpus at all: there is no coupon concept and no order lifecycle, so there is no case to write. They are absent rather than failing, and I2’s number understates the real gap.
- C0’s semantic cells are unmeasured, not zero. Whether an injection moves money depends on whether the buyer agent obeys it, and the agent is the thing under test, not a component of this system. Reporting 100% across the whole C0 row would flatter the before/after and would be indefensible: a model that ignores a clumsy injection is not an attack that succeeded.
- The gateway trusts the merchant’s category. An item mis-categorised at source passes the mandate check, and no corpus case can test it, because the corpus has no way to disagree with the catalog.
- There is no cryptography here. AP2 mandates are signed credentials with key binding; ACP tokens are vaulted by a payment provider. This gateway’s mandate is a trusted local record, and its integrity rests entirely on the store it lives in. Against an attacker who can write to that store, every rule that compares against a mandate falls at once. Adopting AP2’s signed mandates is the single most valuable thing to take from either protocol, and it is not done.
- The corpus is small and I wrote it. Fifteen cases per class means every rate moves in steps of 6.7 points, which is why each figure is shown with its numerator and denominator rather than as a bare percentage. The held-out half is reported separately.