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
- AXL launches remote MCP server exposing 1,284 sales and marketing APIs to Claude and Codex — EdTech_Padre · 2026-10-27
- How the Claude Code Team Reviews Code When Claude Writes 90% of It — inductionheads · 2026-10-27
- AWS on agent prompt caching: explicit + implicit patterns to slash token costs — AWS ML Blog · 2026-10-27
- Reddit Thread: Keeping AI Agents Grounded in Current Project Information — Few-Ad-1358 · 2026-10-27
- He gave his AI agent a phone number and email — then hired it as social media manager — heyshrutimishra · 2026-10-27
- Firecrawl launches Alexandria company-data API and announces $75M Series B — devdigest · 2026-10-27