PRODUCTION · LESSON 45 OF 278

Securing Agents

Treat outside content and tool inputs as untrusted.

What you will learn

Treat outside content and tool inputs as untrusted.

In simple words

Prompt injection attempts to make a model follow instructions hidden in untrusted content. Keep trusted policy separate, validate tool inputs, restrict permissions, and require approval for risky actions.

Visual explanation: Trusted policy vs. untrusted data

A document's content is isolated from system policy before it reaches the model or a tool.

WATCH THE IDEA

Trusted policy vs. untrusted data

Playing
Untrusted contentPolicy boundarySafe tool call
  1. 1Observe: Untrusted content
  2. 2Transformation: Policy boundary
  3. 3Outcome: Safe tool call

Observe: Untrusted content. A document's content is isolated from system policy before it reaches the model or a tool.

The diagram highlights Untrusted content, Policy boundary, Safe tool call. Use the labels to trace the main relationship from left to right.

Real-world example: Document-connected agent

An agent reads supplier PDFs that might contain malicious hidden instructions.

What the team decides: Treat document text as untrusted data and enforce independent policy and tool authorisation.

Risk to avoid: Prompt injection can turn a useful retrieval pipeline into a command channel.

Technical explanation

Prompt injection attempts to make a model follow instructions hidden in untrusted content. Keep trusted policy separate, validate tool inputs, restrict permissions, and require approval for risky actions.

Common misconception

This concept is not a guarantee of a correct outcome by itself. Its value depends on suitable evidence, careful implementation, and evaluation against the real task.

QUICK QUIZ

How should an agent handle instructions found inside an untrusted document?

Practical application

Treat document text as untrusted data and enforce independent policy and tool authorisation.

Key takeaway

Untrusted content can inform an answer; it must not control the system.

Next concept

Continue with Cost and Latency.

Engineering view

Treat document text as untrusted data and enforce independent policy and tool authorisation.

Internals view

Treat outside content and tool inputs as untrusted. Prompt injection attempts to make a model follow instructions hidden in untrusted content. Keep trusted policy separate, validate tool inputs, restrict permissions, and require approval for risky actions.

Architecture view

Consider the Untrusted content → Policy boundary → Safe tool call flow, and make the system's inputs, checks, and outcomes explicit.

Was this lesson helpful?

Lesson discussion

Comments are reviewed before publication. Keep discussion focused on learning and do not post private information.

Loading discussion…

Your quiz answer and current lesson are saved on this device. Sign in to explore account-backed learning features.

Content version 1 · Last reviewed 2026-10-16