Payment-path verification: getting a customer verified in a day¶
Who this is for. A platform that pays other businesses from a batch, a scheduled job or a Stripe Connect account, and wants to know, for every payment, that the destination about to be paid is the one that was approved. A restaurant-ordering platform settling nightly to its restaurants is the worked example throughout, because that is the incident this control was built against.
What it answers. Not did somebody approve this payment (that is Wire Verification, a separate control) but is the destination the one that was approved. In a payment-redirection fraud the approval is genuine; only the account changed.
Where it stands. Built and tested in code. It has not yet run against a
customer's live settlement run, and the capability table says so
(Roadmap). The sentence that moves it to the next tier is: a customer's
settlement run, with intents registered where the destinations are
legitimately set, has produced observations for every expected payment and
held at least one planted divergence. Your first day is that sentence.
Last verified against code: 2026-11-15. The engineering copy of this page is docs/customer/payment-path-onboarding.md in the repository.
1. Before anything is built: four questions you answer¶
Everything downstream depends on where a destination account is legitimately established, and where it is last legitimately changed. We register the approved destination at that point. Everything after it is monitored path. Everything before it is out of scope, and if we register later than the point an attacker can reach, we attest the tampered value and then verify it perfectly.
Answer these in writing, per surface, before the first intent is registered:
| # | Question | Why it decides the design |
|---|---|---|
| 1 | Where is a payee's settlement account set, and where can it be changed? On a machine at the payee's site, in your web application, in your back-office onboarding, or more than one of these? | Each write path is either covered by a registration step or is a gap we name. "More than one" is the usual answer and the hardest. |
| 2 | Does Stripe (or your processor) hold the destination, or does your batch supply bank details per payment? A Connect external account that payouts leave through, or account and routing numbers in the file you send? | Processor-held: the tamper surface is whatever can change the external account, so we watch that mutation and payouts carry only a token. Batch-supplied: the tamper surface is your database and the batch, so the comparison is on the account itself, inside the submitting process. |
| 3 | Which screens, APIs and jobs can change a settlement account? Every one, including support tools and direct database access. | The list is the coverage denominator. A screen not on it is a blind spot we print, not one we miss silently. |
| 4 | What audit exists today for a change to that field, and does it survive somebody with database access? | Decides whether a registration can be triggered from your existing change record, or needs a step in your process. |
A worked answer for the restaurant platform: the account is set once at onboarding by operations (question 1), Stripe Connect holds it as the restaurant's external account (question 2), it can be changed by an operations tool, by the restaurant in the portal, and by anyone with database access (question 3), and the database audit does not survive the last of those (question 4). That answer selects path (a) below for the processor side and path (b) for the submitting process, and names "database access" as the write path only registration at onboarding covers.
2. Three ways to connect, and the honest effort of each¶
You can run more than one. Most Connect platforms run (a) and (b) together: (a) sees what Stripe did, (b) stops a payment before it leaves.
(a) Stripe Connect, no code¶
Effort: one afternoon. A Stripe dashboard change and a portal session.
- In the portal, Payment Path → Stripe, copy your webhook URL. It is
https://<your app host>/payment-path/stripe/webhook/<your tenant id>, printed for your region. - In the Stripe dashboard, add a webhook endpoint at that URL, listening on
your Connect account for
account.external_account.created,account.external_account.updated,account.external_account.deleted,payout.*andtransfer.*. Copy the endpoint's signing secret (whsec_...). - In the portal, paste the signing secret. It is stored encrypted and never shown again; the page shows its last four characters and, from then on, how many events arrived, were mapped, were ignored, and were refused.
- Register the approved destinations. For each connected account, propose two records on the Payment Path page, and have a second administrator approve them:
- reference
acct_…with destination tokenacct_…(what a transfer points at); - reference
acct_…/external-accountwith destination tokenba_…and its last 4 digits (what payouts leave through and what an external-account event changes).
What this catches. An external-account change at Stripe that nobody attested is recorded as a tamper verdict against the attested token, and every later payout to that connected account is held as not clearing until a person looks. A payout or transfer to a token nobody attested is a tamper verdict. A redelivered event is recorded once.
What this does not do, stated plainly. It never clears a payment and it never stops one. Stripe returns at most the last four digits of an account, so a webhook observation is always partial: a payout that matches the attested token is recorded as consistent but partial, held, and cleared only by Layer 1 (path b) inside your process. Stripe's events arrive after the fact. A payment that produces no Stripe event produces no record. And an intent registered after the attacker's change attests the wrong value and verifies it perfectly (section 1, question 1).
(b) RASP in the submitting process¶
Effort: one day. A package install, two environment variables, a client certificate, and the intent registrations from your system of record.
- In the portal, Payment Path → Certificates → Issue. You get a client certificate for your tenant and a private key shown once. Save both where the paying process reads its secrets. (Or generate the key yourself and submit a certificate signing request; the key then never leaves your systems.)
- In the process that submits payments:
pip install cyberarmor-rasp(or the package for your language) and set
CYBERARMOR_PAYMENT_PATH=enforce # or observe, to record without blocking
CYBERARMOR_CONTROL_PLANE_URL=https://payments.<region host>
CYBERARMOR_CLIENT_CERT=/path/client.pem
CYBERARMOR_CLIENT_KEY=/path/client-key.pem
payments.<region host> is the mTLS hostname for your region
(payments.cyberarmor.ai in the US). The hook inspects every call your
process makes to a known processor host and asks for a verdict before
the request leaves. In enforce mode anything but clears raises an
exception into your code and the payment does not go. In observe mode it
records the verdict and lets the payment go.
3. Register intents from your system of record, at the point a destination is
legitimately set or changed, by calling POST /payment-path/intents on the
mTLS hostname with your certificate. The tenant is the certificate's; the
body needs only the reference, the destination (bank account fields, or a
processor token with its last 4), who registered it and from where.
4. Declare every surface money can leave through (PUT
/payment-path/surfaces, or the portal). A surface you cannot instrument is
declared unobserved with a written reason; the service refuses one
without.
What this catches. A destination changed anywhere upstream of the submitting process: in your database, in a batch file, by a compromised integration, by an insider after sign-off. This is the incident. The payment is blocked before it leaves, not reported afterwards.
What this does not do. An attacker who owns the submitting process at
submission time can unhook the library or set observe. That is why (a) or
(c) runs beside it: the coverage report counts the payments your intents say
to expect against the ones a control point saw, and prints the difference. A
payment with no observation is reported as such and never as clean. And, as
always, an intent registered after the tamper attests the wrong value.
(c) Batch or ERP: signed intent upload¶
Effort: half a day for a one-off file; a day to automate.
For a platform whose system of record is a finance system or a flat file, the
approved destinations are uploaded as a batch rather than registered one by
one: a CSV or JSON file of references and destinations, posted to
POST /payment-path/intents once per row on the mTLS hostname with your
certificate (the quickstart script in section 4 does this), or proposed in the
portal and approved by a second administrator. Observations then come from (a)
or (b).
What this catches and does not. The same as whichever path produces the observations. The upload decides only what correct means; it is only as good as the moment it is taken from your system of record, so take it at the point a destination is approved, not from a nightly export of the current state.
3. The Payment Path page¶
One page, under Detect & Respond. From top to bottom:
- Coverage, with its denominator. "N surfaces declared, M reporting in the last 25 hours, K silent", and payments expected against payments with an observation. There is no "clean" indicator and there will not be one: a run where the integration silently stopped must look different from a run where every payment verified, and the only way to do that is to print what was expected beside what arrived.
- Certificates. Issue, renew, revoke. Each row names who issued it and when it expires (at most 13 months; renewal is the norm). Revoking is effective on the next request.
- Approved destinations. The intents, with who proposed and who approved each. Adding one takes two administrators: one proposes, a different one approves. The same person is refused. A destination that changed shows its history, which is the earliest sign of the incident.
- Observations and verdicts. What each control point saw and what the classifier decided, in the last 25 hours.
- Stripe. The webhook URL for your region, the stored secret's last four characters, and the event counters.
4. The quickstart: your first day's acceptance test¶
scripts/demo/payment_path_quickstart.py (Python standard library only) runs
against your certificate on the mTLS hostname:
python3 scripts/demo/payment_path_quickstart.py \
--base https://payments.cyberarmor.ai \
--cert client.pem --key client-key.pem \
--reference REST-1042 --display-name "Golden Wok - Chicago" \
--token ba_1GoldenWok --last4 6789
It declares api.stripe.com as an observed surface, registers one intent,
posts one observation that matches it and one that diverges, and prints the
two verdicts and the coverage report. The matching observation clears; the
diverging one is a tamper verdict. When both print as expected, the path is
wired end to end for your tenant, and the day is done.
Two things it will tell you honestly rather than work around: a 503 on the
intent means the vault that computes the attestation digest was unreachable
and nothing was registered; a 403 with payment_path_tenant_mismatch
means the certificate and the --tenant you passed disagree.
5. What is never stored¶
No account number is written to any table or log. The attested destination is an HMAC computed inside a vault whose key never enters an application process; an attacker who can rewrite account digits in your systems cannot forge a matching attestation, and that asymmetry is the control. The last four digits and the routing number are kept, in the clear, because they are all a processor will ever return and a comparison needs something to compare. Private keys for client certificates are generated on your side or returned exactly once; the platform keeps the certificate (public) and its fingerprint.
6. The lifecycle, in one table¶
The portal walks these as a wizard with a progress line per stage; a stage is done only when its check passed, and the check's numbers are printed beside it.
| Stage | Who | Done when |
|---|---|---|
| 1 Enable | tenant administrator | the feature is on and the four questions are answered |
| 2 Identity | tenant administrator | one client certificate is active |
| 3 Connect | your engineers | every chosen path passed its self-test: a signed Stripe event mapped; a RASP process checked in; an upload parsed with no rejected row |
| 4 Destinations | two administrators | one approved destination, proposed by one and approved by the other |
| 5 Observe | your systems | one declared surface reporting in the last 25 hours |
| 6 Respond | administrator or analyst | each alert acknowledged or handed to a callback from your directory of record |
| 7 Evidence | your compliance owner | the verdict history and the signed audit log, read side by side |
| 8 Offboard | tenant administrator | certificates revoked, the Stripe endpoint removed, the feature off; the evidence stays |