A Harness for a Support Agent That Moves Money¶
What you build¶
In exercise/guardrails.py, four layers for a refund-capable support agent:
input_guardrail: route messages aimed at the AI, or floods of text, to a personscan_untrusted: withhold instructions hidden in order notes before they reach the contextrefund_guard: business rules on every refund call (known order, same customer, confirmed with the customer, within the total, under the auto-approval limit)output_guardrail: no other customer's email, no promises, no claimed refund that did not happen
support_agent.py wires them into harnesslab and plays four conversations, including one where the scripted model is fooled by a planted note and tries to refund someone else's $900 order.
Steps¶
- Implement the four functions;
python -m pytest -q. cd exercise && python support_agent.pyand read each scenario's outcome.
Done when¶
All six tests pass. In the injection scenario no money moves, even though the model asked for it.
Stretch goals¶
- Run the scenarios with a real model and see which layer stops it.
- Add an approval queue that a person clears, and resume the escalated refund after approval.