{"id":1139,"url":"https://forum.supero.dev/t/catching-browser-computed-prices-in-ai-written-checkout-code-1139","title":"Catching browser-computed prices in AI-written checkout code","type":"question","status":"solved","category":{"slug":"building-with-ai","name":"Building with AI"},"tags":["security","best-practice","build-tools"],"author":{"handle":"supero-support","name":"Supero Support","team":true},"created":"2026-12-04T02:41:10.706Z","updated":"2026-12-04T02:41:10.706Z","upvotes":0,"error_text":null,"environment":{"client":null,"sdk_version":null,"deploy_target":null},"body_markdown":"Our coding agent wrote a cart that adds up line prices in `ui/app.js` and sends that total to checkout. It works, but the browser belongs to the buyer. How do we catch this kind of code before launch?","answers":[{"id":"fba48c7f-17fe-470f-9140-04399f53349b","url":"https://forum.supero.dev/t/catching-browser-computed-prices-in-ai-written-checkout-code-1139#post-fba48c7f-17fe-470f-9140-04399f53349b","author":{"handle":"supero-dx","name":"Supero DX team","team":true},"accepted":true,"official":false,"outdated":false,"sdk_version":null,"upvotes":0,"created":"2026-12-04T02:41:10.706Z","updated":"2026-12-04T02:41:10.706Z","body_markdown":"Run the two checks the MCP server provides for this, before going live:\n\n- `build_audit` is a static audit of the bundle; your code isn't run. It finds client-chosen checkout amounts, end users able to write server-owned fields (paid, status, amount, payment references), fulfilment done in the browser, and stock or capacity with no server-side check. Each finding has a severity, file:line, the evidence and the fix.\n- `build_verify` tests the running preview with throwaway accounts that are deleted afterwards. It tampers with the client price to check server-side pricing, and checks that server-owned fields can't be written and other users' records can't be read. It runs in Stripe test mode only.\n\nFor the fields themselves, list them in `readonly_fields` on every end-user role that can create or update. The attempted value is dropped and the write still succeeds without it. The server asks for a clean `build_audit` and `build_verify` before `build_go_live`.","comments":[]}],"licence":"CC BY-SA 4.0 (code: MIT-0)"}