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
- HeyGen adds a media-sourcing skill for coding agents with 75k images and 10k tracks — HeyGen · 2026-07-22
- Agent search bottlenecks are now about variance, not raw latency — rohanpaul_ai · 2026-07-22
- LangSmith adds tracing for Pipecat, LiveKit, OpenAI Realtime, and Gemini Live — LangChain · 2026-07-22
- An MCP server signs every AI agent tool call into a verifiable Merkle chain — Funky_Chicken_22 · 2026-07-22
- Annotated transcript of a Claude Code team interview is now available — trq212 · 2026-07-22
- Claude Code skill uses 10 Markdown rules to make outputs ADHD-friendly — alex_verem · 2026-07-22