-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

ChatGPT for Cybersecurity Cookbook
By :

In this recipe, we will demonstrate how you can use roles in your prompts to improve the accuracy and detail of ChatGPT’s responses. Assigning roles to ChatGPT helps it generate more context-aware and relevant content, particularly when you need expert-level insights or recommendations.
Ensure you have access to the ChatGPT interface by logging in to your OpenAI account.
By assigning roles, you’ll be able to obtain expert-level insights and recommendations from the model. Let’s dive into the steps for this recipe:
You are a cybersecurity expert with 20 years of experience. Explain the importance of multi-factor authentication (MFA) in securing online accounts, to an executive audience.
Figure 1.16 – ChatGPT response with role-based expertise
You are a CISO with 30 years of experience. What are the top cybersecurity risks businesses should be aware of?
You are an ethical hacker. Explain how a penetration test can help improve an organization's security posture.
Note of caution
Keep in mind that ChatGPT’s knowledge is based on the data it was trained on, which has a cutoff date of September 2021. As a result, the model may not be aware of the latest developments, trends, or technologies in the cybersecurity field that emerged after its training data cutoff. Always verify the information generated by ChatGPT with up-to-date sources and take its training limitations into account when interpreting its responses. We will discuss techniques on how to get around this limitation later in this book.
When you assign a role to ChatGPT, you provide a specific context or persona for the model to work with. This helps the model generate responses that are tailored to the given role, resulting in more accurate, relevant, and detailed content. The model will generate content that aligns with the expertise and perspective of the assigned role, offering better insights, opinions, or recommendations.
As you become more comfortable using roles in your prompts, you can experiment with different combinations of roles and scenarios to obtain the desired output for your cybersecurity tasks. For example, you can create a dialogue between two roles by alternating prompts for each role:
You are a network administrator. What measures do you take to secure your organization's network?
You are a cybersecurity consultant. What additional recommendations do you have for the network administrator to further enhance network security?
By using roles creatively and experimenting with different combinations, you can leverage ChatGPT’s expertise and obtain more accurate and detailed responses for a wide range of cybersecurity topics and situations.
We will experiment with automating role conversations in later chapters.