Traditional firewalls were built for packets, sessions, and known exploits, not semantic manipulation of language models. Prompt injection and context-jacking exploit intent, instructions, and conversation state, so they can bypass controls that only see traffic metadata. Effective defense requires contextual inspection of user input, model output, and retrieval content across the AI interaction path.
Why Traditional Controls Miss Prompt Injection
Traditional network firewalls and application controls are built to inspect packets, sessions, headers, and known exploit patterns. Prompt injection and context-jacking operate at the semantic layer instead: they manipulate instructions, conversation state, retrieval results, and tool-use intent. That means a request can look harmless in transit while still steering a model into unsafe behavior once it is inside the application context.
This is why the failure mode is often invisible to perimeter tooling. A firewall can block malicious payload signatures, but it cannot reliably tell whether a sentence inside a document or chat message is a command for the model or ordinary content. The same limitation shows up in real incidents such as Gemini AI Breach - Google Calendar Prompt Injection, where the harmful instruction was embedded in content the system treated as trusted context. OWASP’s OWASP Agentic AI Top 10 and NIST guidance both point to the same issue: security has to evaluate meaning, not only transport. In practice, many security teams discover prompt injection only after the model has already acted on untrusted context, rather than through intentional perimeter detection.
How It Works in Practice
Effective defense requires controls across the full AI interaction path: user input, retrieved content, system prompts, model output, and downstream tool calls. The key is to treat the model as an interpretive engine, not a trusted decision boundary. Current guidance suggests using layered inspection and policy checks at runtime, because static allowlists and regex filters are too brittle against adversarial phrasing.
Practically, teams are moving toward these patterns:
- Separate trusted instructions from untrusted content so retrieval data cannot silently override system intent.
- Apply context-aware policy checks before tool execution, especially where the model can send email, query databases, or trigger workflows.
- Limit what the model can see by default, then expand context only for the current task.
- Log prompt, retrieval, and tool-use lineage so suspicious instruction switching can be investigated.
- Use output filtering and human approval for high-impact actions, not just for sensitive keywords.
NIST SP 800-207 Zero Trust Architecture helps frame the right posture: never trust a request just because it arrives inside an approved session, and NIST SP 800-53 Rev 5 Security and Privacy Controls reinforces the need for control enforcement, monitoring, and separation of duties. For NHI practitioners, the Ultimate Guide to NHIs - Standards is useful because it maps this problem to identity, entitlement, and runtime control rather than generic web filtering. NHIMG’s research on Amazon Q AI Coding Agent Compromised shows the practical risk: once an agent can chain tools, malicious context can become action, not just text. These controls tend to break down when retrieval sources are broad and untrusted because the model cannot reliably distinguish instructions from content without additional policy enforcement.
Where Firewalls Still Help and Where They Do Not
Tighter filtering often increases false positives and operational overhead, requiring organisations to balance safety against developer productivity and user experience. That tradeoff matters because prompt injection is not a pure network problem, but firewalls still have value when they reduce exposure to obvious payloads, exfiltration channels, and known malicious endpoints.
The hard boundary is this: network and application controls can constrain delivery, but they do not understand intent. They cannot reliably determine whether a pasted paragraph is a command to the model, whether a retrieved document should override prior instructions, or whether a tool call is justified by the current task. Best practice is evolving toward layered controls that combine content provenance, policy-as-code, and runtime authorization decisions.
There is no universal standard for this yet, but practitioners should assume that any system exposing chat history, retrieval-augmented generation, or agent tool access is vulnerable to context-jacking unless the model is isolated from untrusted instructions. The DeepSeek breach is a reminder that AI security failures often combine data exposure with weak trust boundaries, not just a single control gap. In practice, perimeter controls fail fastest when untrusted content can enter the model’s working context and drive privileged actions before any downstream validation occurs.
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 CSA MAESTRO address the attack and risk surface, while NIST AI RMF, NIST Zero Trust (SP 800-207) and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | A2 | Prompt injection is a core agentic application threat. |
| CSA MAESTRO | TRUST-02 | MAESTRO addresses trust boundaries across AI workflows. |
| NIST AI RMF | MAP | AI RMF maps risks from manipulative inputs and unsafe outputs. |
| NIST Zero Trust (SP 800-207) | PL/AA | Zero Trust fits untrusted content moving through AI systems. |
| NIST CSF 2.0 | PR.PT-3 | Protective technology supports runtime enforcement around AI actions. |
Classify untrusted instructions and gate model actions by threat-aware policy.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on August 27, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org