- Home
- Skills
- APIs & Backend
- money-path-probe
Money Path Probe
Ten probes that find the billing bugs a code review cannot: the retry that double charges, the charge that fires before fulfilment, the spend cap that holds in sequence and fails in parallel.
Free
Works with the AI Agents you already use
money-path-probe
Example session with this skill installed
Audit our new usage-based billing middleware. We use a custom Postgres meter and Stripe for payments. Start with the idempotency and budget cap probes.
- Read your context and instructions
- Compiled the money-path-probe
Illustrative output. Request ids are placeholders; real ones come from your own sandbox run.
Summary
Ran 10 probes against the billing middleware in Stripe test mode. 8 passed, 2 failed. The budget cap failure is the one to fix first: it is a correctness bug in a control a customer explicitly relies on, and it only appears under concurrency.
Findings
F-1 - Budget caps do not hold under parallelism - Critical
Probe 8, budget caps
Request ids <from your run>
Repro
- Set a hard cap of 10 units on a test account.
- Fire 12 single-unit requests concurrently, not in a loop with await.
- Read the committed total.
Expected 10 accepted, 2 refused, total exactly 10.
Actual 12 accepted, total 12. The cap read, compared and wrote without a lock, so every request saw the same pre-update value.
Who loses money The operator, plus the customer who set the cap so this could not happen. A cap that does not hold is worse than no cap, because it was relied on.
Fix direction The check is a read-modify-write. It needs a per-account lock or a compare-and-swap. An in-process mutex will look correct locally and do nothing across serverless instances.
F-2 - Failed calls are metered after authorisation - High
Probe 2, charge on failure
Request ids <from your run>
Repro
- Send a request that passes auth and fails downstream validation.
- Read the meter.
Expected No charge, or an authorisation explicitly voided.
Actual The meter incremented. It ticks in request middleware rather than on a successful response, so provider-side 5xx responses bill too.
Who loses money The user pays for nothing. Small per call, and it compounds with every retry.
Probe results
| # | Probe | Result | Note |
|---|---|---|---|
| 1 | Idempotency | pass | Replay returned the stored response, no second charge |
| 2 | Charge on failure | fail | F-2 |
| 3 | Non-billable verbs | pass | OPTIONS, HEAD and 304 all unbilled |
| 4 | Retry amplification | pass | Interrupted call retried to one charge |
| 5 | Reported vs actual | pass | Response totals matched the dashboard |
| 6 | Sub-unit rounding | pass | Floors consistently at call and invoice |
| 7 | Webhook signatures | pass | Stale replay rejected on timestamp |
| 8 | Budget caps | fail | F-1 |
| 9 | Revoked credentials | pass | Refused on the first call after revoke |
| 10 | Reconciliation | pass | Per-call sum matched the invoice |
Not tested
Nothing was probed outside test mode. Probe 7 used only webhooks delivered to this account.
Next steps
F-1 is a vulnerability a third party can trigger, so report it privately rather than in a public issue. F-2 is an ordinary correctness bug and can go in a public issue with the repro above.
Connects securely to your tools. The creator never sees your data.
About this skill
Most billing bugs are not arithmetic. They need a second request to expose them, which is why they survive unit tests and code review and show up in a refund queue instead.
This skill is a fixed battery of ten probes for anything that moves money or meters usage: a payments API, a usage meter, an agent spend cap, a webhook handler, a subscription flow. Each probe is one question with a yes or no answer and a one-line reproduction.
What it covers: idempotent replay, charging on failure after authorisation, non-billable verbs (OPTIONS, HEAD, 304), retry amplification across a dropped connection, the amount a response reports against the amount actually billed, sub-unit rounding, webhook signature replay with a stale timestamp, spend caps under concurrency, revoked credentials served from cache, and per-call charges reconciled against the invoice.
Every finding records one thing most bug reports leave out: who loses money when it is wrong, the operator or the user. "Retries double-bill, the user loses" is a refund queue. "Failed calls are not metered, you lose" is revenue leakage. Same defect class, different owner, different timeline.
Includes the per-probe reference (exact repro, what correct behaviour looks like, the common wrong implementations, who absorbs the loss) and a findings report template that records the probes that passed as well as the ones that did not.
Probe 3 comes from a real upstream fix: a CORS preflight billed as a payment (x402-foundation/x402 issue 3738). An OPTIONS request cannot carry a payment header, so the middleware read its absence as a fresh charge. Nothing in the test suite sent an OPTIONS.
Test mode and your own accounts only. The skill states that boundary and holds to it.
Requires sandbox access and test keys. Not a load testing tool. Only for authorized accounts. Concurrency testing limited to 12 parallel requests.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Free forever
No account required to browse
Trust & safety
Security scan
Security scan passed 9 days ago
- Free with an Agensi account