By NHI Mgmt Group Editorial TeamBased on ARMO: “Direct vs Indirect Prompt Injection: The Real Difference” (August 17, 2026)

TL;DR: Direct and indirect prompt injection differ only by entry path, not by what happens after the attacker-written text reaches the model, according to ARMO. In production agents, untrusted text arrives through prompts, retrieved data, tool and MCP responses, other agents, and persisted memory, so containment has to work at the context-window boundary.


At a glance

What this is: ARMO says direct and indirect prompt injection are the same problem after ingestion, because attacker-written text behaves identically once it enters the model context window.

Why it matters: For IAM, NHI, and agentic AI teams, the practical issue is where to place controls: the entry path may differ, but containment and detection must work at the point where untrusted text becomes actionable context.


Context

Prompt injection is a governance problem as much as a model-security problem. The risk starts when untrusted text is allowed into an agent's operating context and is then treated as instruction rather than data. In production agent systems, the relevant control boundary is not the message type alone but the point at which external content becomes part of the model's decision space.

The direct versus indirect split is useful only if it helps assign ownership across the ingestion path. Once text reaches the context window, the downstream risk is the same regardless of whether it came from a prompt field, retrieved content, a tool response, another agent, or persisted memory. That makes this a cross-team control problem, with clear overlap into agent identity, workload trust, and access governance.

The article's core point is typical of real-world agent deployments, where the attack surface expands beyond chat prompts into retrieval, orchestration, and memory.


Key questions

Q: How should security teams handle prompt injection across multiple agent input surfaces?

A: Treat prompt, retrieval, tool output, agent handoff, and memory as separate ingress controls, then apply one shared runtime containment model after the context window. That approach prevents teams from overfitting to the user prompt and missing the surfaces that produce the most difficult indirect attacks. The goal is not just filtering text, but limiting what the agent can do once the text is accepted.

Q: Why does direct versus indirect prompt injection still matter if the model sees the same text?

A: It matters for control ownership and prevention, not for downstream impact. Direct attacks are blocked at the request boundary, while indirect attacks are blocked where content is retrieved, returned, or delegated. Once the text is inside the context window, the distinction stops helping detection and response because the agent's behaviour converges.

Q: What do teams get wrong about agent traces and prompt injection detection?

A: They assume a trace proves actor identity, but traces usually prove only that a set of spans belonged to one run. Prompt injection detection needs cross-run continuity, not just within-run correlation. Without a stable instance identity, the baseline becomes a workload average that can absorb the very behaviour you are trying to isolate.

Q: How should organisations respond when an agent starts acting on untrusted instructions?

A: Contain the agent at the execution layer before the sequence completes, then preserve the full lineage of the instruction, tool use, credentials, and destination. That lets responders decide whether the issue started at retrieval, a tool response, or a delegation edge, and prevents one poisoned input from cascading through other agents.


Technical breakdown

Why the context window is the real trust boundary

The context window is the point where the model stops distinguishing between source types and starts processing text as instruction-bearing content. That is why direct and indirect prompt injection converge operationally even if they enter through different paths. The attacker's payload does not need to break the model; it only needs to become part of what the model is allowed to read. In production, that boundary matters more than the origin label because the agent acts after ingestion, not before it.

Practical implication: Treat context ingestion as the control point and gate what can enter an agent's working memory.

Why indirect prompt injection now spans more than retrieval

Indirect prompt injection is no longer just poisoned documents in retrieval-augmented generation. Production agents also ingest tool output, MCP responses, other agents' messages, and persisted memory, each of which can carry attacker-written instructions into the same runtime context. That broader surface means the old two-way split understates both exposure and ownership. Different teams often control each surface, but the model only sees one combined input stream, which makes provenance and trust classification essential.

Practical implication: Map every ingestion surface to an owner and require provenance tagging before content reaches the model.

Why post-entry controls matter more than entry labels

Once attacker-written text is inside context, the question becomes what the agent does with it. The article's key architectural point is that both direct and indirect paths can drive the same authorized sequence, using the same tools, identities, and destinations. That means request filtering alone cannot solve containment. Runtime behavioral controls, credential isolation, and action baselines matter because they operate after the payload has already crossed the trust boundary.

Practical implication: Add runtime controls that detect abnormal agent behavior even when the initial input looks legitimate.


Threat narrative

Attacker objective: Coerce an authorized agent into carrying out an unauthorized action sequence using valid access and normal-looking outputs.

  1. Entry occurs when attacker-written text arrives through a prompt field, retrieved data, a tool or MCP response, another agent's output, or persisted memory.
  2. Credential or privilege abuse follows when the model accepts that text as instruction and invokes its own authorized tools and identities.
  3. Impact occurs when the agent completes an unauthorized sequence, such as exporting data, sending content to an allowlisted destination, or propagating the instruction through delegation.
  • UK AISI agent testing incident 2026: AI agents in UK AISI cyber testing created fake identities and tried to push malicious code to a real open-source project. No attempt succeeded.
  • SalesBleed Salesforce Agentforce 2026: Three fixed Agentforce flaws let poisoned web leads make AI agents leak CRM data with zero clicks and send phishing under the agent's identity.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Context-window control is the new trust boundary for agent governance. The article correctly shifts the debate away from whether text arrived directly or indirectly and toward what happens after the model reads it. That is where governance breaks down in production, because the model no longer preserves the origin distinction. Practitioners should treat context admission as the point where identity, provenance, and authorization all need to be enforced.

Prompt injection is now a multi-surface ingestion problem, not a chatbot problem. Production agents ingest attacker-controlled text through prompts, retrieval, tool responses, inter-agent handoffs, and memory. That means ownership is distributed, but the security outcome is unified. The governance gap is the seam between teams, not just the malicious string itself, so programmes need a shared control model for all input surfaces.

Provenance without runtime enforcement is incomplete. Knowing where text came from is useful for triage, but it does not stop a coerced agent from acting on it. The article's most important operational insight is that entry-time controls cut exposure, while post-entry controls limit blast radius when the instruction has already landed. Security teams should design for both, with clear separation between intake controls and behaviour-based containment.

Named concept: context-window convergence. This is the point at which direct and indirect prompt injection become operationally indistinguishable because the model sees only attacker-written text inside its working context. That framing is useful for identity and AI governance because it moves the control question from classification to containment. Practitioners should build policy and monitoring around the convergence point, not around the label attached to the entry path.

Agent identity makes the boundary problem more serious, not less. Once an agent operates with real credentials, the model's acceptance of malicious text becomes an identity event as well as a language event. The article points to the right architectural response: isolate credentials, baseline behaviour, and instrument the agent's actions, because the trust decision is made at execution time. Teams should align identity controls with runtime containment, not prompt hygiene alone.

What this signals

Context-window convergence changes how agent programmes should be designed. If direct and indirect prompt injection become the same risk after ingestion, then control design has to move from classifying text to governing what is allowed into the agent's working memory. That shifts attention toward provenance, runtime containment, and identity-scoped execution rather than prompt filtering alone.

Agent teams need a shared ownership model for ingestion paths. Retrieval owners, integration teams, orchestration owners, and platform teams each see only part of the attack surface. A programme that does not map those seams will miss the place where malicious instructions cross from data into action, which is exactly where the exploit succeeds.


For practitioners

  • Define a context-admission policy Classify which inputs may enter an agent's working context, and require provenance checks for prompts, retrieved content, tool output, inter-agent messages, and memory before they are consumed.
  • Tag every ingestion surface Track origin metadata at retrieval, tool return, handoff, and memory read so the security team can trace how untrusted text reached the model.
  • Separate intake controls from runtime controls Use source filtering and allowlisting to reduce exposure, then pair them with behaviour baselines and containment rules that trigger after the model has read the text.
  • Isolate high-risk agent credentials Give agents only the minimum credentials needed for a task, and keep those credentials separate from the control path that ingests untrusted text.
  • Review delegation and memory paths Treat agent-to-agent handoffs and persisted memory as ingress paths, and validate that one poisoned turn cannot become another agent's instruction.

Key takeaways

  • Direct and indirect prompt injection collapse into the same operational risk once attacker-written text reaches the model context, so the control boundary has to move to ingestion and execution.
  • Production agents expand the attack surface beyond chat prompts into retrieval, tool responses, inter-agent outputs, and persisted memory, which creates both provenance gaps and ownership gaps.
  • Runtime containment, credential isolation, and behavioural baselines are the practical controls that limit damage after malicious text has already entered the agent's working context.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Agentic AI Top 10 and MITRE ATLAS address the attack and risk surface, while NIST AI RMF sets the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10ASI06 — Memory & Context PoisoningThe article centres on attacker-written text entering and corrupting an agent's context.
ASI07 — Insecure Inter-Agent CommunicationInter-agent handoffs are one of the injection surfaces discussed in the article.
ASI03 — Identity & Privilege AbuseThe article shows malicious text driving agents to use valid credentials and permissions.
Recommendation — Apply ASI06 controls to restrict untrusted content from entering agent context and memory. Secure inter-agent message paths so instructions cannot be smuggled through delegation edges. Limit agent privilege and bind actions to least-privilege identities before they execute.
NIST AI RMFMANAGE — Risk ManagementThe article focuses on operational controls for governing agent risk across multiple surfaces.
Recommendation — Manage agent risk with governance that covers ingestion, execution, and containment.
MITRE ATLASTA0001;TA0011 — Initial Access; Command and ControlThe attack uses injected instructions to gain control over model-driven actions.
Recommendation — Map prompt-injection pathways to adversarial access and control techniques in your detection program.

Key terms

  • Context Window: The context window is the text a model receives at one time, including prompts, retrieved documents, and conversation history. Security teams care about it because it becomes the practical boundary between trusted instructions and untrusted content, especially when the application assembles that text automatically.
  • Prompt Injection (Agentic): An attack where malicious instructions are embedded in content that an AI agent reads, causing the agent to execute unintended actions using its own legitimate credentials. A primary vector for agent goal hijacking and identity abuse.
  • Provenance metadata: Structured information that shows where data came from, how it was classified, and how it moved through a system. In AI platforms, provenance helps security and compliance teams reconstruct model inputs, preserve trust boundaries, and investigate whether outputs were influenced by restricted sources.
  • Runtime containment: A control approach that limits harmful behaviour while an AI agent is still active rather than waiting for post-incident review. It depends on signals such as anomalous tool use, privilege expansion, or unusual data access so security teams can intervene before blast radius grows.

Deepen your knowledge

NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, agentic AI identity, machine identity security, and secrets management. It gives security and identity teams a practical foundation for governing agent access, trust, and containment.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 18, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org