Last week I read about a lab experiment where a prompt injection was hidden inside an ordinary application log, and several AI models abandoned their task and followed the injected instruction instead. I had two reactions. The first was: that is a neat attack. The second was: I bet my own little agent setup would fall for it too.
So I tested it. On purpose. In a sandbox, against my own code, with nothing real at stake. This is the story of what happened, and the one-line fix that stopped it.
The setup
I have a small coding agent wired up to a toy web app I use for experiments — a fake shop with a product list, a cart, and a log file. The agent's job is simple: read the log, find errors, and suggest fixes. It has one tool that lets it run shell commands to inspect the app.…