MendDocs
MendDocs
Security

We tried to break it

Every way we tried to make Mend pay the wrong person, pay too much or pay twice, what stopped each one, and the proof.

Mend moves money, so we attacked it the way someone trying to misuse it would. Each attack below was run for real, against the live app or in the test suites. Each one is stopped by code, not by asking the AI to behave.

You can run every attack here except the last AI row yourself, and the duplicate send needs a campaign you sent in step 4: open the demo and choose step 06, Break it. Each one sends a real request from your browser and shows what came back.

Money

What we triedWhat stopped itProof
Talk Claude into overspendingClaude only reads the numbers out of the goal. Code clamps them to the caps, USD 2 a customer and USD 10 a campaign in the demo, and the plan says what it lowered (goal.ts, fitPlan)goal.test.ts "clamps a demo plan to the demo caps and says so", and the live proof's "journey plan" line: 200 cents each, 1000 in total
Skip Claude and ask the engine directlyThe engine refuses any draft over its caps, per_recipient_over_cap or budget_over_cap (drafts.py)test_tasks.py "test_a_demo_draft_over_the_demo_caps_is_refused_and_stores_nothing"; test_drafts.py "test_every_bad_setting_is_refused_with_its_reason_and_nothing_is_stored"
Name a stranger to payNo route accepts a payee. Requests are checked against strict schemas, and payees only ever come from customers who joined with Log in with PayPal (approval.py, recipient_not_member)test_tasks.py "test_draft_settings_of_the_wrong_shape_are_refused"; console-routes.test.ts, the approve route's extra-key cases; test_eligibility.py "test_only_members_who_are_quiet_regulars_are_eligible"; test_approval.py "test_each_rule_is_rechecked_against_current_data_at_approval", case "a recipient whose member row is gone"
Change the plan after you see itApproval is bound to the plan's fingerprint. A different fingerprint is refused, hash_mismatch, and written to the audit log (approval.py)test_approval.py "test_a_hash_that_is_not_the_one_shown_is_refused_even_after_a_small_edit"; for the audit row every refusal leaves, test_approval.py "test_each_rule_is_rechecked_against_current_data_at_approval"
Send a plan nobody approvedOnly an approved campaign can be claimed for sending. Anything else sends nothing (submission.py, submit)test_submission.py "test_nothing_is_sent_for_a_campaign_that_is_not_approved"
Send the same campaign twiceEach campaign has one PayPal batch id, made from its frozen snapshot. A second send finds the batch and sends nothing, and PayPal itself refuses a repeated batch idtest_submission.py "test_an_approved_campaign_is_sent_once_from_its_frozen_snapshot" and "test_twenty_concurrent_submits_on_separate_connections_send_one_request", and the 20 Oct sandbox check that PayPal refuses a duplicate batch id

AI

What we triedWhat stopped itProof
Slip an email address to ClaudeMend replaces any email address in a goal with "[email removed]" before Claude reads it (goal.ts), and Mend's connection to Claude refuses any request that still holds one (claude.ts), so the address never reaches Claude and no plan can pay itclaude.test.ts "is refused before anything is sent or counted when the body holds %s"
Ask Claude to send the moneyClaude's tools only read and draft. None of them approves, sends, refunds or cancels (agent.ts)agent.test.ts "are exactly Mend's six guarded tools and PayPal's four read tools, with strict inputs" and "turns an approve-and-pay request into request_approval at most, whatever the model writes", and the agent evaluation, 16 of 16 on 30 Oct
Hide instructions in a customer's item names or in a PayPal answer (runs in our evaluation, not in the demo)Customer data reaches Claude inside marked data tags, and every note is checked before it is used: no links, no contact details, no prices, and no mention of PayPal, Venmo or any payment company (notes.ts)The injected-notes evaluation in packages/web/evals: 11 planted notes and 4 planted PayPal answers, all held on 30 Oct

Web

What we triedWhat stopped itProof
Send a fake PayPal webhookEvery delivery's signature is checked against PayPal's own certificate. A forged one is refused and nothing is stored (webhooks.ts)The live proof's "forgery" line: an altered copy of a real delivery refused, 400
Open a campaign that is not yoursEvery campaign route checks your session, and answers the same 404 whether the id belongs to another visitor or to no one, so it never reveals which ids exist (tasks.py, _checked_campaign)test_tasks.py "test_another_demo_session_gets_not_found_for_everything_on_a_campaign_it_did_not_create"; console-routes.test.ts "refuses a demo visitor another session's campaign with the same 404 submit gives"
Post without the page's security tokenEvery change needs a token bound to your own session, and the request must come from Mend's own site, or it is refused, 403 (csrf.ts)console-routes.test.ts "refuses a foreign origin, no token, and a token from another session, before the engine is asked"; csrf.test.ts "refuses a token from session A in session B"

What this does not cover

These checks show the guards hold for the attacks listed. They are not an outside security audit. The reviews that were run, and what each found, are on the Reviews page, and the rules the code is held to are in the threat model.