Claude invents a Stripe price id and CI still goes green
Asked Claude Code to wire a $20/mo Pro plan Friday afternoon. It wrote price_1PxFakeWhatever, mocked Stripe in the test suite, and the PR went green.
Saturday morning three people got charged against a price that doesn't exist in our dashboard. Stripe support was very calm about it. I was not.
Now every agent PR that touches billing needs a human to paste the real price id from the dashboard. Anyone else catching phantom resource ids before merge, or only after the invoice emails?
6 comments
Join the discussion
Log in to comment.
Mocks are the real bug. We had the same class of failure with a fake
prod_xxxProduct id — unit tests passed, staging used live Stripe, weekend was chaos.I keep a kill-list markdown in every billing repo: no hardcoded
price_/prod_strings unless they match a checked-in fixtures file we refresh from the dashboard weekly. Ugly. Beats refunds.We put "paste live Stripe ids from dashboard" into the agent acceptance criteria and it still invents them when the prompt mentions "Pro plan".
What finally stuck: a CI step that greps for
price_/prod_and fails unless the id is in an allowlist committed from Stripe export. Annoying for PMs. Catching phantom ids before merge is the whole point.yeah the allowlist from stripe export is the only thing that stuck for us too
had almost the same friday night: claude code "wired" checkout with
price_1ProMonthly, tests mocked the webhook, pr green. monday three EU customers got weird invoices for a plan that never existed in the dashboardi now paste the real id into the PR description myself before i even open the agent. if the agent invents one i just close the chat. not worth the saturday
Allowlist grep is necessary but not sufficient. We caught Claude writing the inventied id into
.env.localand a Helm values overlay — neither is in the allowlist path, both shipped.Now the check is: any
price_/prod_string outsidefixtures/stripe.jsonfails the job, including env files and k8s manifests. PMs hate it. We have zero phantom charges since.Also: stop mocking Stripe Checkout in the same suite that asserts invoice amounts. That combo is how you get green CI and Saturday refunds.
the helm overlay thing is exactly how we got burned. Claude wrote a perfectly plausible
price_1ProCADintovalues-prod.yamland our greps only scannedsrc/.we now fail the job if any
price_/prod_/sk_/rk_shows up outsidefixtures/stripe.json, including.env*, Helm, and Terraform. PMs hate the false positives. still cheaper than a Saturday refund queue.also: never let the agent touch the Stripe secret at all. if it can invent a price id it will invent a key next.
we almost shipped a fake price id last month too. designer me didn't even know Stripe ids looked like that until finance pinged.
now the rule on our team is dumb and it works: agent can draft the checkout UI, but the price_ line has to be a blank
REPLACE_MEuntil a human pastes from the dashboard. if CI still goes green with REPLACE_ME in it, we failed the gate, not the agent.