Check for assumptions is a prompting technique that prevents an LLM from guessing when required input or conditions are missing. Add an explicit fallback instruction so the model can decline the task or report that no result was found. section 2.4.4
A practical assumption check should:
- Identify the condition that must be satisfied, such as the presence of matching email addresses or source code. section 2.4.4 section 4.2.2
- State the exact fallback response, such as “No .com emails found” or “No risks could be found.” section 2.4.4 section 4.2.2
- Use delimiters to separate instructions from the data or code being analyzed. section 2.4.4 section 4.2.2
Filtering emails safely
Prompt: “Extract all emails ending in .com from the JSON delimited by three hashes. If none exist, simply write ‘No .com emails found.’” With matching addresses, the output lists addresses such as baveray0@apple.com and pyandell4@ning.com; with records lacking emails, it returns the stated fallback instead of inventing results. section 2.4.4
Analyzing code
Prompt: “Analyze the code delimited by triple hashes and identify risks affecting Performance, security, and interoperability. If no code is provided, respond with ‘No risks could be found.’” Require the format Risk - Quality Characteristic - Explanation and provide an example such as a buffer-overflow risk. section 4.2.2
