← Back to digest
AI Security

LongPIBench: prompt injection in long contexts

What's this about?

Prompt injection is a serious risk to deployed LLM applications, and there are benchmarks for it — but they overwhelmingly use short inputs. LongPIBench is a long-context benchmark, on the argument that the attack surface everyone actually deploys against has gone unmeasured.

Why would context length change anything?

Because with a long context, an attacker gets to choose *where* the injection sits, and the model's attention is not uniform. An instruction buried 80,000 tokens deep, in the middle of a retrieved document, behaves differently from one in a 500-token prompt — sometimes it is ignored, and sometimes it wins precisely because the legitimate instructions are far away and diluted. Position becomes an attack parameter, and short-context benchmarks cannot express it.

Why does this matter to you?

  1. Any agent that reads files, fetches pages, or does retrieval is operating in exactly the long-context regime this measures.
  2. It reframes injection defence as a positional problem, not just a content-filtering problem.
  3. Prompt injection has been at or near the top of agent-threat rankings all month; this is the benchmark gap that lets it stay there.
← Beyond F1: evaluating AI model security scannersContextLeak: exfiltrating agent context through a malicious tool →