An assistant may need to read a customer email, a web page or an uploaded document to complete a task. Those sources can contain useful facts and instructions aimed at redirecting the assistant. The workflow must preserve the difference. External content is evidence to interpret within the user's task; it is not a new authority that can expand permissions, change recipients or redefine the system's operating rules.

Label the origin of information

Keep trusted configuration separate from retrieved or user-submitted material in the application's data model. Record where each passage came from and why it was included. Avoid copying document text into a privileged instruction field merely because that field is convenient. The model should receive enough context to understand that the passage is material being analysed.

Maintain this distinction through intermediate steps. A summary generated from an untrusted document does not become authoritative simply because another model wrote it. Preserve source references and uncertainty when passing information between components. Otherwise, an instruction embedded in the original document can be restated as a seemingly legitimate recommendation by a later stage.

Extract only what the task requires

For bounded tasks, convert external material into a limited set of fields before it reaches action selection. A delivery request may need an order identifier and requested date, not an unrestricted narrative instruction for the next agent. Validate those fields against business records. This reduces the amount of untrusted language that can influence later decisions.

Do not treat extraction as a complete security boundary. A malicious value can still be well formed, and a model can misclassify intent. Combine the narrower representation with record checks and tool permissions. OWASP's prompt-injection guidance describes layered mitigations because no simple prompt phrase reliably settles every case.

Keep authority in the application

The application should determine which tools are available, which records are in scope and whether an action needs approval. A passage saying that the user already approved an export is only a claim in the source. Verify authorisation through the trusted interaction state, not through text found inside a file or returned by a search tool.

Protect destinations as well as actions. An otherwise legitimate summary should not be sent to an address introduced by an unrelated document instruction. Resolve recipients and output locations from the authorised task. If the source contains a genuine business request to change them, present that as a proposed change requiring the appropriate decision.

Handle suspicious content without losing useful evidence

When suspicious instructions appear, keep the source available for review while preventing it from directing the workflow. The system may still be able to extract ordinary facts safely within its boundaries. Decide whether the task can continue with reduced scope or should stop. Avoid silently treating the entire document as trusted because most of its content looks normal.

Test this behaviour with controlled examples in documents, messages and tool results. Inspect the resulting action requests as well as the final answer. Record blocked attempts in a proportionate way that supports diagnosis without spreading sensitive content unnecessarily. The objective is a workflow that can use outside information while retaining the authority structure established by its users and application.

TAKE IT FORWARD

The key decisions.

  • Preserve source origin through summaries and intermediate steps.
  • Validate narrow extracted fields before they affect actions.
  • Resolve permissions and destinations from trusted application state.

Sources & further reading

Primary references for the concepts discussed. Check the applicable documentation when planning implementation.

  1. OWASP: prompt injection
  2. OpenAI: safety in building agents