AWS Builder Center
Prompt Engineering for Cybersecurity: Detecting Scams with Claude 3 on Amazon Bedrock

Prompt Engineering for Cybersecurity: Detecting Scams with Claude 3 on Amazon Bedrock

How I engineered dynamic system prompts using Claude 3 Haiku on AWS Bedrock to identify Indian scam patterns during the AWS First Commit Hackathon.

Artificial Intelligence is only as good as the context you provide it. During the AWS First Commit Hackathon, our team built FakeBuster—an app designed to protect vulnerable users from sophisticated financial scams.
While my teammates handled the infrastructure (S3, Transcribe) and the UI, my responsibility was the brain of the operation: Prompt Engineering and AI Model Testing on Amazon Bedrock.

🧠 The Challenge of Scam Detection

We chose Claude 3 Haiku via AWS Bedrock because of its blazing-fast inference speed and high intelligence. However, standard LLMs are often too generic to reliably detect localized scams (like Indian UPI fraud, fake KYC SMS links, or specific lottery hoaxes).
If the model is too sensitive, it flags safe messages (false positives). If it's too relaxed, a scammer gets through (false negatives).

🛠️ Engineering the System Prompt

I spent the hackathon crafting and refining a highly specific System Prompt for our Bedrock API calls. I structured the prompt to force the model to act as a strict cybersecurity analyst. I instructed the model to specifically look for:
  1. Psychological Manipulation: False urgency (e.g., "Your account will be blocked in 24 hours").
  1. Authority Impersonation: Pretending to be SBI, HDFC, or police officials.
  1. Suspicious Call-to-Actions: Demanding an OTP, PAN card, or a quick UPI payment.
I also enforced a strict JSON output schema so our Next.js frontend could reliably parse the  score ,  verdict , and an array of  flags .

💡 What I Learned

Through rigorous testing with real-world scam examples, I learned that prompt engineering is a highly iterative science. Using AWS Bedrock's unified playground made it incredibly easy to tweak temperatures, test edge cases, and refine the context window until our threat-detection accuracy was nearly flawless.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article