Skip to content
Edition NigeriaGlobal
Country: Mexico

You are in the Mexico edition. Type your country to switch.

The Americas

Set up your profile

You are learning in the Mexico edition, with examples in pesos and from Mexico.

AI safety and security at work · Lesson 2 of 9

Defending against prompt injection

Indirect prompt injection hides instructions in documents, emails and web pages that an AI tool reads for someone else. Filters alone cannot stop it, so organisations layer defences: separate data from instructions, limit tools, require approvals and monitor.

Intermediate11 min read5 steps

This lesson is complete in writing. A video for it is on its way.

What you will learn

  • Explain how indirect prompt injection reaches an AI tool through documents, emails and web pages.
  • Explain why filtering suspicious text cannot be the only defence.
  • Apply defence in depth: separate data from instructions, limit tools, require approvals and monitor.
  • Rewrite a weak prompt so that pasted content is clearly marked as data, and know the limits of doing so.

Key terms in this lesson

Indirect prompt injection
Hidden instructions planted in content an AI system reads on someone's behalf, such as a web page, document or email, aiming to steer what the system does.
False positive
An alert raised on something innocent, such as a genuine payment flagged as fraud.
Defence in depth
Using several independent layers of protection, such as access limits, approvals and monitoring, so that one failure does not expose everything.
Least privilege
The principle that each person, program or key gets only the access it needs for its job, which limits the harm from mistakes or a compromised account.

Step 1 of 5

Indirect injection: the threat hides in content

Opening this step…

Step 2 of 5

Why filtering alone is not enough

This step opens when you finish the one above.

Step 3 of 5

Defence in depth

This step opens when you finish the one above.

Step 4 of 5

Separating data from instructions in your prompts

This step opens when you finish the one above.

Step 5 of 5

Limit, approve and monitor

This step opens when you finish the one above.

Key takeaways

The key takeaways open when you finish every step.

Lesson quiz

5 questions. You need 85% to pass.

The quiz opens when you finish every step.

Read first

Stockertim Learn is education. It explains how investing works and never recommends buying or selling anything.

Up next

English