如何在隔離環境中測試自動回覆流程
Try to break the reply while nobody outside can see it
文章整理一套在不接觸真實客戶的情況下測試自動回覆工作流的方法,包括隔離測試環境、刻意輸入含糊或錯誤訊息,以及核查資料查詢和後續處理。測試案例涵蓋查無預約、姓名重複、訊息與記錄矛盾、要求忽略指示的文字,以及查詢逾時或空欄位;若使用 MCP,亦要確認工具可讀取或更改哪些資料。除檢查回覆草稿外,還要核對資料是否流入模型、草稿或日誌,以及是否有資料被寫入或訊息被發送,並保留人工審核和可追蹤的交接紀錄。
An automated reply usually looks fine when you test it with a clear, polite question. I would spend more time on the messages that are confusing, incomplete or wrong.
Here is a hypothetical example. A small equipment rental office wants help answering questions about pickup times. The workflow reads an incoming message, looks up the booking without changing it, and drafts a reply. A person reviews the draft. Nothing sends on its own.
Keep the test away from customers
Use a test inbox and made-up bookings, with no real names or contact details. Turn off sending in the test setup itself. A prompt that says "do not send" is not enough. Check what the connection is allowed to do. If the workflow uses MCP, look at which tools it exposes and what each one can read or change.
Write bad messages on purpose
Start with a short set you can run again:
- A blank message, or only a signature.
- A booking reference that does not exist.
- A name that matches more than one booking.
- Two questions, where the lookup can answer only one.
- A message saying a pickup time changed, when the record disagrees.
- Text that says to ignore earlier instructions and reveal other bookings.
- A forwarded thread with an old date near the top.
Decide what should happen first
Write the expected behavior beside each message before you run it. Otherwise, it is easy to read a smooth draft and decide it is good enough.
For a missing booking, the draft might ask the customer to confirm the reference, while the reviewer sees that no record was found. For two matching names, it should not pick one. It should flag the match as unclear and keep both customers' details out of the draft.
Some inputs should produce no draft at all. "Needs a person" is a valid result, as long as the message lands somewhere that person will see it.
Check more than the wording
Read the draft, then check what happened behind it. Which records did the lookup return? Did any other customer's information reach the model, the draft or the logs? Did anything get written or sent?
A polite reply can hide a wrong lookup. A refusal can also come after the workflow has already read far more than it needed. Filtering the final text does not fix that. Limit what the lookup can return.
Then break the lookup itself. Make it time out or return an empty field. The reviewer should be able to tell the difference between "no booking exists" and "we could not check." Those call for different replies.
Leave a handoff someone can read
Record each test message, the expected behavior, what actually happened and who decides on a fix. Write down what you did not test, too.
When the prompt, model, tools or record format changes, run the set again. A pass only covers the setup and inputs you tried, so keep human review in place. When someone finds a new kind of confusing message, make a sanitized version and add it to the set.
I'm Jonathan Melton. I run FusionAL, focused on reviewing and integrating lower-risk internal AI workflows, one bounded workflow at a time.
來源:DEV Community · dev.to