TL;DR: LLM applications break the web-app testing model because instructions, data, tools, and outputs share one trust boundary, so prompt injection, excessive agency, and improper output handling become the dominant risks, according to Escape. The practical lesson is that teams must test the whole agentic system and freeze proven exploits as regression tests, because model updates can silently reopen them.
NHIMG editorial — based on content published by Escape: LLM security testing and how attackers hijack AI using compromised NHIs
By the numbers:
- 96% of technology professionals identify AI agents as a growing security threat, and 66% believe this risk is immediate.
- 80% of organisations report their AI agents have already performed actions beyond their intended scope, including accessing unauthorised systems, sharing sensitive data, and revealing access credentials.
- When AWS credentials are exposed publicly, attackers attempt access within an average of 17 minutes.
Questions worth separating out
Q: What breaks when prompt injection defenses are not in place for LLMs?
A: When prompt injection defenses are weak, attacker-controlled text can override the model's intended instructions, especially when the text arrives through retrieved content or external documents.
Q: When does AI governance become an IAM and NHI problem?
A: It becomes an IAM and NHI problem as soon as autonomous systems use credentials, APIs, or delegated access to perform actions.
Q: How do security teams reduce the impact of unsafe LLM output handling?
A: They should block direct execution of model output until it has been validated, normalised, and checked against the intended action.
Practitioner guidance
- Map every model sink and tool boundary Inventory where model output can land, including browser renderers, databases, shells, and ticketing systems, then classify which sinks require sanitisation before display or execution.
- Restrict MCP tool scope and response trust Review each MCP tool for least privilege, narrow the data it can return, and treat tool descriptions and tool responses as untrusted until they are validated by policy.
- Add regression tests for indirect prompt injection Convert every proven jailbreak, tool-poisoning path, or output-handling flaw into a build-time test that reruns on each model or prompt change.
What's in the full article
Escape's full analysis covers the operational detail this post intentionally leaves for the source:
- A repeatable LLM pentesting loop that maps recon, exploitation, proof, and regression into a testable workflow.
- A vulnerable MCP lab with code-level examples for tool poisoning, indirect prompt injection, and unsafe file access.
- Practical guidance on measuring probabilistic findings as hit rates instead of pass or fail.
- Source-level detail on how browser sinks, tool outputs, and prompt updates change the risk profile after deployment.
👉 Read Escape's full analysis of LLM security testing and MCP risk →
MCP prompt injection and output handling: are your controls keeping up?
Explore further
LLM security is now an identity and access problem, not just an application-testing problem. Once a model can call tools, read files, and render output, its permissions become part of the trust model. That puts tool scope, session reach, and output sinks squarely into the governance layer, especially where NHI-style service accounts or API-backed agents sit behind the model. Practitioners should treat model-connected privileges as governed access, not as auxiliary application logic.
A few things that frame the scale:
- 80% of organisations report their AI agents have already performed actions beyond their intended scope, including accessing unauthorised systems, sharing sensitive data, and revealing access credentials, according to AI Agents: The New Attack Surface report.
- 92% agree governing AI agents is critical to enterprise security, yet only 44% have implemented any policies to do so.
A question worth separating out:
Q: How should security teams test MCP-connected AI systems for real risk?
A: Start with the trust chain, not the model output. Map every context source, then test whether authentication, encryption, validation, and tool authorization hold when inputs are malicious or altered. The goal is to prove that the agent cannot turn untrusted context into action, data exposure, or tool misuse.
👉 Read our full editorial: LLM security testing breaks the web-app playbook for MCP apps