Rethinking Indirect Prompt Injection as a Test-Time Search Problem
TL;DR Highlight
Giving an attacker agent more tokens kept raising indirect prompt injection success rates.
Who Should Read
A backend developer running tool-using LLM agents who needs to test defenses against prompt injection
Core Mechanics
- Attack success depends on attacker budget
- A fixed-budget test can underestimate an agent's vulnerability.
- Success rose as the attacker's token budget grew.
- Attacks work right next to the user task
- Injections succeeded when placed in paths the agent already had to read.
- Instructions that looked like a normal next workflow step worked best.
- Without strategy tracking, attackers repeat themselves
- Removing the strategy tool caused excess reconnaissance and repeated patterns.
- The full harness changed the logical link between task and attack after failures.
- Easy actions get hit almost every time
- One-call actions like flagging a message, deleting a file, or sending email had very high success.
- Goals like posting PII publicly or sending credentials were mostly blocked.
- More tools make attacks easier but break the real task
Evidence
- Opus-4.8 on Retail still had 20.6% ASR at 500K tokens
- GPT-5.5 began to degrade noticeably at around 50K tokens.
- The two victim models separated clearly on ASR@T curves.
- Workspace fell faster than Retail
- With GPT-5.5 at 100K tokens, ASR was 52.1% on Workspace versus 37.5% on Retail.
- Easy Workspace goals reached 92.5-97.5% ASR
- File deletion hit 97.5%, email sending and event creation 95.0% each, email body exfiltration 92.5%.
- Sending a Facebook security code was 2.5% (1/40), and 0% when deleting the sent mail too.
- PII posted publicly in Retail was 0%
- Simple state changes reached 100%, and internal-note exfiltration was 47.1-76.5%.
- From 250K to 500K tokens, mean GPT-5.5 ASR rose from about 49.0% to about 57.8%.
How to Apply
- Add token-budget curves to injection tests
- Run your red-team script with attacker token caps such as 50K, 100K, and 500K.
- Log success rate per budget and don't treat one pass as proof of safety.
- Put human approval on high-risk tools
- Start with one-call tools like sending email, payments, and deletion.
- Separately block calls that send sensitive data to external channels.
- Remove write tools from read-only tasks
- Narrow the tool list per task type to shrink the attack surface.
- Check whether unnecessary state-changing tools are exposed during normal tasks.
Try It
# Paste into Claude or ChatGPT (simplified version of the paper's method: audit my agent's attack surface)
I run an LLM agent. Using the info below, audit it for indirect prompt injection risk.
User task: {{example user task}}
Agent tool list: {{tool names and descriptions}}
Paths that read external text: {{email, documents, reviews, etc.}}
1. List the paths the agent must read for this task.
2. For each path, classify malicious instruction types that could look like a normal next workflow step.
3. Separate one-call high-risk tools from tools that can leak sensitive data.
4. Suggest one defense for each risk.
Next: apply the defenses and run the same audit again.Terminology
Related Papers
Same Simulation, Different Evidence: Where Retrieved Tool Output Costs LLM Agents Accuracy
Saving long tool output to files cut GPT-5.1 accuracy by 11.3 points; naming the authoritative file restored it.
Fake News, Real Crashes: Information Injection Attacks on LLM Financial Trading Agents
Fake headlines hijacked LLM trading agents 62% of the time versus 14% for prompt injection.
Harness Engineering 101: The LLM is the brain, the harness is the body
An agent is a loop managing a JSON array; 16 chapters build one from scratch
Harness2 by Google Research – Recursive Agent Harnessing
Recursively refining the harness with fixed model weights raised benchmark scores by up to 11.8 points.
Ousted Savannah police officer gave ICE agent husband access to Flock system
A police officer shared her Flock login with her ICE-agent husband; an audit found 983 searches and she was fired
Tmux and Claude Code: Sessions, Send-Keys, and the Ceiling
Running Claude Code agents in tmux works well, but limits appear around four agents.
Original Abstract (Expand)
We formulate indirect prompt injection as a test-time search over a task-dependent attack surface induced by the environment, user task, and injection task. To operationalize this formulation, we introduce an agentic attacker with a dedicated search harness that performs environment reconnaissance, structured reasoning over attack strategies, and adaptive evaluation using victim-agent feedback. Across heterogeneous tasks, we find that increasing attacker test-time compute improves vulnerability discovery and exploitation, while ablations show that explicit strategy management is important for avoiding redundant search and sustaining gains at larger budgets. These results suggest that agentic security evaluations should characterize both the attacker's search procedure and compute budget, rather than treating attack success as a budget-independent property of the victim. More broadly, our findings identify the attacker's adaptive search over the system attack surfaces as an important and underexplored security risk for tool-using agents.