AI Agent Shopping Security: Why the Mandate Translation Step Is the Biggest Risk

    Before an AI agent can make a purchase on a user's behalf, it needs a signed authorization document called a mandate. Yet signatures and payment isolation only verify integrity, not correctness. This article examines why the natural-language-to-mandate translation step is the weakest link in agentic payment flows, breaks down common translation failures such as unit errors and semantic drift, and presents practical defenses including dual-path parsing, amount back-checking, and human confirmation thresholds, with illustrative Python code.

    1. Why Agentic Shopping Needs a Mandate

    Before an AI agent completes a purchase for a user, it needs a pre-agreed written authorization specifying what can be bought, the maximum spend, and who gets paid. This document can be called a mandate. It converts the user’s intent into machine-checkable structured fields and acts as a constraint credential in the payment chain.

    Many developers intuitively assume that once a mandate exists, the agent cannot overspend. That assumption holds in most scenarios. Payment credential isolation, signature verification, and risk-control rules block most unauthorized operations. However, these mechanisms only check whether a mandate is valid and untampered—they do not check whether the mandate was written correctly in the first place.

    2. Four Gates: From One Sentence to a Charge

    In a “user-not-present” flow, the path from instruction to charge typically passes through four stages:

    1. Translation: The agent converts the user’s natural-language instruction into two types of mandates. One is an open-state constraint mandate that only defines boundaries, such as product category, spending cap, and allowed merchant scope. The other is a locked-state order mandate that, once a specific item is selected, fixes the order ID, amount, and payee.
    2. Constraint confirmation: The user reviews the constraint mandate through a trusted interface and signs it.
    3. Order locking: The agent selects an item within the constraints, generates the locked mandate, and the authorizing party signs it.
    4. Charging: The payment side verifies signatures and checks that fields satisfy the constraints, then executes the charge.

    Signatures solve the problem of “has the content been modified.” Changing a single character causes verification to fail. But a signature cannot judge whether the content was correct to begin with. If the translation step gets the spending cap wrong, the signature will faithfully protect that wrong result. Similarly, wallet or payment credential isolation only protects card numbers and fund channels—not the semantics of the mandate.

    Therefore, the weakest point in the entire chain is the first step. The translation that happens before signing is what actually determines “how much can be spent at most, and on what.”

    3. Where the Risk Lies: Forms of Translation Deviation

    Take the instruction “a black windproof shell jacket, under 500 yuan.” A human reader understands: category is shell jacket, color is black, function is windproof, and price does not exceed 500 yuan. The translation step can produce the following deviations.

    Unit errors. Payment systems usually record amounts in the smallest currency unit, so 500 yuan should be written as 50,000 cents. In one comparative test, a model wrote the cap as 50,400 cents—504 yuan. The number looks close, but the unit conversion was wrong. As long as the signature passes, this kind of error will sail through subsequent checks.

    Field completion. Constraints the user never stated get added automatically, such as specifying a particular store or product line. The search scope narrows as a result—or, in other scenarios, gets silently expanded.

    Semantic drift. “Windproof” becomes “waterproof,” or “black” is generalized to “dark colors.” The words are similar, but the purchase outcome can be completely different.

    Payee expansion. The merchant scope allowed by the constraint mandate is quietly broadened, so funds may flow to payees the user never authorized.

    These deviations are hard to catch for two reasons. First, users usually only glance at a summary. Second, if the trusted interface displays the model’s paraphrased text, the user is seeing the translated output rather than their own original wording. The “confirmation” the interface obtains is effectively only a confirmation of the translation result.

    4. Defense Design: Catching Errors Before Signing

    To address these risks, an independent verification layer can be added between translation and signing. The following measures can be combined.

    1. Dual-path parsing and comparison. Parse the same instruction through two independent paths—for example, a rule-based parser and a model-based parser. If the structured fields disagree, reject execution outright and ask the user to re-confirm.

    2. Amount unit normalization. Use one smallest unit and one precision consistently inside the system. When displaying on the interface, show both the value in major units (e.g., yuan) and the internal system value, so users never see only one of them.

    3. Field whitelisting. The mandate may only contain fields defined in the constraint template. If a restriction does not appear in the user’s original words, the user must explicitly check a box to confirm it—the system must not fill it in by default.

    4. Numeric back-checking. Extract numbers directly from the user’s raw input and compare them item by item against the structured fields. Block execution when the deviation exceeds a set threshold. This step does not rely on the model and can catch unit and order-of-magnitude errors.

    5. Side-by-side display of original words and fields. The interface shows the user’s original text alongside the structured fields, item by item, with differences highlighted. Users see verifiable raw information rather than a piece of translated text.

    6. Human confirmation thresholds. When the amount exceeds a preset value, new fields are added, or the payee changes, human confirmation is mandatory—no automatic pass-through.

    7. Least privilege. Signing keys are used only for constraint mandates and locked mandates. Payment credentials are not handed to the agent or to merchants. Even if translation goes wrong, the blast radius of the faulty authorization stays within a controlled limit.

    5. Illustrative Code

    The code below demonstrates two checks: first verify the signature, then perform an amount back-check. The order must not be reversed. A passing signature only proves the mandate was not tampered with; the comparison is what proves the mandate matches the user’s intent.

    1. # Illustrative code; replace specific functions with implementations
    2. # from your cryptography and data processing libraries
    3. class MandateMismatch(Exception):
    4. pass
    5. def verify_mandate(public_key, mandate, signature):
    6. # 1. Verify the signature first: confirm the mandate was not
    7. # modified after signing
    8. digest = sha256(canonical_serialize(mandate))
    9. if not verify_signature(public_key, digest, signature):
    10. raise MandateMismatch("Signature verification failed; mandate may have been tampered with")
    11. return True
    12. def check_amount(parsed_limit_minor, user_text_yuan, tolerance_minor=0):
    13. # 2. Then back-check: align the amount in the user's original
    14. # words with the structured field
    15. expected_minor = round(user_text_yuan * 100)
    16. if abs(parsed_limit_minor - expected_minor) > tolerance_minor:
    17. raise MandateMismatch(
    18. f"Amount mismatch: user stated {user_text_yuan} yuan, "
    19. f"mandate contains {parsed_limit_minor / 100} yuan"
    20. )
    21. return True
    22. # The user said "under 500", but the structured field is 50,400 cents
    23. check_amount(parsed_limit_minor=50400, user_text_yuan=500)
    24. # Raises MandateMismatch: amount mismatch

    This code covers only the amount. A real system must apply the same back-checking to product category, merchant scope, payee, and validity period. Every failed comparison should block the charge rather than merely writing a log entry.

    6. Summary

    The security boundary of agentic shopping cannot rest solely on signatures and payment isolation. Signatures protect the integrity of the mandate during transmission and storage, while the translation step determines whether the mandate’s content is correct in the first place.

    Developers can start with three things. First, add an independent verification layer between translation and signing that back-checks amounts, categories, and payees against the user’s original words. Second, unify amount units so the interface and backend share a single representation. Third, place human confirmation at critical points where amounts, fields, or payees change. That way, even if a model turns “under 500” into 504 yuan, the error gets stopped before any money moves.