Security teams should control the sources that can contribute to runtime context, validate the provenance of retrieved content, and strip instruction-bearing material before it reaches the model. The goal is to make context assembly observable and policy-driven, so untrusted content cannot silently become operational input.
Stopping Instruction Smuggling at the Context Boundary
Security teams should treat runtime context as a controlled input stream, not as a passive retrieval result. The core issue is that malicious instructions can hide inside documents, tickets, web pages, prompts, or tool outputs that the model is later asked to trust. OWASP’s OWASP Top 10 for Agentic Applications 2026 is useful here because it frames instruction injection as a trust-boundary problem, not just a prompt-writing problem.
The practical implication is that teams need visibility into where context originates, which transformations it undergoes, and what policy gates sit between retrieval and generation. If untrusted content is allowed to enter the context window without being tagged, filtered, or constrained, the model may follow embedded instructions with the same confidence it gives to legitimate system guidance. In practice, many security teams encounter this only after a retrieval pipeline, browser feed, or support workflow has already allowed hostile text to become part of the model’s operational input.
How the Control Needs to Work Across Retrieval, Filtering, and Tooling
Stopping malicious instructions requires more than a single keyword filter. The control has to operate across the full context-assembly path: source selection, retrieval, preprocessing, ranking, and final assembly. Teams should distinguish between content that is useful to answer a user request and content that is allowed to influence the model’s behaviour. That distinction matters because a document can be relevant to the query and still be unsafe to execute as instruction-bearing text.
A useful operating model is to classify inbound material before it is ever promoted into runtime context. For example:
- trusted policy or system content can remain instruction-bearing;
- retrieved content from external or low-trust sources should be treated as data, not instruction;
- content containing imperative language, role claims, or prompt-like syntax should be stripped or neutralised unless explicitly authorised;
- tool outputs and RAG snippets should carry provenance so the model can separate evidence from directives.
This is where governance and model risk intersect. The NIST AI 600-1 Generative AI Profile is relevant because it emphasises managing AI risks through mapped controls, traceability, and ongoing evaluation of system behaviour. That aligns with context controls that are observable rather than implicit. If a team cannot show which source contributed which text, it cannot reliably prove that malicious instructions were excluded.
Where teams often go wrong is assuming a single sanitisation step solves the problem. Instruction filtering must be paired with allowlisting, source scoring, and runtime separation between evidence and command. If the pipeline collapses all retrieved text into one undifferentiated prompt blob, the control breaks down as soon as an attacker finds a way to influence any upstream source.
Where the Answer Changes: Agentic Workflows, RAG, and Mixed-Trust Content
Tighter context controls often increase latency and operational overhead, requiring organisations to balance safety against retrieval quality and user experience. That tradeoff becomes sharper in agentic workflows, where the model can chain tool calls, revisit memory, or reuse prior context across steps. The more autonomous the workflow, the more important it is to keep instruction-bearing content narrowly scoped and explicitly authorised.
There is also a genuine difference between systems that summarise content and systems that act on content. In consensus terms, most practitioners agree that untrusted text should not be allowed to issue direct instructions. Where the industry is less settled is how aggressively to normalise or redact content that is both useful and potentially adversarial. Some teams prefer hard stripping of imperative language; others preserve text but isolate it from the system channel and require separate trust labels. The right answer depends on whether the model is only drafting output or also making decisions, calling tools, or updating memory.
MITRE ATLAS adversarial AI threat matrix is useful when the concern is not just malicious prompt text, but the adversary behaviour behind it, including manipulation of model inputs and workflow abuse. For agent-heavy systems, the CSA MAESTRO agentic AI threat modeling framework adds a second perspective on how tool-using systems can be subverted through their orchestration layer.
Where this guidance breaks down is when the system has no reliable way to separate trusted instructions from retrieved data, or when downstream tools are allowed to act on raw model output without an independent policy check.
Risk and Threat Considerations
Malicious instructions in context create prompt injection risk, data exfiltration risk, and workflow abuse risk. The exposure is greatest when retrieval, memory, browser access, or tool invocation can turn text into action without a trust boundary in between.
Failure mechanism: An attacker plants instruction-bearing text in a source the system is likely to retrieve or summarise. If the pipeline does not classify source trust, strip directive language, or isolate evidence from commands, the model may treat hostile text as higher-priority instruction and follow it during generation or tool use.
Impact: The system can leak data, ignore policy, make unsafe tool calls, or produce outputs shaped by attacker intent rather than user intent. In agentic workflows, that can extend beyond bad text generation into account misuse, unauthorized actions, or contaminated memory that persists across later sessions.
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, MITRE ATLAS and CSA MAESTRO address the attack and risk surface, while NIST AI 600-1 and CIS Controls v8 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | A2 | Directly addresses malicious instructions entering agent and LLM context. |
| Recommendation: Treat retrieved text as untrusted input unless explicitly authorised to steer behavior. | ||
| NIST AI 600-1 | GV | Context provenance and policy-driven filtering are AI governance controls. |
| Recommendation: Require traceable context controls and oversight for how model inputs are assembled. | ||
| MITRE ATLAS | AML.T0042 | Maps to adversarial manipulation of model inputs and prompt channels. |
| Recommendation: Model input channels should be treated as attack surfaces subject to manipulation. | ||
| CSA MAESTRO | THREAT-04 | Agentic workflows are vulnerable when context can be polluted before tool use. |
| Recommendation: Separate trusted instructions from retrieved content before agents can act on it. | ||
| CIS Controls v8 | 14 | Teams need operational discipline to recognise and handle context-injection paths. |
| Recommendation: Security processes should include handling rules for untrusted AI inputs and content. | ||
Practitioner Guidance
What to prioritise: Start with the sources that can most directly inject runtime context, especially retrieval indexes, browser-fed content, ticketing integrations, and tool outputs. Those are the places where trust most often gets blurred before the model ever sees the text.
What to verify: Verify that every context item carries provenance and a trust label that survives preprocessing. If the pipeline cannot show whether a snippet came from a trusted policy source, a user upload, or an external retrieval source, then the model is being asked to infer trust from raw text alone.
Decision rule: If content is allowed to influence model behaviour, it should be explicitly authorised as instruction-bearing content; if it is only evidence, it should be neutralised so it cannot steer the model. The common mistake is to treat “relevant” as if it also means “safe to execute.”
Practitioner takeaway: The strongest control is not a better prompt, but a better boundary between evidence and instruction. Teams that cannot enforce that boundary should assume malicious context will eventually be interpreted as operational guidance.
Related resources from NHI Mgmt Group
- How should security teams stop AI agents from installing malicious skills?
- How should security teams stop context window poisoning in AI coding assistants?
- How should security teams stop browser AI agents from trusting malicious web content?
- How should security teams stop malicious CI/CD workflow commits from executing?
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on September 6, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org