Prompt engineering deliberately designs and modifies inputs to guide a generative model toward a desired output or behavior. In phishing detection, specifying a strictly yes-or-no response improves formatting, while removing that constraint invites an explanation of suspicious email characteristics. section 5.2.2 section 5.2.3
A practical prompt-engineering workflow includes:
- Define the expected response format, such as a strictly yes-or-no classification. section 5.2.2
- Remove or revise constraints when a rationale is needed, allowing the model to list suspicious email characteristics. section 5.2.3
- Supply one representative genuine or phishing email before asking the model to classify a new message; this is one-shot prompting. section 5.2.4
- Pass complete email data and a classification prompt to an API when embedding detection in software. section 5.2.4
Teaching detection of a ghost domain
ChatGPT initially treats an email from the nonexistent domain emailinspector.net as genuine. A prompt containing examples of genuine and phishing emails enables it to recognize the same message as phishing, illustrating one-shot prompting. section 5.2.4
Figure 5.18 One-shot prompting to teach ChatGPT to catch a particular kind of phishing email from a specific domain.
Shows one-shot prompting applied to a particular phishing pattern from a specific domain. section 5.2.4


















































