Check a foreign-language customer reply by back-translation
Prevent AI from altering dates or inventing promises in foreign customer replies. Translate with strict constraints and back-translate to verify.
When responding to overseas customer inquiries regarding shipping delays or broken items, AI translation tools can alter delivery dates, modify refund figures, or add unauthorized promises such as coupons or complimentary gifts. While generative models handle polite honorifics well, unverified additions cause direct financial liabilities and customer friction. Define strict factual constraints in the translation prompt, generate the foreign reply, back-translate it into English within an isolated session, and verify factual consistency with a Python script. For enforcing standardized terms across translations, see Check glossary consistency in AI translations.
[1] Prepare the initial English response draft with explicit factual anchors. A handcrafted pottery studio is addressing a damaged item and reshipment for an overseas Japanese customer.
Hello, this is the Sodam Craft Studio Customer Support Team.We sincerely apologize for the shipping delay and the item damage regarding your inquiry for order number ORD-2026-8841.After reviewing the issue, we will process a partial refund of $45.00 for the 1 broken teacup to your original payment method within 3 business days (by 2026-10-21). In addition, the remaining 2 undamaged ceramic plates from your order will be re-shipped on 2026-10-19 under new tracking number KP-9921-3048, with an expected arrival date of 2026-10-28.We deeply regret any inconvenience caused during delivery. If you have any further questions, please do not hesitate to contact us.Warm regards,Sodam Craft Studio Customer Support TeamFive key factual elements must remain untouched:
- Order ID:
ORD-2026-8841 - Refund amount:
$45.00 - Dates and timeline:
3 business days,2026-10-19,2026-10-21,2026-10-28 - New tracking ID:
KP-9921-3048 - Quantities: 1 broken teacup, 2 replacement ceramic plates
[2] Structure the translation prompt. Enforce verbatim retention of identifiers and explicitly prohibit unauthorized commitments.
Translate the following English customer support email into polite, professional Japanese (Keigo suitable for customer support). Strict Constraints:1. Preserve all factual values exactly as written: - Order ID: {ORDER_ID} - Dates: {DATES} - Amount: {AMOUNT} - Tracking number: {TRACKING_NUMBER} - Quantities: {QUANTITIES}2. Do not add any new promises, discounts, replacement gifts, or explanations not present in the original English draft.3. Output only the Japanese translation without introductory or concluding conversational filler. <email_draft>{DRAFT_TEXT}</email_draft>[3] Execute the translation with Gemini.
$ agy -p "$(cat run/en-forward-1.prompt.txt)" --model gemini-3.8-flash --effort high --output-format text > run/en-forward-1.out.txt$ cat run/en-forward-1.out.txtこんにちは。Sodam Craft Studio カスタマーサポートチームでございます。 ご注文番号 ORD-2026-8841 に関するお問い合わせにつきまして、配送の遅延ならびに商品の破損によりご迷惑をおかけしましたことを、心より深くお詫び申し上げます。 状況を確認いたしましたところ、破損した湯呑み1点につきまして、3営業日以内(2026-10-21まで)にご利用のお支払い方法宛てに$45.00の部分返金手続きを行わせていただきます。また、ご注文のうち破損のなかった残りの陶器プレート2点につきましては、新しい追跡番号 KP-9921-3048 にて2026-10-19に再発送され、お届け予定日は2026-10-28となっております。 配送中にご不便をおかけいたしましたことを、重ねて深くお詫び申し上げます。その他にご不明な点がございましたら、どうぞお気軽にお問い合わせください。 何卒よろしくお願い申し上げます。Sodam Craft Studio カスタマーサポートチームA second execution (run/en-forward-2.out.txt) produced slight wording differences in Keigo (such as 「到着予定日」 instead of 「お届け予定日」), while keeping all identifiers, amounts, and dates identical.
[4] Back-translate the Japanese output into English in an isolated session. Never supply the original English draft; the model must evaluate only what exists in the generated Japanese text.
$ agy -p "$(cat run/en-back-1.prompt.txt)" --model gemini-3.8-flash --effort high --output-format text > run/en-back-1.out.txt$ cat run/en-back-1.out.txtHello. This is the Sodam Craft Studio Customer Support Team. Regarding your inquiry concerning order number ORD-2026-8841, we sincerely and deeply apologize for the inconvenience caused by the delivery delay and the damage to the product. Upon confirming the situation, regarding the 1 damaged teacup, we will process a partial refund of $45.00 to the payment method used within 3 business days (by 2026-10-21). In addition, regarding the remaining 2 ceramic plates from your order that were not damaged, they were re-shipped on 2026-10-19 under the new tracking number KP-9921-3048, and the estimated delivery date is 2026-10-28. We once again deeply apologize for the inconvenience caused during delivery. If you have any other questions, please feel free to contact us. Sincerely,Sodam Craft Studio Customer Support TeamA repeated back-translation run (run/en-back-2.out.txt) changed the wording ("item damage" instead of "the damage to the product") and kept the IDs, dates, and amounts. It also changed "they were re-shipped" to "they were reshipped"; in both runs the planned re-shipment is worded as already done. [5] and [6] deal with this.
[5] A script that compares the draft with the back-translation. It does five things: checks that the order ID, tracking number, dates, and amounts in the draft appear unchanged in the back-translation; checks that no date or amount appears in the back-translation that was not in the draft; checks that the numbers next to "teacup", "plates", and "business days" match; looks for planned steps (re-shipment, refund) reworded as already done, using one wording pattern; and looks for 8 listed words such as discount and coupon. Other promises (for example an extra service worded with a different word) and changes of meaning are not caught.
#!/usr/bin/env python3"""usage: check_facts.py draft.txt back.txt - compare IDs, dates, amounts, quantities and one wording pattern"""import sys, re doc = open(sys.argv[1], encoding="utf-8").read()out = open(sys.argv[2], encoding="utf-8").read() ID = r"(?<![A-Za-z0-9])[A-Z]{2,4}-\d{4}-\d{4}(?![A-Za-z0-9])"DATE = r"(?<!\d)\d{4}-\d{2}-\d{2}(?!\d)"AMT = r"\$\d+(?:\.\d{2})?"facts = lambda t: sorted(set(re.findall(ID, t) + re.findall(DATE, t) + re.findall(AMT, t)))base, got = facts(doc), facts(out) KW = ["찻잔", "접시", "영업일", "teacup", "plates", "business days"]def numbers_near(text, kw): t = re.sub("|".join([ID, DATE, AMT]), " ", text).lower() k = re.escape(kw) pre = re.findall(rf"(?<!\d)(\d+)(?!\d)\s*(?:[a-z-]+\s+){{0,3}}{k}", t) post = re.findall(rf"{k}\s*(?<!\d)(\d+)(?!\d)", t) return set(pre + post) DONE = re.compile(r"(?:were|was|has been|have been)\s+re-?shipped|재(?:배송|발송)(?:되었|됐|했)|" r"refund[^.]{0,40}(?:was|has been|were) processed|환불[^.]{0,20}(?:처리되었|처리됐)")bad_terms = ["할인", "쿠폰", "전액 환불", "무료", "사은품", "discount", "coupon", "free gift"] miss = checked = 0for val in base: checked += 1 ok = val in out print(f"{'OK ' if ok else 'MISS'} fact: {val!r}") miss += not okfor val in got: if val not in base: checked += 1; miss += 1 print(f"FAIL new value not in draft: {val!r}")for kw in KW: want = numbers_near(doc, kw) if kw in doc.lower() else set() if not want: continue checked += 1 have = numbers_near(out, kw) ok = want <= have print(f"{'OK ' if ok else 'MISS'} quantity near {kw!r}: draft {sorted(want)} / back {sorted(have)}") miss += not okif not base: print("WARN: empty facts in original draft"); miss += 1if DONE.search(out) and not DONE.search(doc): print(f"FAIL status: back-translation words a planned step as done: {DONE.search(out).group(0)!r}") miss += 1added = [w for w in bad_terms if w in out.lower() and w not in doc.lower()]for w in added: print(f"FAIL promise word {w!r} found in back-translation"); miss += 1if not added: print("OK promise words: none of the 8 listed terms were added")print(f"{checked} checks, {miss} problem(s)")sys.exit(1 if miss else 0)The Google Gemini prompting strategies guide advises breaking a task into steps and stating constraints specifically. This guide keeps translation and verification in separate steps for the same reason.
[6] Run the check on the back-translations. This time it flags both back-translations (en-back-1, en-back-2), 2 of 2: the draft says the plates "will be re-shipped", while the back-translations say "they were re-shipped" and "they were reshipped", which turns a planned shipment into a completed one.
$ python3 run/check_facts.py run/en-draft.txt run/en-back-1.out.txtOK fact: '$45.00'OK fact: '2026-10-19'…OK quantity near 'teacup': draft ['1'] / back ['1']OK quantity near 'plates': draft ['2'] / back ['2']OK quantity near 'business days': draft ['3'] / back ['3']FAIL status: back-translation words a planned step as done: 'were re-shipped'OK promise words: none of the 8 listed terms were added9 checks, 1 problem(s)The same file with that one phrase changed by hand to "they will be re-shipped" (run/en-back-hand-ok.txt, not model output) passes with exit code 0.
$ python3 run/check_facts.py run/en-draft.txt run/en-back-hand-ok.txtOK fact: '$45.00'OK fact: '2026-10-19'…OK quantity near 'teacup': draft ['1'] / back ['1']OK quantity near 'plates': draft ['2'] / back ['2']OK quantity near 'business days': draft ['3'] / back ['3']OK promise words: none of the 8 listed terms were added9 checks, 0 problem(s)[7] Test the script's gaps. Using basic word boundaries like \b made the extraction return empty lists when an ID touched a Korean particle, which produced false passes. The script now uses non-alphanumeric lookarounds such as (?<![A-Za-z0-9]) and fails when the draft yields no values.
Three hand-made bad inputs (a changed amount plus an added 20% discount coupon, "3 business days" changed to "5 business days", and an added new date) were tested, and all 3 exited with code 1. The output for the changed amount in run/en-back-bad-amount.txt (not model output):
$ python3 run/check_facts.py run/en-draft.txt run/en-back-bad-amount.txtMISS fact: '$45.00'OK fact: '2026-10-19'…FAIL new value not in draft: '$60.00'OK quantity near 'teacup': draft ['1'] / back ['1']OK quantity near 'plates': draft ['2'] / back ['2']OK quantity near 'business days': draft ['3'] / back ['3']FAIL promise word 'discount' found in back-translationFAIL promise word 'coupon' found in back-translation10 checks, 4 problem(s)[8] Weak points and limitations. Across the two runs, the teacup went from "1 broken teacup" in the draft to "1 damaged teacup" in both back-translations. The script compares only the number, so it passes. When exact catalog wording or SKUs matter, add a preservation rule to the prompt and check by hand.
Do not read a pass as proof that nothing is wrong. Promises outside the new-date, new-amount, and 8-word checks, and translations that change the meaning, pass. Never rely solely on back-translation for formal legal settlements, product liability disputes, or high-value claims; have a reviewer who knows the language check it before it is sent.