User query (trusted) External — legit External — injected Blocked by filter Hijack (breached shield)

Prompt Injection Defense Simulator

Large language model applications routinely mix trusted instructions with untrusted external content — retrieved documents, scraped web pages, tool responses — inside the same context window, and an attacker only needs to plant a convincing instruction inside that external content to try to hijack the model's behavior. This simulator visualizes the defense pipeline that stands between them: every external chunk first passes a suspicion classifier that can block it outright, and whatever gets through still has to out-weigh the system prompt's own priority to actually seize control of the output. Tune the injection rate, filter sensitivity, system-prompt priority and sanitization to see how attack success rate and false-block rate trade off against each other — a stricter filter blocks more attacks but also more legitimate content, while a stronger system-prompt priority makes injected instructions need an implausibly large weight advantage to break through.