Scope and Boundary Setting
What you'll learn: How to explicitly define your chatbot's capabilities and limitations to prevent user frustration and misuse.
The Core Idea
When you build a chatbot, one of the most critical tasks is telling the model — and through it, the user — what it can and cannot do. This is scope and boundary setting. Without clear boundaries, users will ask for things your chatbot isn't designed to handle, leading to poor experiences, hallucinations, or security risks.
Think of it like posting office hours for a professor. If students know you're only available Tuesday 2-4pm for calculus questions, they won't show up Wednesday asking about chemistry. Similarly, your chatbot needs to "know" its domain and politely redirect or decline out-of-scope requests.
Where This Fits in Your System Prompt
After defining your chatbot's persona and tone (lesson 726), you extend the system prompt with explicit capability statements:
- What topics it covers (e.g., "You assist with Python programming questions only")
- What actions it can take (e.g., "You can search documentation but cannot execute code")
- What it must refuse (e.g., "You do not provide medical or legal advice")
- How to handle boundary violations (e.g., "Politely redirect users to appropriate resources")
Why It Matters
Without boundaries, the model may attempt to answer anything, producing unreliable or harmful outputs. With boundaries, you reduce hallucinations, improve trust, and make behavior predictable. It's a form of defensive design that manages user expectations from the first interaction.
Key Takeaway: Scope and boundary setting in your system prompt explicitly tells the chatbot what it can and cannot do, preventing out-of-scope requests and managing user expectations from the start.