Building with AILesson 65 of 80

Module 7 · Safety, security and the adversary

Moderation before and after the model

In this lesson

  • 9 min read
  • 8 reading sections
  • Knowledge check
  • Lesson 5 of 10 in this chapter

This chapter’s goalThreat-model an AI feature and defend it by architecture: name every channel by which untrusted text reaches the model and every channel by which its output reaches a privileged action or the outside world, restrict each with a control that does not depend on the model’s obedience, layer moderation and abstention with measured false-positive costs, and state plainly what a user must be told and what you cannot promise about a provider’s handling of their data.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmNot availableNot available
Full audiobookNot availableNot available

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 9Free · no account needed
Lesson steps

Two directions

Content enters the model from a user and leaves it as an answer. Either can be harmful, and they fail differently. An input can be abusive, an attempt to extract something the product must not produce, or a person in distress. An output can be wrong in a way that hurts: dangerous instructions, defamation, sexual content, a slur the model reproduced from a document. Moderation is a check on both, and it is a separate concern from the security controls of the last three lessons: those protect systems, this protects people.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the Python, from Zero, for AI exam.

Stuck on something?Ask Sayali, your AI tutor

How to cite: Addaly (2026) ‘Moderation before and after the model’, in Building with AI. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/building-with-ai/moderation-before-and-after (Accessed: 29 November 2026).