AP2 icon indicating copy to clipboard operation
AP2 copied to clipboard

[Spec gap] Verification responsibilities are crypto-only — where does risk/compliance assessment bind?

Open nmatt1 opened this issue 2 weeks ago • 3 comments

The five roles' verification responsibilities (specification.md §Roles) are entirely cryptographic and constraint-based: signature validity, checkout-hash binding, constraint matching. Nothing obliges any party to assess whether a validly-authorized payment should occur — counterparty screening, behavioral anomaly, velocity, sanctions exposure. security_and_privacy_considerations.md covers manipulated checkouts/payments and credential theft, but assumes the threat is mandate tampering, not mandate abuse.

This matters most in HNP mode: a Shopping Agent operating within constraints can autonomously transact with a sanctioned or anomalous counterparty and every artifact verifies.

The spec offers a natural hook: "Roles MAY always delegate their responsibilities to another party." That implies a delegated assurance role — but nothing defines what such a verifier verifies, how its verdict binds to the Mandate, or how receipts signal a risk-based (rather than constraint-based) rejection.

Proposal:

  • Normative text that CP/MPP SHOULD perform risk-based evaluation beyond mandate validity for autonomous flows, and MAY delegate it.
  • An extension point (e.g., an attestation object on the closed Mandate or receipt) so third-party verifiers can bind signed risk verdicts — complementary to #280's attestation-provider concept and a consumer of #163's risk-payload schema.
  • A receipt status/reason taxonomy distinguishing constraint_violation / risk_decline / policy_decline so declines are auditable — feeds the evidence discussion in #338.

Context: we operate a pre-settlement assurance layer doing exactly this (mandate verification + counterparty screening + behavioral scoring against live payment rails); happy to contribute concrete schema proposals.

nmatt1 avatar Nov 12 '26 21:11 nmatt1

On the reason taxonomy: for card payments, add who declined. An issuer decline comes back with a network response code (05, 51, 59). A merchant or assurance-layer decline made before authorization never reaches the network, and one made after shows only as a reversal with no reason. Without the source, an auditor can't tell them apart later. A declined_by value (issuer, processor, merchant, assurance) beside reason, plus the response code when there is one?

Flyingmiata-droid avatar Nov 17 '26 23:11 Flyingmiata-droid

The gap named here looks to me like a responsibility gap before it is a cryptography gap. The cryptographic checks all have an obvious owner. The risk question does not, and until the spec names who holds it, "Roles MAY always delegate their responsibilities" reads as permission without accountability: everyone may delegate, so no one is left holding the assessment when a validly authorized payment should not have gone ahead.

One way to make it bind is to keep three roles distinct, the way AER-1 keeps them distinct for execution records. Context: Brennan Zambo created agent execution receipts, Zambo is the origin product, and AER-1 is the defining standard. AER-1 draft -26 is final (expires 25 April 2027).

  1. The producer asserts what happened. Its record is evidence, not a verdict on itself.
  2. The checker evaluates that record against a stated basis and produces its own record of the evaluation: what was checked, against which inputs, and with what outcome.
  3. The relying party decides whether to proceed. That decision is acceptance, and it is a separate act from the check.

Two consequences follow for the proposals in this issue.

First, a checker verdict is not acceptance. A risk evaluation that returns "no concern found" does not oblige the CP or MPP to settle, and a risk decline is the checker's verdict, not the relying party silently failing a constraint. If the attestation extension collapses the verdict and the acceptance into one object, an auditor later cannot tell whether the relying party exercised its own judgment or simply inherited the checker's. Keeping the verification as a separate step with its own record is what makes delegation auditable: the delegated party's verdict can be rechecked against the same mandate and the same record, and the relying party's acceptance can cite it without becoming it.

Second, the verdict needs an honest "not checked" state. In AER-1 the anchor outcomes are exactly five: verified / verification failed / rejected: unresolvable record / not checked / absent. "Not checked" is not a soft pass and it is not a failure. It is a named state a responsible party can stand behind: the evaluation was assigned, or delegable, and it did not run. For autonomous flows that state matters more than any other, because the dangerous case in the OP is not a risk check that ran and missed something. It is a flow where no risk check ran at all and the receipt is silent, so silence gets read downstream as clearance. A receipt taxonomy that can say "not checked" forces the relying party to decide, in advance and on the record, what an unchecked flow is allowed to do.

Where the verdict lives also matters, and AER-1 has a cautionary example built in. Draft -26 section 3.2 execution_context is optional, producer-asserted, unauthenticated, and outside the canonical block and the metadata_hash computation. That is the right design for context, but it means a producer-asserted field can never carry a risk verdict: the party being assessed would be the party asserting the assessment, and nothing in the record would detect a changed verdict. A risk attestation needs to be checker-asserted and bound to the thing it evaluated, the way an AER-1 output_hash is SHA-256 over the canonical bytes of the saved result. That hash proves the saved result was not changed after the hash was recorded. It never proves the result was right. A risk verdict should make the same limited, checkable claim: this checker evaluated this mandate and this record against this basis, and here is the outcome. Correctness of the underlying payment stays a separate question, owned by the relying party.

On the reason taxonomy, I support the three-way split in the OP, and the follow-up point about who declined strengthens it: a reason without a responsible party is half a record. constraint_violation, risk_decline, and policy_decline should each carry who rendered the verdict (issuer, processor, merchant, assurance layer) and on what basis, plus the network response code where one exists. A pre-authorization assurance decline and an issuer decline with a network code leave different evidence, and an auditor months later should not have to guess which one happened.

For anyone who wants to test the outcome vocabulary rather than take it on description, the served AER-1 conformance corpus is here, kit 1.5.7, 143 vectors and 146 checks: https://zambo.dev/aer1/corpus.json

Offer: happy to draft a short responsibility table for this thread (role, what it checks, the record it produces, and which outcome vocabulary it may assert) in whatever docs format the maintainers prefer. No new mandate fields proposed from this side. The point is only that the delegation sentence already in the spec needs a named holder, a separate verdict record, and a "not checked" state before it can carry the risk case.

zambodotdev avatar Nov 21 '26 18:11 zambodotdev

@zambodotdev's three-role split is the right skeleton, and it matches what we found running this layer in production: producer / checker / relying party only works if the checker's verdict is a record, not a side effect.

Three implementation notes from operating exactly this boundary:

  1. "not checked" has to be a verdict, not an absence. In our trail-head work upstream of this thread we kept continuity_only / not_evaluated as distinct outcomes precisely because a consumer that pattern-matches on continuity reads silence as clearance. The same holds for risk: an autonomous flow where no assessment ran must produce a receipt that says so, or downstream parties will infer a pass that never happened. If the taxonomy lands, I'd argue not_checked belongs in the closed vocabulary next to constraint_violation / risk_decline / policy_decline, not beside it.

  2. On @Flyingmiata-droid's declined_by: second the field, and the reason is evidentiary not taxonomic. An assurance-layer decline rendered pre-authorization never reaches the network — no response code exists, and months later the verdict record is the only artifact that says the payment was stopped here rather than by the issuer, or not stopped at all. We already emit provenance on every decline for exactly this reason; without it, dispute reconstruction conflates "assurance said no" with "no one looked."

  3. The producer-asserted-verdict trap is real and worth making normative. A verdict asserted by the party being assessed is self-graded homework — the checker MUST be a different principal than the producer, and the verdict record should be bound (content-addressed or signed) to the exact mandate + context it evaluated, otherwise a changed verdict is undetectable. Same discipline as the output_hash point: the record proves what the checker concluded about these inputs, nothing more.

On the responsibility-table offer: if it's useful, we can publish the verdict taxonomy + conformance vectors we run for the checker layer — same contribution pattern as the cadence vectors earlier in #290. Happy to format to whatever the maintainers prefer rather than propose new mandate fields.

nmatt1 avatar Nov 23 '26 16:11 nmatt1