TL;DR: Modern LLMs learn role separation, instruction hierarchy, and prompt templating through control tokens and system prompts, but those same mechanisms can be abused through control token injection, fake context resets, and XML prompt spoofing, according to HiddenLayer. The security boundary is probabilistic, not absolute, so AI teams need layered runtime controls around the model, not prompt engineering alone.
Editorial analysis by NHI Mgmt Group, based on content published by HiddenLayer: “Inside the Prompt: How LLMs Learn Roles, Follow Instructions, and Get Exploited”.
Key questions
Q: How should security teams reduce prompt injection risk in AI agents?
A: Security teams should reduce prompt injection risk by constraining what enters the context window, limiting tool permissions, and separating untrusted retrieval content from privileged instructions.
Q: Why do system prompts not provide a hard security boundary?
A: System prompts shape model behaviour, but they are still interpreted by the model rather than enforced as an external access control.
Q: What are the signs that an LLM may be vulnerable to instruction spoofing?
A: Warning signs include the model treating user content as if it were developer guidance, unexpected role changes, fake context resets, or tool calls that do not match the approved workflow.
Practitioner guidance
- Treat all context inputs as untrusted Classify prompts, retrieved documents, emails, web content, and repository files as potentially instruction-bearing before they reach the model.
- Separate instruction channels from data channels Keep system prompts, developer instructions, and user or document content clearly isolated so untrusted text cannot masquerade as privileged control.
- Add runtime policy checks around tool calls Gate high-risk actions with external policy enforcement so a manipulated model response cannot directly trigger sensitive tool use or data access.
Bottom line: Prompt structure helps LLMs behave predictably, but it does not create an absolute security boundary around agentic AI.
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
Prompt injection turns instruction hierarchy into a governance problem, not just a model behaviour problem. The article shows that role tokens and system prompts can teach an LLM to prefer one instruction over another, but they do not create an absolute boundary. That means AI programmes should stop treating prompt structure as a control substitute and start treating it as one input to a broader governance design.
A few things that frame the scale:
- AI-related credential leaks surged 81.5% year-over-year in 2025, with the surrounding AI infrastructure leaking 5x faster than core LLM providers, according to the State of Secrets Sprawl 2026.
- 67% of organisations still rely heavily on static credentials despite the risks they pose to agentic AI deployments, according to the 2026 Infrastructure Identity Survey.
A question worth separating out:
Q: Should agentic AI tool access be controlled differently from chat-only use?
A: Yes. Once the model can call tools or touch enterprise systems, prompt manipulation becomes an operational security problem rather than a text-quality problem. Tool access should be gated by external policy, least privilege, and logging, because a compromised prompt can otherwise become a compromised action.
👉 Read our full editorial: LLM role control and prompt injection reshape agentic AI risk