Pre-deployment testing checks an agent against the attacks someone thought to write. A prompt injection that arrives later, inside a web page or a GitHub issue the agent reads mid-task, was never in that test set. Runtime guardrails catch it because they monitor what the agent actually reads and does in production as it happens.
The Prompt Injections Pre-Deployment Testing Cannot Simulate
AI security testing before launch is still worth the effort. Red-team prompts and eval suites catch real problems early, and OWASP lists adversarial testing among its prompt injection mitigations. The catch is that those tests run against a fixed set of inputs chosen before release.
Indirect prompt injection does not originate from that set. It lives in content the agent reads later, such as a support ticket filed next month, a README edited after release, or a product page an attacker controls. You cannot test against a payload nobody has written yet.
Model behavior adds a second gap, since the same input can lead to a different tool choice on another run. OWASP is blunt about where that leaves defenders, stating that “it is unclear if there are foolproof methods of prevention for prompt injection.” A passing test lowers risk without proving it is gone.
What Runtime Guardrails Inspect During Live Sessions
Runtime guardrails sit between the agent and everything it touches, evaluating live traffic instead of a test fixture. A useful set covers four checkpoints:
- User prompts: Screened for injection attempts and sensitive data before they reach the model.
- Tool results: Scanned before retrieved content enters the agent’s context.
- Tool calls: Compared against the task, including the tool, its arguments, and the destination.
- Outputs: Checked for data that should not leave, like credentials or customer records.
Content scanning has limits. OWASP’s own attack scenarios include payloads split across inputs, hidden in images, or encoded to evade filters, so prompt injection detection that only reads text will miss some of them. The stronger signal is behavioral, meaning whether the next action still matches what the user asked for. That check is where AI runtime security earns its place. Pluto’s guide to enterprise AI guardrails makes a related point: a guardrail must enforce policy through a technical control, not just document it.
How Indirect Prompt Injection Reaches an Agent Through Tool Results
Indirect prompt injection doesn’t require the user to type anything malicious. It rides back in on a tool result. Pluto’s research on prompt injection through Apify’s MCP server traces the path. A user asked an agent to inspect a web page, and the agent fetched it with Apify’s browser tool. The scraped page included attacker-written text in a GitHub issue, and the agent received it as a stored result. That text told the agent to call the same tool again with a URL the attacker chose. The agent complied and sent an authenticated request the user never asked for. In eight controlled trials with the same simple payload, it made that second fetch every time.
The attacker never needed the victim’s API token or machine; they only needed control of the content the agent was asked to read. Each step also looked legitimate on its own, with a valid tool, a valid token, and a well-formed request.
Where Runtime Guardrails Interrupt an Injection Mid-Task
Runtime guardrails get three chances to break that chain. The first comes when the tool result arrives, where scanning can flag instruction-like text before the model acts on it. That helps, but it is the easiest layer to slip past.
The second chance is stronger. Before the next tool call runs, the guardrail checks where its arguments came from. In the Apify case, the second URL came from scraped content rather than the user’s request. Pluto’s research recommends this kind of provenance tracking, plus confirming new destinations and keeping open-web retrieval separate from authenticated tools.
The third is the outbound path, where a request to an unapproved destination can be blocked even if everything earlier missed it. In all three cases, enforcement happens outside the model, because the model is the component the injection manipulated.
Final Thoughts
Pre-deployment testing checks whether an agent resists the attacks we already know about. Runtime guardrails check whether what the agent is about to do still matches what it was asked to do. Indirect prompt injection lives in the gap between the two. Keep testing, because it catches obvious failures early, but the injection you didn’t plan for will show up in content that doesn’t exist yet, and only a control watching live sessions will see it.