The Prompt Tweak That Fooled Us 5 Times, and the Code Gate That Actually Fixed It - Part 1
说明与用途
通过冻结上游边界并仅重放更改的边界,确保大型信用额度转到人工审核的 AI 计费代理错误修复自动化方案。
问题
An AI billing agent incorrectly settled a $48,000 credit for a customer downgrade due to missing policy clauses and stale database state, and a subsequent prompt tweak failed to reliably prevent similar errors.
结果
The replay approach uncovered that the prompt tweak was ineffective because the staged environment did not reproduce the stale database state. By freezing upstream boundaries and replaying only the changed boundary, the fix reliably routes large credits to human review.
工作流
- 1. Record all boundary inputs/outputs during the incident.
- 2. Key envelopes by (boundary_name, per_name_call_index).
- 3. Scrub PII before writing to disk.
- 4. Freeze upstream boundaries and replay only the modified boundary.
- 5. Verify that the new rule routes large credits to human review.
证据
The agent had everything a modern 2026 AI stack is supposed to have: a flagship reasoning model (Claude Opus 4.6), billing policy chunks pulled from a vector database (RAG), and warehouse and Stripe ledger access through MCP (Model Context Protocol).
At 9:15 AM, the on‑call engineer opened the system prompt and added a bold rule: CRITICAL: Never set auto_settle=True for credits above $5,000; always route to human_review.
Instead of re‑running an agent from the beginning to verify a fix, you aren’t replaying the incident—you are drawing one fresh sample from an environment that has already moved on.
The iron law of agent debugging is simple: freeze the run, not the model.
- 记录日期: 2026-10-20T06:41:17.077Z