learning-it by example

Back to the video

Support Agent: Let Code, Not the Model, Pick the Customer

No attack I tried reached another customer's order. I still moved the customer check into the code.

Video #34 ยท AI agents and MCP

Steps in the video

  1. 0:00 No attack got through
  2. 0:27 The idea
  3. 1:05 Setup
  4. 1:22 The shop
  5. 1:47 Two designs
  6. 2:14 The attack list
  7. 2:43 A fooled caller
  8. 3:40 What this does not show
  9. 4:12 Mistakes to avoid
  10. 4:39 My take and next steps
  11. 5:03 Recap

Files

  • agent.py (68 lines)
  • compare.py (26 lines)
  • shop.py (9 lines)

Download the code (zip)

Tested with

Python 3.12.15 | ollama==0.6.3

What this does not show

Four attacks, one prompt wording and one run of one small model (llama3.2), so the model result proves little; only the fooled-caller check is exact. The shop is made up, with no real login, sessions or refunds.

Sources

Learning IT by Example.