Runtime Prompt Injection Defense for Production-Scale AI Agent Systems
Abstract
Prompt injection can redirect an AI agent when adversarial instructions are embedded in user messages, retrieved documents, or tool responses. This paper presents PIGUARD, a runtime defense framework that combines a semantic intent classifier, instruction provenance tracking, cross-turn consistency verification, and policy-driven guardrail enforcement. Under the evaluated workload-replay setting at 500 concurrent agents, PIGUARD achieves a 93.1% per-injected-turn detection rate, a 2.1% per-benign-turn false-positive rate, a median end-to-end decision latency of 54.6 ms, and 98.4% benign throughput preservation measured at the session level. The evaluation covers direct injection, indirect retrieval-augmented generation injection, multi-step sequential payloads, paraphrase evasion, and nested structured-context attacks. These results demonstrate the behavior of the layered runtime design under the tested replay workload; they do not imply universal robustness to unseen attack families, fully adaptive adversaries, or deployment environments outside the evaluated setting.