Prompt Injection Live: Attacking My Own LLM App
I attacked my own language model app and a secret leaked. Then I ran the same attacks against three defences, and in this small test one of them made it worse.
Video #18 ยท AI security and governance
Steps in the video
Files
- attack.py (10 lines)
- defend.py (26 lines)
- shop.py (38 lines)
Tested with
Python 3.12.15 | ollama==0.6.3
What this does not show
One small local model and three attack emails, one run each, so the counts are not a general result for any model or defence. The discount code is made up. The output filter's zero is true by construction (the score uses the same string check) and an exact-string filter misses reworded leaks.
Sources
Learning IT by Example.