Injection Testing on a Local Support Agent
jokiruiz · reddit · 2026-07-14
The author built a Flask support agent using a local Mistral Small model (via Ollama) to read orders and decide on refunds, specifically testing its resilience to prompt injection.
Results show:
- With a naive prompt, the model accepts forged SYSTEM instructions and directly approves unwarranted refunds.
- After adding a defensive prompt, the same model on the same machine starts rejecting attacks and can cite policies to explain why.
- The author notes the difference is literally just 5 lines of text.
Additional observations:
- Ollama's format: json solves most JSON output instability issues.
- Stronger LLMs won't necessarily save a bad prompt; the author mentions Sonnet resists injection but fails on a poorly defined business rule.
- He is looking for better fully local testing solutions and asked if there are better tools than promptfoo.
More from coding & agent
- Claude Code finds root backdoor in Honda Civic head unit, then debloats it — IndraVahan · 2026-10-26
- Claude Code + Monid MCP builds a $12K/year B2B prospecting engine on live data — aryanXmahajan · 2026-10-26
- Karpathy shares CLAUDE.md rulebook to stop AI coding agents from piling up tech debt — mdancho84 · 2026-10-26
- Rethinking dependencies in the agent era: drop libs that save 20 lines of code — gethackteam · 2026-10-26
- RustGIS hits 2,000 GitHub stars in two weeks with agent-first architecture — giswqs · 2026-10-26
- Vercel Ships 12 New Products at Its 2026 Conference as It Races Rivals for the Agent Entry Point — FinanceYF5 · 2026-10-26