Posts

Showing posts from November, 2026

Detecting Prompt Injection in Application Logs: Sample Patterns, Rules and Test Results

Most prompt injection advice is about prevention: better system prompts, input filters, guardrails. Prevention will sometimes fail, and when it does, your application logs are where the first evidence appears. If you aren't logging the right fields, or aren't looking at them, an attacker can probe your chatbot, voice agent or AI assistant for days without anyone noticing. This article shows what prompt injection attempts look like in logs from five kinds of AI application, gives you detection rules you can adapt, and reports how those rules performed on a labeled test set, including the false positives and misses. What you'll get A minimal log schema for LLM apps Sample log lines for a support chatbot, a food ordering bot, a voice AI agent, a document (RAG) assistant and a tool-using agent A weighted rule set, with starter code Test results from 88 development events and 33 held-out events 1. What to log before you can detect anything You can't detect what you d...