dungeon29 commited on
Commit
47d69b8
·
verified ·
1 Parent(s): b24c875

Update llm_client.py

Browse files
Files changed (1) hide show
  1. llm_client.py +13 -3
llm_client.py CHANGED
@@ -259,9 +259,10 @@ class LLMClient:
259
 
260
  # Custom Prompt Template
261
  # Custom Prompt Template - Stricter Format
262
- template = """You are CyberGuard - an AI specialized in Phishing Detection.
 
263
  Task: Analyze the provided URL and HTML snippet to classify the website as 'PHISHING' or 'BENIGN'.
264
-
265
  Classification Rules:
266
  - PHISHING: Typosquatting URLs (e.g., paypa1.com), hidden login forms, obfuscated javascript, mismatched branding vs URL.
267
  - BENIGN: Legitimate website, clean code, URL matches the content/brand.
@@ -271,7 +272,16 @@ class LLMClient:
271
  CLASSIFICATION: [PHISHING or BENIGN]
272
  CONFIDENCE SCORE: [0-100]%
273
  EXPLANATION: [Write 3-4 concise sentences explaining the main reason]
274
- """
 
 
 
 
 
 
 
 
 
275
 
276
  PROMPT = PromptTemplate(
277
  template=template,
 
259
 
260
  # Custom Prompt Template
261
  # Custom Prompt Template - Stricter Format
262
+ template = """<|im_start|>system
263
+ You are CyberGuard - an AI specialized in Phishing Detection.
264
  Task: Analyze the provided URL and HTML snippet to classify the website as 'PHISHING' or 'BENIGN'.
265
+ Check specifically for BRAND IMPERSONATION (e.g. Facebook, Google, Banks).
266
  Classification Rules:
267
  - PHISHING: Typosquatting URLs (e.g., paypa1.com), hidden login forms, obfuscated javascript, mismatched branding vs URL.
268
  - BENIGN: Legitimate website, clean code, URL matches the content/brand.
 
272
  CLASSIFICATION: [PHISHING or BENIGN]
273
  CONFIDENCE SCORE: [0-100]%
274
  EXPLANATION: [Write 3-4 concise sentences explaining the main reason]
275
+ <|im_end|>
276
+ <|im_start|>user
277
+ Context from knowledge base:
278
+ {context}
279
+
280
+ Input to analyze:
281
+ {question}
282
+ <|im_end|>
283
+ <|im_start|>assistant
284
+ """
285
 
286
  PROMPT = PromptTemplate(
287
  template=template,