Refusing What's Not There

refusing unsupported questions

Part of: FAQ Support Bot

The most important behavior of this bot isn't answering well. It's knowing when to say no . A support bot that confidently answers a question your FAQ never covered is worse than useless, because it misleads the user. This lesson builds the refusal path: a strict, checkable rule for when the bot should decline. What "refusal" means here Refusal is the bot recognizing that a question falls outside its FAQ and returning a fixed, honest "I don't have that in my docs" instead of guessing. It has to hold in two places at once. In the prompt, you tell the model exactly what to say when a question isn't covered and give it an exact phrase to use. In your own code, you use the keyword pre-check from lesson 3 as a second layer that forces a refusal even when the model tries to answer anyway. Prompting for a strict refusal Giving the model an exact string for refusal, instead of "say you don't know," makes refusals recognizable in code (if reply == REFUSAL) and leaves no room for the model to hedge with a half-answer that reads like a refusal but sneaks in a guess. Backing it up in code The prompt alone is a soft guarantee, since models sometimes ignore instructions. So you layer the lesson-

Challenge: Force the Circuit Breaker