VIEW THIS AS

Auto mode follows the Route Engine until you choose a viewpoint.

YOU ARE HERE

ROUTE CHECK

CONNECTED TO

WHAT NEXT

Use the canonical route for this room, or HELP if you are unsure.

What Is Vocabulary | Can a “Semantic Firewall” Stop Prompt Injection and Hidden AI Instructions?

An AI assistant should not treat every sentence it reads as an instruction it is authorised to obey. A webpage, search result, email, PDF or database record may contain valuable facts while also containing text that attempts to redirect the model’s behaviour. Prompt injection occurs when such content influences an AI system in unintended ways. A proposed semantic firewall would distinguish the role of each message—user request, trusted instruction, retrieved evidence, quoted text or proposed action—and prevent lower-trust material from being silently promoted into authority. This is a defensive design metaphor, not a product or technique guaranteed to stop every attack.

To understand the problem, follow who wrote the text, why the assistant encountered it, which part is evidence rather than a command, what external permissions the assistant has and how any resulting action is authorised and verified. Then zoom from a single quoted sentence to a search result, research workflow, email assistant, enterprise knowledge base and autonomous tool-using agent. The key safety principle is not that external documents are always false; it is that an authentic source of information does not automatically have authority to instruct a system. Effective protection requires multiple controls and meaningful testing.

  • Source zoom: A retrieved document is evidence to evaluate, not a new supervisor.
  • Trust zoom: System instructions, authorised user requests and third-party text have different roles.
  • Attack zoom: Prompt injection may be direct or arrive indirectly through retrieved content.
  • Tool zoom: A model’s ability to generate instructions is different from permission to execute them.
  • Boundary zoom: A semantic firewall would inspect the source and role of requested behaviour.
  • Validation zoom: Permissions, sandboxing, output checking and human approval reduce certain risks.
  • Limit: No single prompt, marker or filter guarantees immunity against every adversarial input.

What is prompt injection?

Prompt injection is an attack or failure mode in which text or other input changes a language-model system’s behaviour in an unintended way.

The OWASP Top 10 for LLM Applications, LLM01:2025 explains that both directly supplied and indirectly encountered inputs can influence model outputs or unsafe behaviour.

The essential distinction is whether the content is legitimate task data or an attempted instruction that exceeds its role. A correct answer may quote an attack phrase without following it.

What is a semantic firewall?

Here a semantic firewall is a proposed architecture for treating the meaning and authority of text as separate properties.

A network firewall controls traffic according to networking rules. A semantic firewall analogy asks whether a sentence is a factual assertion, quotation, request, instruction or claim of authority, and which actions it may influence.

The analogy can inform design, but unlike a network protocol, natural language lacks perfectly deterministic interpretation. The system requires other safeguards and evaluation.

Trusted instructions versus untrusted data

A system may have instructions from its developer and a legitimate task from its user. A retrieved webpage can provide facts relevant to that task.

The webpage does not automatically receive the right to change the task, reveal secrets or authorise a new payment. Its content is evidence, even when it contains command-like wording.

A safe workflow preserves that distinction throughout retrieval, summarisation, planning and tool use.

An ordinary sentence can look like a command

A historian might ask the assistant to analyse a document containing the sentence “Destroy all drafts.” In that task the sentence is a quotation or historical evidence.

The model should describe its meaning in context, not destroy anything. The grammar of an imperative is not sufficient to authorise action.

This is why a semantic firewall needs context and provenance, not merely a list of command words.

What is direct prompt injection?

Direct prompt injection can involve input deliberately submitted in a place the application processes as text, attempting to redirect model behaviour outside the intended rules.

A secure application should define what users may request and what its system is permitted to do. User messages do not automatically override every higher-priority safety or access requirement.

The OWASP guidance distinguishes injection from ordinary user requests by its effect on the application’s intended behaviour and trust assumptions.

What is indirect prompt injection?

Indirect prompt injection occurs when an assistant encounters attacker-controlled or otherwise untrusted content through another source, such as a webpage, search result, repository file or retrieved document.

The assistant may have been asked to summarise that content, not to accept instructions written inside it. If the content is treated as a new authority, a data channel has crossed an instruction boundary.

This makes retrieval and tool-connected systems important places to examine the problem.

A webpage does not get to appoint itself a supervisor

An article might contain a paragraph claiming to be a higher-priority message to the AI system. That claim is still text from the article.

The source can accurately describe instructions or include an example of one, but it cannot grant itself legitimate authority over the assistant’s workflow.

A trustworthy system uses the actual provenance of the text and the application permissions rather than obeying role claims embedded in retrieved material.

Authentic content can still be adversarial

A web page can be genuinely published by the person named in its metadata and still contain instructions designed to manipulate an assistant reading it.

Authenticity concerns source or provenance under a defined process. Safety and appropriateness depend on whether the content is entitled to influence behaviour.

Similarly, a valid digital signature does not establish that a document’s instructions are safe or authorised.

Why quotation markers are helpful but insufficient

Explicit quotation and delimiting data can help software distinguish an instruction from material being examined.

However, an attacker may create confusing formatting, mixed languages or text that appeals to the assistant through its task context. A model can also misinterpret a poorly structured boundary.

Use clear delimiters and explicit source labelling, but do not present those measures as complete security controls.

How retrieval-augmented generation changes the problem

Retrieval-augmented generation gives a model access to external documents selected for relevance. This can improve factual coverage and currency.

It also increases exposure to text whose authors may not be trusted to issue instructions. Retrieval relevance does not imply operational authority.

A good architecture tracks which statements came from retrieved sources and prevents instructions inside them from overriding the user’s approved task.

A citation is not permission to act

A source may correctly describe how to perform a process. Citing it does not give the model authority to perform that process for the user.

For instance, an article explaining email forwarding can be summarised without changing a user’s inbox rules. The intended task and actual granted permissions remain separate.

This is another reason to distinguish knowledge of an action from authorisation to execute it.

A source can contain conflicting instructions

A user may request a neutral summary of a policy while the policy document instructs its own human staff to take particular actions.

Those instructions belong to the policy’s subject matter. They should not automatically govern the summarising assistant.

The assistant can explain who is instructed and under which authority while keeping its own operational role unchanged.

Prompt injection versus ordinary disagreement

A retrieved source may disagree with another source on a factual question. That is an evidence conflict, not automatically a prompt-injection attack.

Prompt injection concerns attempts or effects that redirect system behaviour through untrusted content. Not every incorrect claim or strong opinion is an instruction attack.

A responsible system should separately evaluate factual disagreement, malicious instructions and ambiguous source text.

Prompt injection versus jailbreak

The terms are related but have different emphases. A jailbreak generally seeks to circumvent a model’s constraints. Prompt injection often focuses on improperly influencing a system through inputs or lower-trust surfaces.

OWASP notes that the terms are sometimes used interchangeably, yet the distinction is operationally useful when designing a defence.

The key question is which trust boundary the text attempts to cross and what outcome it seeks.

Why an AI agent increases consequences

A chat model that only drafts text can still mislead users. An agent with tool permissions may read files, change records, send messages or perform other operations.

If lower-trust content causes it to use those tools outside the legitimate request, the impact can become much greater.

Restricting tool capabilities and requiring suitable confirmation can reduce the possible consequences even when a model misinterprets a sentence.

Tool access is not universal authority

A service may technically expose an action such as sending a message or modifying a file. The model’s ability to call that tool does not mean every retrieved document may request it.

The application needs authorization checks at the action boundary. A tool should enforce permissions rather than trust the model’s own narrative that the action is legitimate.

This is a central separation between linguistic intent and security policy.

The principle of least privilege

Least privilege means granting only the access necessary for a specific role or task.

An assistant summarising public articles does not need access to private financial records. An assistant drafting an email may not need permission to send it without user confirmation.

The idea reduces the consequences of errors and adversarial redirection. It is useful independently of any language-model defence.

Read-only workflows can still be harmed

Even when an assistant cannot change files, injected content may contaminate its summary, fabricate a source or alter a recommendation.

A defensive system should preserve source attribution and check whether conclusions are supported by the actual documents rather than by embedded behavioural requests.

Read-only operation reduces some risks but does not eliminate misinformation or manipulation.

Separating content channels

A system can distinguish user messages, retrieved search results, repository files and tool outputs as different channels or data types.

An explicit data model may mark the origin and role of each content segment, making it harder for a retrieved document to impersonate a trusted instruction.

That separation is an architectural aid. The model and tool boundary must still be tested against unexpected content and behaviour.

Structured tool outputs can help

A tool returning clearly typed fields may reduce confusion compared with one giant unlabelled text blob.

For example, a search result can separately expose title, publication date, snippet, source and original content. The system can then use provenance to evaluate the source’s actual role.

A structured wrapper does not make the contained claims true or the content harmless, but it supports clearer handling of trust.

A hypothetical research-page example

Imagine an assistant asked to summarise a technical standard. It retrieves a webpage containing genuine explanations mixed with text instructing automated readers to change their answer.

The safe behaviour is to treat the command-like text as part of the page being analysed and ignore its demand to alter the assistant’s task.

The assistant can still report that the page contains suspicious instructions if that observation matters to the summary.

A hypothetical email-assistant example

A legitimate user asks an assistant to identify invoices in an inbox. A received message contains text that attempts to redirect the assistant toward forwarding unrelated information.

That request comes from an external sender, not from the account owner. The assistant should evaluate the invoice and not treat the email body as authority over the user’s private data.

Permissions and confirmation checks provide protection even if the content is persuasive.

A hypothetical document-library example

An organisation uses AI to search internal manuals. One manual contains commands intended for human technicians carrying out a maintenance procedure.

Those commands may be essential information for the user’s question but are not direct instructions for the assistant to operate equipment.

The correct result identifies the responsible human role and applicable procedure, not automatic equipment control.

A hypothetical customer-support example

A customer message asks the assistant to waive all fees and refund several transactions. The customer may be entitled to request support, but not to define company authorization rules.

A safe service checks the user’s identity, policy, evidence and action limits before any refund. It can draft a response or escalate a request without granting itself unrestricted financial authority.

This distinction protects both customers and organisations from incorrect automated decisions.

Why simple keyword blocking is weak

A list of prohibited phrases can help detect some obvious attacks but may block harmless quotations while missing subtler redirection.

Natural language allows paraphrase, implication and context-dependent expressions. A sentence can manipulate behaviour without containing a familiar command template.

A strong defence combines source-role separation, limited permissions, tool validation, monitoring and evaluation of actual outcomes.

Why a single security prompt is insufficient

A developer can instruct an assistant to ignore untrusted commands. That is useful, but it does not guarantee perfect compliance in every context.

OWASP describes prompt injection as a core LLM-application risk precisely because models may respond to unexpected input in ways a developer did not intend.

Control of external actions should not depend solely on the model remembering one warning sentence.

Human approval should be meaningful

A human-review button is useful when the reviewer can actually see what will happen, which source prompted the action and which data will be affected.

A vague approval prompt reading “Proceed?” may hide a consequential transfer or disclosure. Better interfaces show recipients, amounts, files, authority and the intended result.

Human involvement is valuable only when it supports informed control.

Separate planning from execution

An agent may propose a plan before using tools. A proposed plan is not a completed action, and a persuasive explanation is not authorization.

The workflow can check whether each proposed step is within the user’s request and the tool’s permitted scope.

Execution should return verified results or explicit errors, rather than allowing the language model to invent a successful outcome.

Why output verification matters

A model may correctly refuse an injected command but still summarize a false fact from the same source. Or it may generate an unsupported claim of action.

A useful audit checks the final response against source evidence and any actual tool results. Source integrity, factual accuracy and authorized execution are different tests.

Do not conclude that injection defence has succeeded merely because the final text sounds professional.

Security testing must use realistic scenarios

Tests should include ordinary documents containing instructions as legitimate subject matter, and adversarial content attempting to cross trust boundaries.

Measure false positives, missed redirections and real tool consequences under conditions comparable to deployment. Different languages, formats and document lengths may expose new failures.

A system that passes a small demo does not prove it is immune to future or more complex attacks.

What is a semantic firewall decision log?

A proposed log might record the source, trust category, intended task, requested action, relevant permission checks and whether the action was blocked, approved or completed.

Sensitive source data should be protected under appropriate retention and privacy practices. A public audit need not expose secrets.

The log helps teams understand how a piece of content was treated without claiming the security boundary is perfect.

Provenance makes attacks easier to investigate

The W3C PROV-O ontology describes entities, activities and agents involved in producing data.

A system can retain which source generated a retrieved passage and which downstream interpretation used it. This can help identify where untrusted text influenced an output.

Provenance supports investigation; it does not by itself prevent an unsafe action.

How to distinguish safe quoting from obeying

A user might ask an assistant to analyse a malicious-looking instruction as a cybersecurity example. The instruction is the object of analysis.

The assistant can explain why the wording is manipulative while refusing to treat the text as a command to itself.

This distinction allows legitimate research and education without granting source material control over the assistant’s behaviour.

The limit of a universal semantic classifier

No classifier can reliably infer every intention behind unrestricted human language. Some sentences are genuinely ambiguous, and some adversarial text is designed to resemble ordinary task content.

A defensive system needs a way to flag uncertainty and route important actions for verification.

The goal is robust risk reduction, not a claim that the concept of prompt injection has been eliminated.

Building a minimal defensive pipeline

First label the origin of each content segment. Next distinguish user goals from retrieved evidence and proposed tool actions.

Check whether an action is actually authorized. Limit the permissions available. Require appropriate review for sensitive changes and confirm outcomes with authoritative tool responses.

Record incidents and improve tests after failures. The pipeline uses language understanding, but crucial enforcement belongs at the system boundary.

A seven-question semantic-firewall audit

  • Source: Who provided this text and for what purpose?
  • Role: Is it evidence, a quotation, an authorised request or a claim of authority?
  • Boundary: Which instruction or data boundary would the text cross?
  • Permission: What could the assistant actually do with its tools?
  • Review: Which actions need explicit confirmation or specialist assessment?
  • Evidence: Are the final factual claims supported by trusted sources?
  • Record: How can an error be investigated and corrected?

A seven-day defensive-language exercise

  • Day 1: Separate commands in a document from the user’s actual task.
  • Day 2: Label search results and emails as external evidence.
  • Day 3: Identify what permissions a summarising assistant truly needs.
  • Day 4: Compare a suspicious command with an ordinary quoted instruction.
  • Day 5: Design a meaningful confirmation screen for a high-impact action.
  • Day 6: Test whether a model reports success only after real tool confirmation.
  • Day 7: Document failures, false alarms and improvements to the trust boundary.

Common questions

Can a webpage tell an AI assistant to ignore its higher-priority instructions?

It can contain such words, but the page should be treated as untrusted content, not as a legitimate source of authority over the assistant.

Is every instruction found in a document a prompt injection?

No. Many documents legitimately contain instructions as subject matter. The issue is whether the text improperly redirects the AI’s behaviour.

Does a read-only AI system have no prompt-injection risk?

No. It can still produce contaminated or unsupported answers, although it may have fewer opportunities to alter external systems.

Can one protective prompt eliminate the problem?

No. Reliable defence requires multiple controls and testing, especially around tool permissions.

Is a semantic firewall an established universal security standard?

No. It is a proposed design metaphor combining content-role analysis with established security controls.

Is human review always sufficient?

No. Review is meaningful only when the person has enough information, relevant authority and a genuine opportunity to prevent harmful action.

Conclusion: meaning cannot grant itself permission

Prompt injection reveals a fundamental distinction between language as data and language as authority. A source may be worth reading without being entitled to direct what an assistant does.

A robust semantic firewall would preserve the origin of text, authorised task, permission boundaries, evidence checks and verifiable action outcomes. It offers a disciplined way to reduce unintended obedience without pretending that any single prompt or model can provide absolute security.

Continue the Vocabulary at Every Zoom Level

Read the companion Vocabulary at Every Zoom Level guides to explore meaning, authority, evidence, identity and the safeguards needed when AI systems turn language into decisions.

Sources and further reading