Applying ChatGPT Roles (Application : AI CISO)
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.
Getting ready
Ensure you have access to the ChatGPT interface by logging in to your OpenAI account.
How to do it…
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:
- To assign a role to ChatGPT, start your prompt by describing the role you want the model to assume. For example, you could use the following prompt:
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.
- ChatGPT will generate a response that aligns with the assigned role, providing a detailed explanation of the topic based on the expertise and perspective of a cybersecurity expert:
Figure 1.16 – ChatGPT response with role-based expertise
- Experiment with assigning different roles for different scenarios, such as the following:
You are a CISO with 30 years of experience. What are the top cybersecurity risks businesses should be aware of?
- Alternatively, you can use the following:
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.
How it works…
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.
There’s more…
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:
- Role 1:
You are a network administrator. What measures do you take to secure your organization's network?
- Role 2:
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.