SwindleA / phishing_detection_extension

0 stars 0 forks source link

Figure out Prompt Design #16

Closed SwindleA closed 9 months ago

SwindleA commented 10 months ago

We need to figure out the best way to ask GPT about the email. Here is a suggested json that is sent from the front end to back end:

`{ 'sender_email' : 'email@email.com' 'receiver_email' : 'an@gmail.com' 'subject' : 'email subject' 'body_message' : ''main body of the email'

} `

On the backend, two things need to be done:

  1. GPT needs to be prompted that it is trying to detect a phishing email
  2. Take the information from the front end and format it in such a way that GPT can understand it.

Here is an example:

  1. Initial prompt: "You are trying to detect phishing emails
  2. "Here is the sender's email: " + sender_email
  3. "Here is the recipient's email: " + receiver_email
  4. "Here is the subject of the email: " + subject
  5. "Is this email contents phishing: "+ body_message //this needs to be a yes no response.
  6. GPT response yes/no
  7. "The following information is from a phishing email: "
  8. repeat 2-4
  9. "Explain why this email is(not) phishing: " + body_message

Return the yes/no and the explanation to the front end.

NOTE: we need to get the yes/no then ask for the explanation because in my (Adrian) experience, the yes/no does not always line up with the explanation.

Make sure to get explicit yes/no response for categorizing the email.

We may also want to limit the length of the evaluation in order to not display too much information to the user.

SwindleA commented 9 months ago

Updated JSON:

const payload = { 'sender_email': sender_email, 'recipient_email': recipient_email, 'subject': subject, 'email_message' : email_message }

This is what is sent from the google extension to the backend for further prompt design

SwindleA commented 9 months ago

NOTE: more up to date front end is in issue #7 so no further front end changes should be made in this issue.

SwindleA commented 9 months ago

Most up to date JSON: payload= { 'sender_email': sender_email, 'sender_email_domain' : email_domain, 'sender_name': sender_name, 'recipient_email': recipient_email, 'subject': subject, 'email_message' : decoded }