Handling Edge Cases in Prompts
Common Edge Cases
1. Empty or Minimal Input "What should I do?" Handle with: "If the request is unclear, ask clarifying questions."
2. Out-of-Scope Requests Handle with: "If asked about topics outside [DOMAIN], politely redirect."
3. Harmful Requests Handle with: "Never provide [harmful content]. Instead, [alternative]."
4. Ambiguous Requests Handle with: "If multiple interpretations exist, ask for clarification or address all interpretations."
Defensive Prompting
Add guardrails:
Testing Edge Cases
Create a test suite:
Recovery Strategies
When things go wrong: